-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lib order in conanbuildinfo.props is generated randomly every time #4542
Comments
Hi @sinall Thanks for reporting this issue. It seems that this is mostly a boost package issue, not a conan issue, but I would discuss here and wait for feedback:
gen_libs = tools.collect_libs(self)
# List of lists, so if more than one matches the lib like serialization and wserialization
# both will be added to the list
ordered_libs = [[] for _ in range(len(lib_list))]
# The order is important, reorder following the lib_list order
missing_order_info = []
for real_lib_name in gen_libs:
for pos, alib in enumerate(lib_list):
if os.path.splitext(real_lib_name)[0].split("-")[0].endswith(alib):
ordered_libs[pos].append(real_lib_name)
break Possible fixes:
Will discuss with @lasote |
I'm ok ordering the list of |
Perfect, yes, I agree, having a deterministic collect_libs() make sense. |
- Sort library list name when calling collect_libs Signed-off-by: Uilian Ries <uilianries@gmail.com>
- Sort library list name when calling collect_libs Signed-off-by: Uilian Ries <uilianries@gmail.com>
Implemented, will be released in Conan 1.14 |
@memsharded I have installed Conan 1.14, but the issue still exists. |
Hi @sinall This is really weird, now the output of Could you please provide more data to reproduce it? Besides your OS which is Windows 10, which python version are you using? How did you install Conan? Could you please double check that you don't have another Conan version in the python that might be executing ( BTW, something that I noticed, is that the issue was because of source control. The thing is that |
conanfile.py
The 'libboost_math' libs in the updated conanbuildinfo.props is not sorted. |
Thanks for the feedback. I have just realized what the issue is. The issue is not generated by I am afraid you are hitting a problem by pulling 2 different versions of boost, you are using the modular boost from bincrafters, transitively from cpprestsdk, and the monolithic boost that is in conan-center. This can't be done, as both boost can be version incompatible, but they do not conflict because they have different names. You'd need to decide which boost do you want to use, and then follow that. If you are going with the monolithic boost you have explicitly declared, you'd need to adapt (to fork) the cpprestsdk to use that boost. Even if using the modular boost, the result shouldn't vary from consecutive installs. Was that the |
The diff is between Conan 1.12 and Conan 1.14 (maybe 1.13 above). I will use monolithic boost. I have already declared it in conanfile.py. I thought Conan could resolve the conflict and manage the dependencies for me. |
Yes, they are not sorted, they will never be. Only from Conan 1.14 and newer, the output will be deterministic. It doesn't make sense to compare with previous Conan versions, but from Conan 1.14 and newer only. Also, please take the above comment into account: it is not recommended to put the
That is the thing, Conan is not aware that the modular packages from bincrafters are packaging the same. If you decide to create a package for zlib, that is called "MyZCompression", conan doesn't have a way to know that it will collide with the |
@memsharded I will consider ignoring conanbuildinfo.props. Since different branches may have different conanfile.py, I will regenerate those temp files once I switch to a different branch. On the other hand, I still expect Conan could generate deterministic |
Yes, exactly. The
Yes, totally. From now on (versions Conan 1.14 and newer), Conan should generate always the same order for the |
@memsharded If I have only boost in |
Hi @sinall I have just tried again, with exactly your conanfile.py above. I add the conanbuildinfo.props to my source control, and do consecutive calls to Regarding the order, you should know that there are 2 orders:
In either case, from now the result is deterministic, and ordered according to the macro scale (graph) first, and by micro scale (libs within a package) second. |
@memsharded libboost_math related libs change order every time with Conan 1.14.1 on my computer, is it because I use previously installed boost? You mentioned:
In that case, how can I re-download and install boost? |
Just tried to
|
Can't reproduce here. My output is always the same:
I'll try to come up with a script so we can both test it exactly the same way. |
OK. Should it be?
|
@memsharded Any findings? Previously, if I have only boost in conanfile.py, then it generates libs in order. So I guess there's something wrong. |
To help us debug your issue please explain:
I'm using conan-1.12.2 on Windows-10.
conanfile.py
The order of libboost_math libs is different each time I run
conan install
. It is annoying when using source control tool.The text was updated successfully, but these errors were encountered: