moonrepo / setup-rust Goto Github PK
View Code? Open in Web Editor NEWA maintained GitHub action for setting up Rust and Cargo.
A maintained GitHub action for setting up Rust and Cargo.
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?
Hey, this might just be me not knowing what I'm doing, but I've tried a fair bit of things and none of them seemed to help.
workflow:
- uses: moonrepo/setup-rust@v1
with:
profile: complete
targets: 'x86_64-pc-windows-msvc,x86_64-pc-windows-gnu'
- name: Build exe/
run: cargo build --release --all-features --manifest-path exe/Cargo.toml --target=x86_64-pc-windows-msvc
logs_macos_aarch64.txt (for when logs get deleted)
from https://github.com/C0D3-M4513R/DexProtectOscRS/actions/runs/6285427718/job/17067798487?pr=3#logs
README explicitly says it doesn't install rustup if it isn't found. I'm using gitea with actions and noticed that it didn't work due to missing rustup. Is it possible to have an explicit flag install_rustup: true
?
before build;
Attempting to restore cache
Generating cache key
Cache does not exist using key setup-rustcargo-v1-win32-d94c355bca58aa4c0186140d125e989ab8395e82
after build:
Size changed 1.63 GB => 313.25 MB (-1.32 GB, -80.81%)
Cleaning target/release before saving
Removing examples and incremental directories
Removing dep-info files (*.d)
Saving cache with key setup-rustcargo-v1-win32-1dbfb78edf8a75329b6134312e65b3ad0c5c67d8
The post step of this github action fails on macos-13 with:
Error: Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.
No idea what command line is being tried, it is printed in the other 2 successful cases but not in this case.
Workflow (clipped):
# ...
jobs:
build-linux:
name: Linux
runs-on: ubuntu-latest
steps:
# ...
- name: Install dependencies (rust)
uses: moonrepo/setup-rust@v1
with:
targets: x86_64-unknown-linux-gnu
components: clippy,rustfmt
# ...
build-macos:
name: MacOS
runs-on: macos-13 # macos-latest/macos-14 has an ARM cpu (Apple M1) but we want an AMD64 cpu
steps:
# ...
- name: Install dependencies (rust)
uses: moonrepo/setup-rust@v1
with:
targets: x86_64-apple-darwin
components: clippy,rustfmt
# ...
build-cygwin:
name: Cygwin
runs-on: windows-latest
steps:
# ...
- name: Install dependencies (rust)
uses: moonrepo/setup-rust@v1
with:
targets: x86_64-pc-windows-gnu
components: clippy,rustfmt
# ...
Hi!
We are looking to adopt this package and migrate from actions-rs.
On Windows, the compilation fails due to:
error[E0463]: can't find crate for `core`
CI run:
https://github.com/remotion-dev/remotion/actions/runs/4890840629/jobs/8730672600?pr=2189
Configuration: channel: "1.67.1", profile: minimal
Since this package wants to be a migration path from actions-rs, I thought I raise an issue.
Trying to use the action on host where rustup is missing leads to this error:
Run moonrepo/setup-rust@v1
with:
inherit-toolchain: true
cache-target: release
cache: true
env:
RUSTFLAGS: -D warnings --cfg tokio_unstable
Setting cargo environment variables
Adding ~/.cargo/bin to PATH
Detecting toolchain
Loading rust-toolchain.toml or rust-toolchain file
Inheriting toolchain settings from inputs
Installing toolchain with rustup
/home/ubuntu/.cargo/bin/rustup toolchain install nightly-[2](https://github.com/fluencelabs/nox/actions/runs/5738400881/job/15551917509?pr=1741#step:3:2)02[3](https://github.com/fluencelabs/nox/actions/runs/5738400881/job/15551917509?pr=1741#step:3:3)-06-1[4](https://github.com/fluencelabs/nox/actions/runs/5738400881/job/15551917509?pr=1741#step:3:4) --profile minimal --target x86_64-unknown-linux-gnu --target aarch64-unknown-linux-gnu --component rustfmt --component clippy --no-self-update
info: syncing channel updates for 'nightly-2023-06-14-x86_64-unknown-linux-gnu'
info: latest update on 2023-06-14, rust version 1.72.0-nightly (371994e0d 2023-06-13)
info: component 'clippy' for target 'x86_64-unknown-linux-gnu' is up to date
info: component 'rust-std' for target 'aarch64-unknown-linux-gnu' is up to date
info: component 'rust-std' for target 'x86_64-unknown-linux-gnu' is up to date
info: component 'rustfmt' for target 'x86_64-unknown-linux-gnu' is up to date
nightly-2023-06-14-x86_64-unknown-linux-gnu unchanged - rustc 1.72.0-nightly (371994e0d 2023-06-13)
/home/ubuntu/.cargo/bin/rustup default nightly-2023-06-14
info: using existing install for 'nightly-2023-06-14-x86_64-unknown-linux-gnu'
info: default toolchain set to 'nightly-2023-06-14-x86_64-unknown-linux-gnu'
nightly-2023-06-14-x86_64-unknown-linux-gnu unchanged - rustc 1.72.0-nightly (371994e0d 2023-06-13)
info: note that the toolchain 'nightly-2023-06-14-x86_64-unknown-linux-gnu' is currently in use (overridden by '/opt/actions-runner/_work/nox/nox/rust-toolchain.toml')
Logging installed toolchain versions
/home/ubuntu/.cargo/bin/rustc +nightly-2023-06-14 --version --verbose
rustc 1.72.0-nightly (371994e0d 2023-06-13)
binary: rustc
commit-hash: 371994e0d8380600ddda78ca1be937c7fb179b49
commit-date: 2023-06-13
host: x86_64-unknown-linux-gnu
release: 1.72.0-nightly
LLVM version: 16.0.[5](https://github.com/fluencelabs/nox/actions/runs/5738400881/job/15551917509?pr=1741#step:3:5)
Installing additional binaries
cargo-binstall does not exist, attempting to install
Error: Cannot find module './133.index.js'
Require stack:
- /opt/actions-runner/_work/_actions/moonrepo/setup-rust/v1/dist/index.js
node:internal/modules/cjs/loader:933
const err = new Error(message);
^
Error: Cannot find module './133.index.js'
Require stack:
- /opt/actions-runner/_work/_actions/moonrepo/setup-rust/v1/dist/index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.__nccwpck_require__.f.require (/opt/actions-runner/_work/_actions/moonrepo/setup-rust/v1/dist/index.js:[6](https://github.com/fluencelabs/nox/actions/runs/5738400881/job/15551917509?pr=1741#step:3:6)3801:28)
at /opt/actions-runner/_work/_actions/moonrepo/setup-rust/v1/dist/index.js:63[7](https://github.com/fluencelabs/nox/actions/runs/5738400881/job/15551917509?pr=1741#step:3:7)36:40
at Array.reduce (<anonymous>)
at Function.__nccwpck_require__.e (/opt/actions-runner/_work/_actions/moonrepo/setup-rust/v1/dist/index.js:63735:67)
at downloadAndInstallBinstall (/opt/actions-runner/_work/_actions/moonrepo/setup-rust/v1/dist/index.js:63077:5[8](https://github.com/fluencelabs/nox/actions/runs/5738400881/job/15551917509?pr=1741#step:3:9))
at installBins (/opt/actions-runner/_work/_actions/moonrepo/setup-rust/v1/dist/index.js:63[12](https://github.com/fluencelabs/nox/actions/runs/5738400881/job/15551917509?pr=1741#step:3:13)2:[15](https://github.com/fluencelabs/nox/actions/runs/5738400881/job/15551917509?pr=1741#step:3:16)) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/opt/actions-runner/_work/_actions/moonrepo/setup-rust/v1/dist/index.js'
]
}
setup-rust action takes around 1min even though it is cached. Most likely the rustup binary and few other items are not cached.
Lines 105 to 112 in deec13b
Setting cargo environment variables
Adding ~/.cargo/bin to PATH
rustup does not exist, attempting to install
Downloaded installation script to /tmp/rustup-init
[command]/tmp/rustup-init --default-toolchain none -y
info: downloading installer
info: profile set to 'default'
info: default host triple is x86_64-unknown-linux-gnu
info: skipping toolchain installation
Hi,
I would like to ask if it would be possible to change the behaviour of the config file in regards to following
When loading a configuration file, only the channel field is used, while the other fields are ignored. We chose this approach, as those other fields are typically for develop/release workflows, but not for CI, which requires a minimal/granular setup.
Couldn't be the default to use the settings from the file and allow it to be overridden by the specific settings in the config of the action (components, targets and profile)?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.