Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,15 @@ impl FuzzProject {
.arg(&build.triple);
// we default to release mode unless debug mode is explicitly requested
if !build.dev {
cmd.args(["--release", "--config", "profile.release.debug=true"]);
cmd.args([
"--release",
"--config",
"profile.release.debug=true",
"--config",
"profile.release.lto=false",
]);
} else {
cmd.args(["--config", "profile.dev.lto=false"]);
Copy link
Member

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.

Copy link
Author

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"),
        ]);

}
if build.verbose {
cmd.arg("--verbose");
Expand Down