aports issueshttps://gitlab.alpinelinux.org/alpine/aports/-/issues2024-03-26T12:53:04Zhttps://gitlab.alpinelinux.org/alpine/aports/-/issues/15916[PKG Request] 0A.D.2024-03-26T12:53:04ZVehementHam[PKG Request] 0A.D.## Package Information
* Name: `0ad`
* Homepage: https://trac.wildfiregames.com/
* Compile Steps: https://trac.wildfiregames.com/wiki/BuildInstructions
## Description
0ad does not compile on Alpine Linux, and it is unsupported. I woul...## Package Information
* Name: `0ad`
* Homepage: https://trac.wildfiregames.com/
* Compile Steps: https://trac.wildfiregames.com/wiki/BuildInstructions
## Description
0ad does not compile on Alpine Linux, and it is unsupported. I would like a package for this.
Here is how to install most of the dependencies:
```
doas apk add curl fmt fmt-dev curl cmake boost-dev gcc icu-dev libcurl lebnet-dev libogg-dev openal-soft-libs libpng libpng-dev libsodium libsodium-dev libvorbis libvorbis-dev libxml2 miniupnpc miniupnpc-dev patch pkgconf sdl2 sdl2-dev wxwidgets wxwidgets-dev zipzlib cargo python3 gloox openal-soft rust g++ make cmake
```
There are likely some that I missed.
When compiling I receive an error message:
```
ERROR: Don't know how to translate x86_64-pc-linux-musl for rustc
```https://gitlab.alpinelinux.org/alpine/aports/-/issues/14918[Package request]: celeste - a graphical cloud file synchronization client2024-02-06T18:01:24ZMarek Ľach[Package request]: celeste - a graphical cloud file synchronization client**Celeste** is a tool to sync files from Linux onto Dropbox, Google Drive, Nextcloud, Owncloud etc.
_Releases:_ https://github.com/hwittenborn/celeste/releases/tag/v0.8.0
_License:_ GPLv3
_Dependencies:_ rust, gtk4, libadwaita, rclone**Celeste** is a tool to sync files from Linux onto Dropbox, Google Drive, Nextcloud, Owncloud etc.
_Releases:_ https://github.com/hwittenborn/celeste/releases/tag/v0.8.0
_License:_ GPLv3
_Dependencies:_ rust, gtk4, libadwaita, rclonehttps://gitlab.alpinelinux.org/alpine/aports/-/issues/14166GTK 4 + Rust apps crash on ARMv72023-03-19T22:17:00ZNewbyteGTK 4 + Rust apps crash on ARMv7All GTK 4 + Rust apps that I've tested (Amberol, Karlender) crash on launch on ARMv7 with the following error:
```
fungus:~$ amberol
thread 'main' panicked at 'Failed to retrieve template child. Please check that it has been bound and h...All GTK 4 + Rust apps that I've tested (Amberol, Karlender) crash on launch on ARMv7 with the following error:
```
fungus:~$ amberol
thread 'main' panicked at 'Failed to retrieve template child. Please check that it has been bound and has a #[template_child] attribute.', /home/buildozer/aports/community/amberol/src/cargo/registry/src/github.com-1285ae84e5963aae/gtk4-0.4.8/src/subclass/widget.rs:1305:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted
```
```
fungus:~$ karlender
[2022-09-05 11:54:29 ERROR gtk_rust_app] Warning: Could not find messages for locale "", text domain: Err(TranslationNotFound("")), TEXT_DOMAIN: Err(NotPresent)
thread 'main' panicked at 'Failed to retrieve template child. Please check that it has been bound and has a #[template_child] attribute.', /home/buildozer/.cargo/registry/src/github.com-1285ae84e5963aae/gtk4-0.4.8/src/subclass/widget.rs:1305:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Aborted
```
I've not reported this upstream yet as their template wants a minimal example that reproduces it and I've not got around to making one.3.18.0https://gitlab.alpinelinux.org/alpine/aports/-/issues/13785py3-cryptography and Rust dependency?2022-07-30T03:46:34ZMogens Jensenpy3-cryptography and Rust dependency?A few packages including mitmproxy 8.0.0, depends on a newer version of py3-cryptography than currently available in the repository. While updating to version 37.0.2, I found out that Rust is a hard dependency since version 35.0.0, so if...A few packages including mitmproxy 8.0.0, depends on a newer version of py3-cryptography than currently available in the repository. While updating to version 37.0.2, I found out that Rust is a hard dependency since version 35.0.0, so if updated, the package will break on all architectures without Rust, which is strongly warned against in the APKBUILD.
How to solve this situation? Keep older version that works on all architectures, but prevent packages that depends on newer versions, or upgrade and break on multiple architectures?
There is also the problem with fixes to security issues only being available in newer versions.https://gitlab.alpinelinux.org/alpine/aports/-/issues/13144community/bandwhich: fails to build on aarch642021-11-06T09:07:20ZAndy Postnikovcommunity/bandwhich: fails to build on aarch64Disabled via c46663e0b0
```
To update snapshots run `cargo insta review`
thread 'tests::cases::ui::sustained_traffic_from_one_process_total' panicked at 'attempted to leave type `linked_hash_map::Node<yaml_rust::yaml::Yaml, yaml_rust::ya...Disabled via c46663e0b0
```
To update snapshots run `cargo insta review`
thread 'tests::cases::ui::sustained_traffic_from_one_process_total' panicked at 'attempted to leave type `linked_hash_map::Node<yaml_rust::yaml::Yaml, yaml_rust::yaml::Yaml>` uninitialized, which is invalid', /home/buildozer/aports/community/rust/src/rustc-1.55.0-src/library/core/src/mem/mod.rs:663:9
failures:
tests::cases::ui::sustained_traffic_from_multiple_processes_bi_directional_total
tests::cases::ui::sustained_traffic_from_multiple_processes_total
tests::cases::ui::sustained_traffic_from_one_process_total
test result: FAILED. 44 passed; 3 failed; 0 ignored; 0 measured; 0 filtered out; finished in 5.88s
error: test failed, to rerun pass '--bin bandwhich'
```3.15.0Anjandev MomiAnjandev Momihttps://gitlab.alpinelinux.org/alpine/aports/-/issues/13030Rustup: "rustfmt", "cargo-fmt" command failure2021-11-25T16:57:56ZRich BRustup: "rustfmt", "cargo-fmt" command failureUsing rustup, using the commands 'rustfmt' and 'cargo-fmt' results in an error (Unknown proxy name). This is fixed in a later commit (https://github.com/rust-lang/rustup/commit/8bec172129437ceec0300bdca489a107d1a97f0a#diff-2898cb515780ea...Using rustup, using the commands 'rustfmt' and 'cargo-fmt' results in an error (Unknown proxy name). This is fixed in a later commit (https://github.com/rust-lang/rustup/commit/8bec172129437ceec0300bdca489a107d1a97f0a#diff-2898cb515780ea48612238c024b7e3209115c3fdc58fc29e5c47fa54a6634d2e) which is also in aports master but not 3.14.2.Rasmus Thomsenoss@cogitri.devRasmus Thomsenoss@cogitri.devhttps://gitlab.alpinelinux.org/alpine/aports/-/issues/12985Bootstrap rustc for riscv642022-10-11T08:13:15ZSören TempelBootstrap rustc for riscv64At some point, hopefully before we make any offical releases for riscv64, we should bootstrap rustc for riscv64 as quite a lot of aports depend—directly or indirectly—on rust (e.g. due to `librsvg`).At some point, hopefully before we make any offical releases for riscv64, we should bootstrap rustc for riscv64 as quite a lot of aports depend—directly or indirectly—on rust (e.g. due to `librsvg`).https://gitlab.alpinelinux.org/alpine/aports/-/issues/12941community/rust: rustc -C target-feature=+crt-static is broken since Alpine 3....2023-05-18T18:17:06ZJakub Jirutkacommunity/rust: rustc -C target-feature=+crt-static is broken since Alpine 3.13 (Rust 1.47.0)I’m trying to build https://github.com/varjolintu/keepassxc-proxy-rust using cargo+rustc from aports as a static binary and find out that `+crt-static` is broken since Alpine 3.13 (rustc 1.47.0).
I don’t know if the problem is in our pa...I’m trying to build https://github.com/varjolintu/keepassxc-proxy-rust using cargo+rustc from aports as a static binary and find out that `+crt-static` is broken since Alpine 3.13 (rustc 1.47.0).
I don’t know if the problem is in our patches or in upstream.
Steps to reproduce:
```sh
apk add cargo git
git clone https://github.com/varjolintu/keepassxc-proxy-rust.git
cd keepassxc-proxy-rust
RUSTFLAGS='-Ctarget-feature=+crt-static' cargo build -v
```
On Alpine Edge with rustc 1.53.0:
<details>
<summary>
<strong>Click to expand full log…</strong><br/>
<pre><code>process didn't exit successfully: `~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)</code></pre>
</summary>
<pre><code>RUSTFLAGS='-Ctarget-feature=+crt-static' cargo build -v
Compiling nix v0.11.0
Compiling void v1.0.2
Compiling cfg-if v0.1.5
Compiling libc v0.2.43
Compiling bitflags v1.0.3
Compiling byteorder v1.1.0
Running `rustc --crate-name build_script_build ~/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.11.0/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=8edd2676591088d4 -C extra-filename=-8edd2676591088d4 --out-dir ~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4 -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name void ~/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=8daca5fba74dbef2 -C extra-filename=-8daca5fba74dbef2 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name libc ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.43/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="use_std"' -C metadata=106a2d5518a4852a -C extra-filename=-106a2d5518a4852a --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name cfg_if ~/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-0.1.5/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=4872244e38910c2e -C extra-filename=-4872244e38910c2e --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name bitflags ~/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.3/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=b1240547550b3d58 -C extra-filename=-b1240547550b3d58 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name byteorder ~/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.1.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 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=c8c4ef5b168b55ff -C extra-filename=-c8c4ef5b168b55ff --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build-script-build`
error: failed to run custom build command for `nix v0.11.0`
Caused by:
process didn't exit successfully: `~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: build failed
</code></pre>
</details>
On Alpine 3.13 with rustc 1.47.0:
<details>
<summary>
<strong>Click to expand full log…</strong><br/>
<pre><code>ld: /usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/libgcc_eh.a(unwind-dw2.o): in function `__gthread_once':
/home/buildozer/aports/main/gcc/src/build/x86_64-alpine-linux-musl/libgcc/./gthr-default.h:700: undefined reference to `pthread_once'
collect2: error: ld returned 1 exit status</code></pre>
</summary>
<pre><code>
RUSTFLAGS='-Ctarget-feature=+crt-static' cargo build -v
Compiling nix v0.11.0
Compiling bitflags v1.0.3
Compiling void v1.0.2
Compiling libc v0.2.43
Running `rustc --crate-name bitflags ~/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.3/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=c87359a600611076 -C extra-filename=-c87359a600611076 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name build_script_build ~/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.11.0/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=20fd7cb95f370935 -C extra-filename=-20fd7cb95f370935 --out-dir ~/keepassxc-proxy-rust/target/debug/build/nix-20fd7cb95f370935 -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name libc ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.43/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="use_std"' -C metadata=c238e2dec5758177 -C extra-filename=-c238e2dec5758177 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name void ~/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=348efd14d4a047aa -C extra-filename=-348efd14d4a047aa --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Compiling cfg-if v0.1.5
Running `rustc --crate-name cfg_if ~/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-0.1.5/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=1ff2b417549a82db -C extra-filename=-1ff2b417549a82db --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Compiling byteorder v1.1.0
Running `rustc --crate-name byteorder ~/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.1.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 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=c5f4275178e35ed9 -C extra-filename=-c5f4275178e35ed9 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib" "~/keepassxc-proxy-rust/target/debug/build/nix-20fd7cb95f370935/build_script_build-20fd7cb95f370935.build_script_build.1y1bdzr3-cgu.0.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-20fd7cb95f370935/build_script_build-20fd7cb95f370935.build_script_build.1y1bdzr3-cgu.1.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-20fd7cb95f370935/build_script_build-20fd7cb95f370935.build_script_build.1y1bdzr3-cgu.2.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-20fd7cb95f370935/build_script_build-20fd7cb95f370935.build_script_build.1y1bdzr3-cgu.3.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-20fd7cb95f370935/build_script_build-20fd7cb95f370935.build_script_build.1y1bdzr3-cgu.4.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-20fd7cb95f370935/build_script_build-20fd7cb95f370935.build_script_build.1y1bdzr3-cgu.5.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-20fd7cb95f370935/build_script_build-20fd7cb95f370935.build_script_build.1y1bdzr3-cgu.6.rcgu.o" "-o" "~/keepassxc-proxy-rust/target/debug/build/nix-20fd7cb95f370935/build_script_build-20fd7cb95f370935" "~/keepassxc-proxy-rust/target/debug/build/nix-20fd7cb95f370935/build_script_build-20fd7cb95f370935.3uuin1k82oc9un48.rcgu.o" "-Wl,--gc-sections" "-static-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "~/keepassxc-proxy-rust/target/debug/deps" "-L" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libstd-06aec1a01d3ba7a9.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libpanic_unwind-42f35beaae597de5.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libminiz_oxide-fedab674ad3931ec.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libadler-a45d111ab0304635.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libobject-aa8f6fea9aa75332.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libaddr2line-fd57aba7862995b6.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libgimli-3d096ae25b8abdd6.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_demangle-dee41d539c484a5a.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libhashbrown-dafcbd54c5153fc5.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_std_workspace_alloc-ad3eaf532c29eec6.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libunwind-8668b1338b7ce19c.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcfg_if-2a3d1db563feade4.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/liblibc-675e1ce4b9e93a1c.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/liballoc-6f33e873ffca5c66.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_std_workspace_core-cde0281597f50b5c.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcore-8a71a9a278640f0c.rlib" "-Wl,--end-group" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcompiler_builtins-5ee880047fff9647.rlib" "-Wl,-Bdynamic" "-lssp_nonshared" "-lgcc_eh"
= note: /usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/10.2.1/libgcc_eh.a(unwind-dw2.o): in function `__gthread_once':
/home/buildozer/aports/main/gcc/src/build/x86_64-alpine-linux-musl/libgcc/./gthr-default.h:700: undefined reference to `pthread_once'
collect2: error: ld returned 1 exit status
error: aborting due to previous error
error: could not compile `nix`.
Caused by:
process didn't exit successfully: `rustc --crate-name build_script_build ~/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.11.0/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=20fd7cb95f370935 -C extra-filename=-20fd7cb95f370935 --out-dir ~/keepassxc-proxy-rust/target/debug/build/nix-20fd7cb95f370935 -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
</code></pre>
</details>
On Alpine 3.12 with rustc 1.44.0:
<details>
<summary>
<strong>Click to expand full log…</strong><br/>
<pre><code>Finished dev [unoptimized + debuginfo] target(s) in 6.72s</code></pre>
</summary>
<pre><code>
RUSTFLAGS='-Ctarget-feature=+crt-static' cargo build -v
Compiling nix v0.11.0
Compiling bitflags v1.0.3
Compiling libc v0.2.43
Compiling cfg-if v0.1.5
Compiling void v1.0.2
Compiling byteorder v1.1.0
Running `rustc --crate-name build_script_build ~/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.11.0/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=86a15ea8c536e891 -C extra-filename=-86a15ea8c536e891 --out-dir ~/keepassxc-proxy-rust/target/debug/build/nix-86a15ea8c536e891 -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name bitflags ~/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.3/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' -C metadata=8f3630e8b926ac12 -C extra-filename=-8f3630e8b926ac12 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name libc ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.43/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="use_std"' -C metadata=d6d7c5dca2d4c238 -C extra-filename=-d6d7c5dca2d4c238 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name cfg_if ~/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-0.1.5/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 -C metadata=7e925ca1d0e47c9e -C extra-filename=-7e925ca1d0e47c9e --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name void ~/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=73f3dfac2f10a308 -C extra-filename=-73f3dfac2f10a308 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `rustc --crate-name byteorder ~/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.1.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=792538a605734826 -C extra-filename=-792538a605734826 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static`
Running `~/keepassxc-proxy-rust/target/debug/build/nix-86a15ea8c536e891/build-script-build`
Running `rustc --crate-name nix ~/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.11.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C debuginfo=2 -C metadata=633ac2156b3043da -C extra-filename=-633ac2156b3043da --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --extern bitflags=~/keepassxc-proxy-rust/target/debug/deps/libbitflags-8f3630e8b926ac12.rmeta --extern cfg_if=~/keepassxc-proxy-rust/target/debug/deps/libcfg_if-7e925ca1d0e47c9e.rmeta --extern libc=~/keepassxc-proxy-rust/target/debug/deps/liblibc-d6d7c5dca2d4c238.rmeta --extern void=~/keepassxc-proxy-rust/target/debug/deps/libvoid-73f3dfac2f10a308.rmeta --cap-lints allow -Ctarget-feature=+crt-static`
Compiling keepassxc-proxy v0.1.0 (~/keepassxc-proxy-rust)
Running `rustc --crate-name keepassxc_proxy src/main.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=e0491aa9a3660457 -C extra-filename=-e0491aa9a3660457 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -C incremental=~/keepassxc-proxy-rust/target/debug/incremental -L dependency=~/keepassxc-proxy-rust/target/debug/deps --extern byteorder=~/keepassxc-proxy-rust/target/debug/deps/libbyteorder-792538a605734826.rlib --extern nix=~/keepassxc-proxy-rust/target/debug/deps/libnix-633ac2156b3043da.rlib -Ctarget-feature=+crt-static`
Finished dev [unoptimized + debuginfo] target(s) in 6.72s
</code></pre>
</details>
I don’t know how to force cargo/rustc to always print `cc` arguments, so I created a simple wrapper script `cc-log`:
```sh
#!/bin/sh
printf '%s\n' "$*" >> /tmp/cc.log
exec cc "$@"
```
…and build again with `RUSTFLAGS='-Ctarget-feature=+crt-static -Clinker=/path/to/cc-log' cargo build -v`
```
cc -Wl,--as-needed -Wl,-z,noexecstack -Wl,--eh-frame-hdr -m64 -L /usr/lib/rustlib/x86_64-alpine-linux-musl/lib ~/keepassxc-proxy-rust/target/debug/build/nix-86a15ea8c536e891/build_script_build-86a15ea8c536e891.build_script_build.dhgh3pug-cgu.0.rcgu.o ~/keepassxc-proxy-rust/target/debug/build/nix-86a15ea8c536e891/build_script_build-86a15ea8c536e891.build_script_build.dhgh3pug-cgu.1.rcgu.o ~/keepassxc-proxy-rust/target/debug/build/nix-86a15ea8c536e891/build_script_build-86a15ea8c536e891.build_script_build.dhgh3pug-cgu.2.rcgu.o ~/keepassxc-proxy-rust/target/debug/build/nix-86a15ea8c536e891/build_script_build-86a15ea8c536e891.build_script_build.dhgh3pug-cgu.3.rcgu.o ~/keepassxc-proxy-rust/target/debug/build/nix-86a15ea8c536e891/build_script_build-86a15ea8c536e891.build_script_build.dhgh3pug-cgu.4.rcgu.o -o ~/keepassxc-proxy-rust/target/debug/build/nix-86a15ea8c536e891/build_script_build-86a15ea8c536e891 ~/keepassxc-proxy-rust/target/debug/build/nix-86a15ea8c536e891/build_script_build-86a15ea8c536e891.41n3vb5mw653uc6h.rcgu.o -Wl,--gc-sections -pie -Wl,-zrelro -Wl,-znow -nodefaultlibs -L ~/keepassxc-proxy-rust/target/debug/deps -L /usr/lib/rustlib/x86_64-alpine-linux-musl/lib -Wl,--start-group -Wl,-Bstatic /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libstd-4ce14655942c6f47.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libpanic_unwind-11550197f781f830.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libhashbrown-2ab0993c27d19786.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_std_workspace_alloc-a179617334d70722.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libbacktrace-e2f32b2af547d391.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libbacktrace_sys-2d2042f63707ea50.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_demangle-96a0c0ec9cc49502.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libunwind-04a5b9a097660730.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcfg_if-0e96d43b42168240.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/liblibc-6f63d3408a1c72a1.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/liballoc-d260516aca78355d.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_std_workspace_core-471ebd6b73b64ed8.rlib /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcore-d7b4f012a6bfbffe.rlib -Wl,--end-group /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcompiler_builtins-8ed302c585619808.rlib -lssp_nonshared -lgcc_eh -lc -lgcc -static -Wl,-Bdynamic
```
Diffs of `cc` arguments beging used for building `nix` crate:
```diff
--- rustc 1.44.0 (Alpine 3.12) - works
+++ rustc 1.47.0 (Alpine 3.13) - broken
cc
-m64
-Wl,--as-needed
-Wl,--eh-frame-hdr
-Wl,-z,noexecstack
-L
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib
~/keepassxc-proxy-rust/target/debug/build/nix-xxxxxxxxxxxxxxxx/build_script_build-xxxxxxxxxxxxxxxx.build_script_build.yyyyyyyy-cgu.0.rcgu.o
~/keepassxc-proxy-rust/target/debug/build/nix-xxxxxxxxxxxxxxxx/build_script_build-xxxxxxxxxxxxxxxx.build_script_build.yyyyyyyy-cgu.1.rcgu.o
~/keepassxc-proxy-rust/target/debug/build/nix-xxxxxxxxxxxxxxxx/build_script_build-xxxxxxxxxxxxxxxx.build_script_build.yyyyyyyy-cgu.2.rcgu.o
~/keepassxc-proxy-rust/target/debug/build/nix-xxxxxxxxxxxxxxxx/build_script_build-xxxxxxxxxxxxxxxx.build_script_build.yyyyyyyy-cgu.3.rcgu.o
~/keepassxc-proxy-rust/target/debug/build/nix-xxxxxxxxxxxxxxxx/build_script_build-xxxxxxxxxxxxxxxx.build_script_build.yyyyyyyy-cgu.4.rcgu.o
+ ~/keepassxc-proxy-rust/target/debug/build/nix-xxxxxxxxxxxxxxxx/build_script_build-xxxxxxxxxxxxxxxx.build_script_build.yyyyyyyy-cgu.5.rcgu.o
+ ~/keepassxc-proxy-rust/target/debug/build/nix-xxxxxxxxxxxxxxxx/build_script_build-xxxxxxxxxxxxxxxx.build_script_build.yyyyyyyy-cgu.6.rcgu.o
-o
~/keepassxc-proxy-rust/target/debug/build/nix-xxxxxxxxxxxxxxxx/build_script_build-xxxxxxxxxxxxxxxx
~/keepassxc-proxy-rust/target/debug/build/nix-xxxxxxxxxxxxxxxx/build_script_build-xxxxxxxxxxxxxxxx.zzzzzzzzzzzzzzzz.rcgu.o
-Wl,--gc-sections
- -pie
+ -static-pie
-Wl,-zrelro
-Wl,-znow
-nodefaultlibs
-L
~/keepassxc-proxy-rust/target/debug/deps
-L
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib
-Wl,--start-group
-Wl,-Bstatic
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libstd-abcdefabcdefabcd.rlib
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libpanic_unwind-abcdefabcdefabcd.rlib
+ /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libminiz_oxide-abcdefabcdefabcd.rlib
+ /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libadler-abcdefabcdefabcd.rlib
+ /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libobject-abcdefabcdefabcd.rlib
+ /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libaddr2line-abcdefabcdefabcd.rlib
+ /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libgimli-abcdefabcdefabcd.rlib
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_demangle-abcdefabcdefabcd.rlib
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libhashbrown-abcdefabcdefabcd.rlib
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_std_workspace_alloc-abcdefabcdefabcd.rlib
- /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libbacktrace-abcdefabcdefabcd.rlib
- /usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libbacktrace_sys-abcdefabcdefabcd.rlib
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libunwind-abcdefabcdefabcd.rlib
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcfg_if-abcdefabcdefabcd.rlib
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/liblibc-abcdefabcdefabcd.rlib
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/liballoc-abcdefabcdefabcd.rlib
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_std_workspace_core-abcdefabcdefabcd.rlib
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcore-abcdefabcdefabcd.rlib
-Wl,--end-group
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcompiler_builtins-abcdefabcdefabcd.rlib
+ -Wl,-Bdynamic
-lssp_nonshared
-lgcc_eh
- -lc
- -lgcc
- -static
- -Wl,-Bdynamic
```
(only relevant part)
```diff
--- rustc 1.47.0 (Alpine 3.13) - broken
+++ rustc 1.53.0 (Alpine Edge) - broken
# omitted arguments are the same
-Wl,--end-group
/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcompiler_builtins-abcdefabcdefabcd.rlib
-Wl,-Bdynamic
-lssp_nonshared
-lgcc_eh
+ -lc
+ -Wl,-Bstatic
+ -lgcc
+ -Wl,-Bdynamic
```
Another try, now with `-Crelocation-model=static`:
<details>
<summary>
<strong>Click to expand full log…</strong><br/>
<pre><code>ld: attempted static link of dynamic object `/usr/lib/libc.so'
collect2: error: ld returned 1 exit status</pre></code>
</summary>
<pre><code>
RUSTFLAGS="-Ctarget-feature=+crt-static -Crelocation-model=static" cargo build -v
Compiling nix v0.11.0
Compiling cfg-if v0.1.5
Compiling libc v0.2.43
Compiling bitflags v1.0.3
Compiling void v1.0.2
Compiling byteorder v1.1.0
Running `rustc --crate-name build_script_build ~/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.11.0/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=8edd2676591088d4 -C extra-filename=-8edd2676591088d4 --out-dir ~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4 -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static -Crelocation-model=static`
Running `rustc --crate-name libc ~/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.43/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="use_std"' -C metadata=106a2d5518a4852a -C extra-filename=-106a2d5518a4852a --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static -Crelocation-model=static`
Running `rustc --crate-name cfg_if ~/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-0.1.5/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=4872244e38910c2e -C extra-filename=-4872244e38910c2e --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static -Crelocation-model=static`
Running `rustc --crate-name bitflags ~/.cargo/registry/src/github.com-1ecc6299db9ec823/bitflags-1.0.3/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=b1240547550b3d58 -C extra-filename=-b1240547550b3d58 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static -Crelocation-model=static`
Running `rustc --crate-name void ~/.cargo/registry/src/github.com-1ecc6299db9ec823/void-1.0.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=8daca5fba74dbef2 -C extra-filename=-8daca5fba74dbef2 --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static -Crelocation-model=static`
Running `rustc --crate-name byteorder ~/.cargo/registry/src/github.com-1ecc6299db9ec823/byteorder-1.1.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 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=c8c4ef5b168b55ff -C extra-filename=-c8c4ef5b168b55ff --out-dir ~/keepassxc-proxy-rust/target/debug/deps -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static -Crelocation-model=static`
error: linking with `cc` failed: exit status: 1
|
= note: "cc" "-m64" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-Wl,--as-needed" "-L" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib" "~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build_script_build-8edd2676591088d4.build_script_build.6vd7vsxp-cgu.0.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build_script_build-8edd2676591088d4.build_script_build.6vd7vsxp-cgu.1.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build_script_build-8edd2676591088d4.build_script_build.6vd7vsxp-cgu.2.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build_script_build-8edd2676591088d4.build_script_build.6vd7vsxp-cgu.3.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build_script_build-8edd2676591088d4.build_script_build.6vd7vsxp-cgu.4.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build_script_build-8edd2676591088d4.build_script_build.6vd7vsxp-cgu.5.rcgu.o" "~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build_script_build-8edd2676591088d4.build_script_build.6vd7vsxp-cgu.6.rcgu.o" "-o" "~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build_script_build-8edd2676591088d4" "~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4/build_script_build-8edd2676591088d4.40ka1h9i20cio1f2.rcgu.o" "-Wl,--gc-sections" "-static" "-no-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "~/keepassxc-proxy-rust/target/debug/deps" "-L" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libstd-34afa3620578e61f.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libpanic_unwind-a9bff9d2c6aee606.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libminiz_oxide-b6fa8ac8fff2da2b.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libadler-eb1608062ebcff68.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libobject-fd3e0d54a038b9a9.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libaddr2line-5ac639d60defb3a5.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libgimli-c3808cd42a7bcdf9.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libstd_detect-fba1bbf3bc5edbf2.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_demangle-c5813e4d324eb983.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libhashbrown-b5c125b992951f22.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_std_workspace_alloc-a7b4aa4f2efe685e.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libunwind-22772a502ce044fc.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcfg_if-caa1112aef8d93e6.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/liblibc-9380a366e66a53c9.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/liballoc-b5da5d3bfdddf375.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/librustc_std_workspace_core-e1cbbe3706c873ae.rlib" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcore-f6ce8bab5d963208.rlib" "-Wl,--end-group" "/usr/lib/rustlib/x86_64-alpine-linux-musl/lib/libcompiler_builtins-5f1480203e4754fb.rlib" "-Wl,-Bdynamic" "-lssp_nonshared" "-lgcc_eh" "-lc" "-Wl,-Bstatic" "-lgcc" "-Wl,-Bdynamic"
= note: /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: attempted static link of dynamic object `/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../lib/libc.so'
collect2: error: ld returned 1 exit status
error: aborting due to previous error
error: could not compile `nix`
Caused by:
process didn't exit successfully: `rustc --crate-name build_script_build ~/.cargo/registry/src/github.com-1ecc6299db9ec823/nix-0.11.0/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=8edd2676591088d4 -C extra-filename=-8edd2676591088d4 --out-dir ~/keepassxc-proxy-rust/target/debug/build/nix-8edd2676591088d4 -L dependency=~/keepassxc-proxy-rust/target/debug/deps --cap-lints allow -Ctarget-feature=+crt-static -Crelocation-model=static` (exit status: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed
</code></pre>
</details>
```diff
--- rustc 1.53.0 without -Crelocation-model=static
+++ rustc 1.53.0 with -Crelocation-model=static
# omitted arguments are the same
-Wl,--gc-sections
- -static-pie
+ -static
+ -no-pie
-Wl,-zrelro
-Wl,-znow
-nodefaultlibs
# omitted arguments are the same
```
Similar issues: #11806Ariadne Conillariadne@ariadne.spaceAriadne Conillariadne@ariadne.spacehttps://gitlab.alpinelinux.org/alpine/aports/-/issues/12226rust: `bindgen` is unable to generate any bindings2023-10-24T13:29:55ZFelix Pojtingerrust: `bindgen` is unable to generate any bindingsI've tried to follow the [bindgen tutorial](https://rust-lang.github.io/rust-bindgen/) and create some bindings as described there. When I try to `cargo build` the project, I hit the following error (clang etc. is set up):
```bash
Unabl...I've tried to follow the [bindgen tutorial](https://rust-lang.github.io/rust-bindgen/) and create some bindings as described there. When I try to `cargo build` the project, I hit the following error (clang etc. is set up):
```bash
Unable to find libclang: "the `libclang` shared library at /usr/lib/libclang.so.10 could not be opened: Dynamic loading not supported
```
https://github.com/rust-lang/rust-bindgen/issues/1867 seems to point to the use of `features = ["static"]`, which yields `could not find any static libraries`.Rasmus Thomsenoss@cogitri.devRasmus Thomsenoss@cogitri.devhttps://gitlab.alpinelinux.org/alpine/aports/-/issues/11806rustc --crate-type staticlib --print native-static-libs includes gcc_s2022-07-21T16:05:18ZMattias Wadmanrustc --crate-type staticlib --print native-static-libs includes gcc_s*Update* I was confused about gcc_eh thinking it was the static version of gcc_s. So have that in mind when reading below.
Im trying to build a static binary that links statically with an external library thru a pkg-config generated by ...*Update* I was confused about gcc_eh thinking it was the static version of gcc_s. So have that in mind when reading below.
Im trying to build a static binary that links statically with an external library thru a pkg-config generated by cargo-c. But it fails because it tries to link with `-lgcc_s` when I think it should link with `-lgcc_eh`.
The reason this happens is because cargo-c uses the output from `rustc -print native-static-libs` (https://github.com/lu-zero/cargo-c/blob/master/src/static_libs.rs) to determine which libraries to include in the generated .pc-file.
Reproduction:
```sh
# setup
$ docker run --rm -ti -v $PWD:$PWD -w $PWD alpine:3.12.0
$ apk add --no-cache build-base rust cargo
$ cargo install cargo-c
$ USER=root cargo new statictest --lib
$ cd statictest
$ echo | rustc --crate-type staticlib --print native-static-libs - --out-dir target --target x86_64-alpine-linux-musl
note: Link against the following native artifacts when linking against this static library. The order and any duplication can be significant on some platforms.
note: native-static-libs: -lssp_nonshared -lgcc_s -lc
# target-feature=+crt-static does not seem to make a difference
$ echo | RUSTFLAGS="-C target-feature=+crt-static" rustc --crate-type staticlib --print native-static-libs - --out-dir target --target x86_64-alpine-linux-musl
note: Link against the following native artifacts when linking against this static library. The order and any duplication can be significant on some platforms.
note: native-static-libs: -lssp_nonshared -lgcc_s -lc
```
Strangely there is a patch for the alpine version of rust that should address this https://git.alpinelinux.org/aports/tree/community/rust/0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch?h=3.12-stable but it seems to not work in this case.
Also there are alpine packages that uses cargo-c to generate .pc files that might be wrong because of this. For example https://git.alpinelinux.org/aports/tree/testing/rav1e/APKBUILD has a .pc-file with `Libs.private: -lssp_nonshared -lgcc_s -lc`.Rasmus Thomsenoss@cogitri.devRasmus Thomsenoss@cogitri.devhttps://gitlab.alpinelinux.org/alpine/aports/-/issues/11683cross-compile rust2020-06-24T14:14:44ZAriadne Conillariadne@ariadne.spacecross-compile rustThis issue is tracking discussion & whatever we need to do to make rust cross-compile using the `$CTARGET` variable.
cc @CogitriThis issue is tracking discussion & whatever we need to do to make rust cross-compile using the `$CTARGET` variable.
cc @Cogitrihttps://gitlab.alpinelinux.org/alpine/aports/-/issues/11482Make rust-stdlib noarch to allow cross-compilation2020-05-06T07:39:38ZFabrice DesréMake rust-stdlib noarch to allow cross-compilationCurrently there is a single package named `rust-stdlib` package for each arch. That makes it impossible to setup cross-compilation of Rust code because there is no way to install the target `rust-stdlib`.
One possible option would be to...Currently there is a single package named `rust-stdlib` package for each arch. That makes it impossible to setup cross-compilation of Rust code because there is no way to install the target `rust-stdlib`.
One possible option would be to make all the stdlib packages noarch, and rename them `rust-stdlib-$arch`. The rustc package for each target would still depend on the stdlib for this target, providing out of box the same experience as currently.Rasmus Thomsenoss@cogitri.devRasmus Thomsenoss@cogitri.dev