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

allow building with --locked #20

Open
jtmoon79 opened this issue May 27, 2024 · 1 comment
Open

allow building with --locked #20

jtmoon79 opened this issue May 27, 2024 · 1 comment
Assignees

Comments

@jtmoon79
Copy link

jtmoon79 commented May 27, 2024

tl;dr I would like to build bins with option --locked

From this failed build I got error

Run moonrepo/setup-rust@v1
  with:
    channel: 1.70.0
    bins: cross
    targets: aarch64-apple-ios
    cache: true
    cache-target: debug
    inherit-toolchain: false
    target-dirs: target

...

  WARN The package cargo-cache v0.8.3 will be installed from source (with cargo)
 WARN The package cross v0.2.5 will be installed from source (with cargo)

...

   Compiling cfg-if v1.0.0
error: failed to compile `cargo-cache v0.8.3`, intermediate artifacts can be found at `/var/folders/w3/xh1ngrc13bg46kmhfdprbpyw0000gn/T/cargo-installgoVcWl`

Caused by:
  package `cargo-platform v0.1.8` cannot be built because it requires rustc 1.73 or newer, while the currently active rustc version is 1.70.0
  Try re-running cargo install with `--locked`

From this rust.yml code

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1
  MSRV_UPLOAD: "1.70.0"
jobs:
  job_cross_targets_macos:
    name: cross ${{ matrix.target }} on macos-13
    strategy:
      matrix:
        target:
          - x86_64-apple-darwin
          - aarch64-apple-darwin
          - aarch64-apple-ios
          - x86_64-apple-ios
    runs-on: macos-13
    steps:
      - uses: actions/checkout@v4
      - uses: moonrepo/setup-rust@v1
        with:
          channel: ${{ env.MSRV_UPLOAD }}
          bins: cross
          targets: ${{ matrix.target }}
      - run: |
          set -eux
          uname -a
          rustup show
          cross --version
          cross check --lib --bins --target ${{ matrix.target }}

The built-in advice from the error message above is pass CLI argument --locked.

Try re-running cargo install with --locked

Can you allow passing --locked to the cargo install command invoked by the with statement?

@milesj milesj self-assigned this May 27, 2024
@milesj
Copy link
Contributor

milesj commented May 28, 2024

@jtmoon79 I'm not entirely sure --locked would solve the problem of the wrong Rust version being used? Can you confirm if it does?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants