Does lix-2.96 require nightly rust? I tried to package it for non-nixos linux distribution and getting errors about nightly feature requirements:
ninja -v -l17 -j17
[0/235] /opt/rust-bin-1.99.0//bin/cargo -Z unstable-options build --artifact-dir=/dev/shm/portage/sys-apps/lix-2.96.0/work/lix-2.96.0-build/tools/licxxbridge -p licxxbridge
error: the `-Z` flag is only accepted on the nightly channel of Cargo, but this is the `stable` channel
See https://doc.rust-lang.org/book/appendix-07-nightly-rust.html for more information about Rust release channels.
FAILED: [code=101] tools/licxxbridge/licxxbridge
/opt/rust-bin-1.99.0//bin/cargo -Z unstable-options build --artifact-dir=/dev/shm/portage/sys-apps/lix-2.96.0/work/lix-2.96.0-build/tools/licxxbridge -p licxxbridge
ninja: build stopped: subcommand failed.
Is it expected?
Apologies for the delay in the reply, it’s expected because we rely on options that are in rustc stable but locked behind the -Zunstable-options, we use RUSTC_BOOTSTRAP=1 to make this happen in NixOS. If you can do the same in your packaging, that’ll make your life easier.
Oh, thank you! RUSTC_BOOTSTRAP=1 was enough to get it to build. Silly question: shoudn’t meson.buildset it itself? Or it’s required at meson setup for meson internals as well?
That’s a tough one, the reasoning is that RUSTC_BOOTSTRAP=1 is a secret flag we should avoid to use as much as possible, see RUSTC_BOOTSTRAP - The Rust Unstable Book so we leave it to the outside environment to opt-in to use a rustc stable with that flag or to plug a rustc unstable without that flag.
This means the problem is pushed onto the packagers and people responsible for deciding how the environment looks like. Nixpkgs has plenty of these examples (rg RUSTC_BOOTSTRAP), so we followed prior art here.