-
Notifications
You must be signed in to change notification settings - Fork 110
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
Disable lto and explicit profile #385
base: main
Are you sure you want to change the base?
Conversation
Enabling LTO results in link errors, see rust-fuzz#384 for more info.
I haven't looked at the actual PR yet, but I think we can make it so that we have a Footnotes
|
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! LGTM with the nitpick below addressed.
src/project.rs
Outdated
} else { | ||
cmd.args(["--config", "profile.dev.lto=false"]); |
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.
Can you do this in the above .arg(..).arg(..)
method chain, since it is added in both dev and non-dev, and then just have an if
without an else
for adding the !build.dev
extra args? That would cut down on duplication a little.
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.
I think this is a comment on the first commit, at this commit the two config options are slightly different since they contain the profile name profile.release.lto=false
vs profile.dev.lto=false
which I think makes it hard to directly refactor as you suggest.
But this actually changes how you suggest in later commits as part of making the profile support more generic and we end up with:
cmd.args([
&format!("--profile={profile}"),
"--config",
&format!("profile.{profile}.debug=true"),
"--config",
&format!("profile.{profile}.lto=false"),
]);
@fitzgen I'm not sure what is wrong with CI. I ran the |
I've retriggered CI, just in case it was some weird ephemeral issue (haven't really had those issues as far as I can remember) |
Fixes #384.
I included both the disable LTO bit and the capability to support custom profiles. I'm happy to drop either one.
I'm concerned about how custom profiles will interact with these uses of
build.release
andbuild.dev
:cargo-fuzz/src/project.rs
Lines 233 to 235 in a608970
and
cargo-fuzz/src/project.rs
Lines 241 to 251 in a608970
I'm unclear how to determine the right condition for a custom profile -- might be a reason to drop that bit.