Skip to content

make: improve builds on old distros with pre-edition2024 Rust - #411

Open
cyphar wants to merge 2 commits into
mainfrom
cargo-workspace-hotfix
Open

make: improve builds on old distros with pre-edition2024 Rust#411
cyphar wants to merge 2 commits into
mainfrom
cargo-workspace-hotfix

Conversation

@cyphar

@cyphar cyphar commented Aug 28, 2026

Copy link
Copy Markdown
Owner

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

cyphar added 2 commits August 28, 2026 16:37
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

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cyphar

cyphar commented Aug 28, 2026

Copy link
Copy Markdown
Owner Author

Damn, this is still broken in other ways.

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.

1 participant