houseabsolute / actions-rust-cross

GitHub Action to compile Rust with cross
Apache License 2.0
121 stars 13 forks source link

Action fails due to "missing file" #15

Closed makspll closed 7 months ago

makspll commented 7 months ago

Action log can be seen here: https://github.com/makspll/bevy_mod_scripting/actions/runs/8552685284/job/23434311319?pr=67

the relevant error is:

 error: failed to load manifest for workspace member `/project/crates/bevy_script_api`
Caused by:
  failed to load manifest for dependency `bevy_mod_scripting_lua_derive`
Caused by:
  failed to load manifest for dependency `bevy_mod_scripting`
Caused by:
  failed to read `/bevy_mod_scripting/Cargo.toml`
Caused by:
  No such file or directory (os error 2)
Error: Process completed with exit code 101.

And the workflow looks like this:

jobs:
  check:
    name: Check
    runs-on: ${{ matrix.run_args.os }}
    strategy:
      matrix:
       run_args: [ 
        {os: windows-latest,      lua: lua54,     cross: null}, 
        {os: macOS-latest,        lua: lua54,     cross: null},
        {os: ubuntu-latest,       lua: lua54,     cross: aarch64-unknown-linux-gnu},
        {os: ubuntu-latest,       lua: lua51,     cross: null}, 
        {os: ubuntu-latest,       lua: lua52,     cross: null}, 
        {os: ubuntu-latest,       lua: lua53,     cross: null}, 
        {os: ubuntu-latest,       lua: lua54,     cross: null}, 
        {os: ubuntu-latest,       lua: luajit,    cross: null}, 
        {os: ubuntu-latest,       lua: luajit52,  cross: null}
      ]
    steps:
      - name: Install alsa and udev
        run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
        if: runner.os == 'linux'
      - uses: actions/checkout@v2
      - uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
      - name: Rust Cache
        uses: Swatinem/rust-cache@v2.7.3
      # for x86 builds
      - if: matrix.run_args.cross == null
        uses: actions-rs/cargo@v1
        with:
          command: check
          args: --workspace --features=${{ matrix.run_args.lua }},rhai,teal,lua_script_api,rhai_script_api,rune
      # for non x86 cross-compiled builds
      - if: matrix.run_args.cross != null
        name: Clear space
        run: sudo rm -rf /usr/share/dotnet; sudo rm -rf /opt/ghc; sudo rm -rf "/usr/local/share/boost"; sudo rm -rf "$AGENT_TOOLSDIRECTORY"
      - if: matrix.run_args.cross != null
        uses: houseabsolute/actions-rust-cross@v0
        with:
          command: check
          target: ${{ matrix.run_args.cross }}
          args: --workspace --features=${{ matrix.run_args.lua }},rhai,teal,lua_script_api,rhai_script_api,rune --profile=ephemeral-build
makspll commented 7 months ago

I am not sure why it's looking for the crate at "project/crates/bevy_script_api" the correct location is "crates/bevy_script_api"

autarch commented 7 months ago

Looking at the logs, ultimately this ends up running this command:

/home/runner/work/_temp/cross +stable test --workspace --features=lua54,rhai,teal,lua_script_api,rhai_script_api,rune --profile=ephemeral-build --target aarch64-unknown-linux-gnu

There's nothing in there about the crate path or anything like that. Could you try installing cross and running it locally to see if that leads to the same error? If it does, then it's either an issue with your project config or with cross itself.

Also, as an aside, you don't really need to choose between cargo and cross yourself. The actions-rust-cross action will do that for you, so you can run it unconditionally.

makspll commented 7 months ago

I get the same issue locally indeed, I don't see anything that would cause differences between targets :/

Also, as an aside, you don't really need to choose between cargo and cross yourself. The actions-rust-cross action will do that for you, so you can run it unconditionally.

I did realise this as I was reading the docs in investigating this!

makspll commented 7 months ago

Closed as not an issue with this action