make: improve builds on old distros with pre-edition2024 Rust - #411
Open
cyphar wants to merge 2 commits into
Open
make: improve builds on old distros with pre-edition2024 Rust#411cyphar wants to merge 2 commits into
cyphar wants to merge 2 commits into
Conversation
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
libpathrs itself is buildable with pre-1.85 Rust but the existence of
test-only crates in our workspace that have transitive post-edition2024
dependencies causes builds of libpathrs to fail with older cargo
versions:
error: failed to get `anyhow` as a dependency of package `fake-enosys v0.0.0 (/home/abuild/rpmbuild/BUILD/libpathrs-0.2.5/contrib/fake-enosys)`
...
Caused by:
failed to parse the `edition` key
Caused by:
this version of Cargo is older than the `2024` edition, and only supports `2015`, `2018`, and `2021` editions.
The hacky solution here is to extend hack/with-crate-type.sh to also
remove the workspace.members key from Cargo.toml when doing builds via
make. This works fine except that we now also need to make backups of
Cargo.lock because dropping workspace members causes cargo to GC the
dependencies locked in Cargo.lock -- which we don't want.
Unfortunately this means that with-crate-type.sh will probably need to
remain for longer than I hoped (originally it was meant to be dropped
with an MSRV of 1.64).
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Owner
Author
|
Damn, this is still broken in other ways. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
libpathrs itself is buildable with pre-1.85 Rust but the existence of
test-only crates in our workspace that have transitive post-edition2024
dependencies causes builds of libpathrs to fail with older cargo
versions:
The hacky solution here is to extend hack/with-crate-type.sh to also
remove the workspace.members key from Cargo.toml when doing builds via
make. This works fine except that we now also need to make backups of
Cargo.lock because dropping workspace members causes cargo to GC the
dependencies locked in Cargo.lock -- which we don't want.
Unfortunately this means that with-crate-type.sh will probably need to
remain for longer than I hoped (originally it was meant to be dropped
with an MSRV of 1.64).
Signed-off-by: Aleksa Sarai cyphar@cyphar.com