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

cannot build for target x86_64-unknown-linux-musl #651

Closed
EverlastingBugstopper opened this issue Mar 24, 2021 · 1 comment
Closed

cannot build for target x86_64-unknown-linux-musl #651

EverlastingBugstopper opened this issue Mar 24, 2021 · 1 comment

Comments

@EverlastingBugstopper
Copy link

Hey y'all! I'm not sure if this is intended or documented somewhere but it seems as if rusty_v8 does not play well with musl-tools. (It looks like y'all are currently only building for x86_64-unknown-linux-gnu so this issue may just be out of scope).

I've made a minimally reproducible example with this repo that includes rusty_v8 as a dependency, and prints Hello, World.

I have a GitHub Action set up to build this crate with the following steps:

name: Build Release

on: push
    
jobs:
  build:
    name: Repro compilation bug
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Install musl-tools
        run: |
          sudo apt-get update -y
          sudo apt-get install musl-tools -y

      - name: Install rust
        run: |
          rustup target add x86_64-unknown-linux-musl 

      - name: Build
        run: cargo build --verbose --target x86_64-unknown-linux-musl

The Build step fails with the following error

$ cargo build --verbose --target x86_64-unknown-linux-musl
...
Running `rustc --crate-name rusty_v8 --edition=2018 /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.21.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=31fe65957a7061ea -C extra-filename=-31fe65957a7061ea --out-dir /home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/deps --target x86_64-unknown-linux-musl -L dependency=/home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/deps -L dependency=/home/runner/work/deno-repro-repo/deno-repro-repo/target/debug/deps --extern bitflags=/home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/deps/libbitflags-b8acbdbf0b53393e.rmeta --extern lazy_static=/home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/deps/liblazy_static-7c4d90068fb1f81e.rmeta --extern libc=/home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/deps/liblibc-e1042c81b5256201.rmeta --cap-lints allow -L /home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/gn_out/obj -l static=rusty_v8`
error: failed to add native library /home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/gn_out/obj/librusty_v8.a: file too small to be an archive

error: aborting due to previous error

error: could not compile `rusty_v8`

Caused by:
  process didn't exit successfully: `rustc --crate-name rusty_v8 --edition=2018 /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/rusty_v8-0.21.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=31fe65957a7061ea -C extra-filename=-31fe65957a7061ea --out-dir /home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/deps --target x86_64-unknown-linux-musl -L dependency=/home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/deps -L dependency=/home/runner/work/deno-repro-repo/deno-repro-repo/target/debug/deps --extern bitflags=/home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/deps/libbitflags-b8acbdbf0b53393e.rmeta --extern lazy_static=/home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/deps/liblazy_static-7c4d90068fb1f81e.rmeta --extern libc=/home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/deps/liblibc-e1042c81b5256201.rmeta --cap-lints allow -L /home/runner/work/deno-repro-repo/deno-repro-repo/target/x86_64-unknown-linux-musl/debug/gn_out/obj -l static=rusty_v8` (exit code: 1)

The full verbose failure logs here.

Please let me know if there's any way I can help!

@ry
Copy link
Member

ry commented Mar 24, 2021

duplicate of #49

@ry ry closed this as completed Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants