NLnetLabs / dnsi

A tool to investigate the DNS.
BSD 3-Clause "New" or "Revised" License
43 stars 4 forks source link

Compiling fails on arm(64) #21

Open madnuttah opened 1 month ago

madnuttah commented 1 month ago

Hello and thanks for dnsi.

I am currently facing issues while compiling dnsi for arm(64) in a GitHub workflow.

Workflow run log:

2024-05-29T15:07:12.9508546Z #19 [linux/arm64 buildenv 2/3] RUN set -xe;     apk --update --no-cache add     ca-certificates     tzdata     build-base     curl     binutils     cargo &&     cargo install --locked dnsi &&     mkdir -p /usr/local/dnsi &&     mv /root/.cargo/bin/dnsi /usr/local/dnsi &&     strip --strip-all /usr/local/dnsi/dnsi
2024-05-29T15:07:13.1066600Z #19 689.6 error: could not compile `syn` (lib)
2024-05-29T15:07:13.1067238Z #19 689.6 
2024-05-29T15:07:13.1067640Z #19 689.6 Caused by:
2024-05-29T15:07:13.1077801Z #19 689.6   process didn't exit successfully: `rustc --crate-name syn --edition=2021 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-2.0.60/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="extra-traits"' --cfg 'feature="full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="visit-mut"' -C metadata=8e2b8725a826b109 -C extra-filename=-8e2b8725a826b109 --out-dir /tmp/cargo-installHmwaSY/release/deps -C strip=debuginfo -L dependency=/tmp/cargo-installHmwaSY/release/deps --extern proc_macro2=/tmp/cargo-installHmwaSY/release/deps/libproc_macro2-8a0dd023079a1a0e.rmeta --extern quote=/tmp/cargo-installHmwaSY/release/deps/libquote-29702e983c801cfd.rmeta --extern unicode_ident=/tmp/cargo-installHmwaSY/release/deps/libunicode_ident-94891640d59accc2.rmeta --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
2024-05-29T15:07:13.1087763Z #19 689.6 warning: build failed, waiting for other jobs to finish...

The relevant part of the Dockerfile:

...
RUN set -xe; \
    apk --update --no-cache add \
    ca-certificates \
    tzdata \
    build-base \
    curl \
    binutils \
    cargo && \
    cargo install --locked dnsi
...

I can't tell you if it would fail for armv6/v7 too right now. The i386 and amd64 are compiling without issues.

Link to full log

GitHub project

Thank you.

partim commented 1 month ago

Apologies for the delay, bit of a hectic week around here.

I’m not sure what’s going wrong. I have updated the dependencies on the main branch which updates syn to a newer version. Can you try building from git and see if that works?

madnuttah commented 1 month ago

Thank you, no apologies please. :) I'll try another build and tell you the outcome.

madnuttah commented 4 weeks ago

It seems like everything except arm64 compiles. It took quite long and after searching through the log, I saw this error again and canceled the workflow. I wonder why it hasn't been canceled after the error occured... But, due to the long runtime it seems like the other arm builds were successful.

2024-06-04T14:16:13.8171964Z #16 [linux/arm64 buildenv 2/4] RUN set -xe;     apk --update --no-cache add     ca-certificates     tzdata     build-base     curl     binutils     cargo &&     cargo install --locked dnsi
2024-06-04T14:16:13.9740615Z #16 442.6 error: could not compile `syn` (lib)
2024-06-04T14:16:13.9741298Z #16 442.6 
2024-06-04T14:16:13.9741686Z #16 442.6 Caused by:
2024-06-04T14:16:13.9750561Z #16 442.6   process didn't exit successfully: `rustc --crate-name syn --edition=2021 /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/syn-2.0.60/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debug-assertions=off --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="extra-traits"' --cfg 'feature="full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="visit-mut"' -C metadata=8e2b8725a826b109 -C extra-filename=-8e2b8725a826b109 --out-dir /tmp/cargo-install4YOrCX/release/deps -C strip=debuginfo -L dependency=/tmp/cargo-install4YOrCX/release/deps --extern proc_macro2=/tmp/cargo-install4YOrCX/release/deps/libproc_macro2-8a0dd023079a1a0e.rmeta --extern quote=/tmp/cargo-install4YOrCX/release/deps/libquote-29702e983c801cfd.rmeta --extern unicode_ident=/tmp/cargo-install4YOrCX/release/deps/libunicode_ident-94891640d59accc2.rmeta --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
2024-06-04T14:16:13.9759119Z #16 442.6 warning: build failed, waiting for other jobs to finish...

Link to full log

Thank you.

tertsdiepraam commented 4 weeks ago

This looks like a rustc bug, because rustc is exiting with a segfault. So here's some questions that might help diagnose the issue:

I tried cross-compiling to aarch64-unknown-linux-gnu but that didn't give any issues on rustc 1.78.

madnuttah commented 4 weeks ago

Thanks for your questions!

As all this rust stuff is new to me, I hope I've answered your questions properly.