Skip to content

Package fails to build with cargo 1.75 #32

Description

@eddelbuettel

Congratulations on getting a new version to CRAN.

Now. the Ubuntu LTS releases only have rustc and cargo up to version 1.75. The build then fails as follows:

Using cargo 1.75.0
Using rustc 1.75.0 (82e1608df 2023-12-21) (built from a source tarball)
Building for CRAN.
Cleaning previous `src/Makevars`.
Writing `src/Makevars`.
`tools/config.R` has finished.
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0# Check if NOT_CRAN is false and unzip vendor.tar.xz if so
if [ "" != "true" ]; then \
        if [ -f ./rust/vendor.tar.xz ]; then \
                tar xf rust/vendor.tar.xz && \
                mkdir -p /mnt/build/noble/rshift/src/rshift/src/.cargo && \
                cp rust/vendor-config.toml /mnt/build/noble/rshift/src/rshift/src/.cargo/config.toml; \
        fi; \
fi
export CARGO_HOME=/mnt/build/noble/rshift/src/rshift/src/.cargo && \
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/root/.cargo/bin" && \
RUSTFLAGS=" --print=native-static-libs" cargo build -j 2 --offline --lib --release --manifest-path=./rust/Cargo.toml --target-dir ./rust/target
error: failed to parse lock file at: /mnt/build/noble/rshift/src/rshift/src/rust/Cargo.lock

Caused by:
  lock file version 4 requires `-Znext-lockfile-bump`
make: *** [Makevars:28: rust/target/release/librshift.a] Error 101
ERROR: compilation failed for packagershift

The use of 'lock file version 4' implies 1.78 which is not availble. I have been told last week by @JosiahParry that you can circumvent this by setting rust_version = "1.65.0" in you Cargo.toml to not rely on newer features such as lockfile version 4.

This would allow wider distribution of your package so maybe this is something to consider for the next upload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions