-
Notifications
You must be signed in to change notification settings - Fork 440
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
Fix typos with calculating flags for lto setting #3119
base: main
Are you sure you want to change the base?
Conversation
Default behavior was incorrect as the `unspecified` should have no-op on the compile flags. However this was not the case due to incorrect conditions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Yeah shoot, sorry I should have foreseen this. IMO having "unspecified" map to object_only is the better experience because it will result in faster compile times by default. What do you think about adding a new mode of "manual" or "skip" that totally leaves these flags alone? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for the response from @havasd to #3119 (comment)
As this LTO settings and these flags are a total can of worms and I consider it a strong breaking change. In our project we experimented with them a lot and there are lots of misleading elements in the documentation. For example Also based on this code cargo decides does some calculations based on all crates. If we start to mix it with I would think that even if we want to default For now I would leave it like this. I am planning to have additional changes as we would like to use this feature but it may require some adjustments. |
Good call on the iOS builds, that is something I missed in the original impl! Although IMO I would consider building Rust code for iOS a bit of an edge case? I could be wrong though! Regardless, folks building for iOS could set
FWIW the implementation in #3104 is specifically based on that exact calculation from Cargo. AFAICT what that code tries to do is determine how the resulting library should be generated, and in the case a single crate shows up multiple times in the build graph it merges the determinations together. The implementation that is currently merged in
I might be missing some nuance but I don't think this is much of an issue, at least not in the current implementation?
This is great! I'm always looking for ways to make builds shorter and run times faster! Personally I am still in favor of introducing a "manual" option (I'll whip up a PR) and keeping the existing impl as-is, for two reasons:
All that being said, I'm 100% happy to merge this PR if the majority of folks think so, and/or follow the recommendations of @illicitonion and @UebelAndre, I'm just a contributor here :) |
Here's a PR that implements the "manual" option if we need it, #3120, no worries if we discard it and instead go with the approach in this current PR! |
Fixed typos in #3104
Default behavior was incorrect as the
unspecified
should have no-op on the compile flags. However this was not the case due to incorrect conditions.#3104 could break users who are already having special LTO flags but with custom toolchains.
I will have some additional fixes but this seemed more urgent to me to keep the old behavior intact before 0.56.0
cc: @ParkMyCar , @UebelAndre