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

Change Default Build Options #138

Merged
merged 7 commits into from
Apr 9, 2024
Merged

Change Default Build Options #138

merged 7 commits into from
Apr 9, 2024

Conversation

sjudson
Copy link
Contributor

@sjudson sjudson commented Apr 2, 2024

This PR implements a new build profile, release-unoptimized, which is inserted in the Cargo.toml of any new nexus project as well as used for the examples folder of the nexus-zkvm repo. This new profile is equivalent to release except with opt-level = 0.

It then:

a) sets the default profile for cargo nexus run to dev,
b) sets the default profile for cargo nexus prove to release-unoptimized,
c) enables a --profile option for both commands.

@sjudson sjudson requested review from govereau and slumber April 2, 2024 20:09
Copy link

vercel bot commented Apr 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nexus-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 9, 2024 6:23pm

Comment on lines 9 to 10
/// Build artifacts with the release profile. Equivalent to "--profile release".
#[arg(short, name = "r", conflicts_with = "profile")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you think --profile=release isn't sufficient? This is also reflected in the code as it conflicts.

--profile is explicit, --release for usual cargo is for distinction between debug and optimized builds, in our case it's more involved.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with prove command

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was just looking to retain parity with the previous args (at least for cargo nexus run). Happy to remove if we want the user to be fully explicit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that release doesn't work as intended, I think we should only allow it with explicit usage, at least for the time being.

@govereau wdyt?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I agree it should be disabled by default if we think there is a good chance the translation will not work with release. Probably we should go back to a 32-bit encoding so the we don't have this issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll remove the -r flag.

@sjudson sjudson merged commit 9fdee02 into main Apr 9, 2024
6 checks passed
@sjudson sjudson deleted the opt_fix branch April 9, 2024 21:07
@sjudson sjudson mentioned this pull request May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants