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

cargo: use resolver 2 #2238

Merged
merged 1 commit into from
Mar 15, 2022
Merged

cargo: use resolver 2 #2238

merged 1 commit into from
Mar 15, 2022

Conversation

happysalada
Copy link
Contributor

Pull Request

What does this PR do?

use resolver 2 from cargo.
This enables mainly to propagate the --no-default-features flag to workspace crates.
I mistakenly thought before that it was enough to have edition 2021 enabled. However it turns out that for virtual workspaces, this needs to be explicitely defined.
https://doc.rust-lang.org/edition-guide/rust-2021/default-cargo-resolver.html

This will also change a little how your dependencies are compiled. See https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver for more details.

Just to give a bit more context, this is for usage in nixos. I have tried to do the upgrade today with the latest version, and the no default features flag is just ignored.

Let me know if you need more details of course.

PR checklist

Please check if your PR fulfills the following requirements:

  • Does this PR fix an existing issue?
  • Have you read the contributing guidelines?
  • Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!

@Kerollmops
Copy link
Member

Kerollmops commented Mar 15, 2022

Hey @happysalada,

Thank you for your PR. I just reread the article summarizing the new behavior and it seems that it will not impact the time it takes to compile meilisearch, as it should compile multiple times the dependencies based on the features we use, so it look good to me. However, I would like to let @MarinPostma review this PR too.

If I summarize the change: You added the resolve 2 to the workspace this way you are able to pass the --no-default-feature flag at the root of the repo.

@happysalada
Copy link
Contributor Author

Thanks a lot for the review. That is exactly the idea!
To give a little more context, the nix builder builds without network access to make sure builds are reproducible. So any assets has to be passed to it beforehands (with the sha-256 checked). Removing that network access call for the dashboard during the build is main idea. In order to enable it, assets will be downloaded and checked before hand passed to it.

@irevoire irevoire added this to the v0.27.0 milestone Mar 15, 2022
Copy link
Contributor

@MarinPostma MarinPostma left a comment

Choose a reason for hiding this comment

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

no objections!

Thanks you for you contribution :)

bors merge

@bors
Copy link
Contributor

bors bot commented Mar 15, 2022

@bors bors bot merged commit 469aa8f into meilisearch:main Mar 15, 2022
@curquiza curquiza added the v0.27.0 PRs/issues solved in v0.27.0 label Aug 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v0.27.0 PRs/issues solved in v0.27.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants