Skip to content

Appease nightly clippy #196

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

Merged
merged 2 commits into from
Apr 19, 2024
Merged

Appease nightly clippy #196

merged 2 commits into from
Apr 19, 2024

Conversation

tamird
Copy link
Member

@tamird tamird commented Apr 18, 2024

No description provided.

@vadorovsky
Copy link
Member

This failure seems legit though, it seems like linking with C module (providing an anon struct) regressed:

stderr:
  ------------------------------------------
  error: linking with `/home/runner/work/bpf-linker/bpf-linker/target/debug/bpf-linker` failed: exit status: 2
    |
    = note: LC_ALL="C" PATH="/home/runner/work/bpf-linker/bpf-linker/target/sysroot/lib/rustlib/x86_64-unknown-linux-gnu/bin:/usr/lib/llvm-18/bin:/snap/bin:/home/runner/.local/bin:/opt/pipx_bin:/home/runner/.cargo/bin:/home/runner/.config/composer/vendor/bin:/usr/local/.ghcup/bin:/home/runner/.dotnet/tools:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" VSLANG="1033" "/home/runner/work/bpf-linker/bpf-linker/target/debug/bpf-linker" "--export-symbols" "/tmp/rustck3t50V/symbols" "/tmp/rustck3t50V/symbols.o" "/tmp/assembly/anon_struct_c.anon_struct_c.e9732f78866b9042-cgu.0.rcgu.o" "-L" "/tmp" "-L" "/home/runner/work/bpf-linker/bpf-linker/target/debug/deps" "-L" "/home/runner/work/bpf-linker/bpf-linker/target/debug" "-L" "/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/runner/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib" "-L" "target/bitcode" "-L" "/tmp/assembly/anon_struct_c.stage-id.aux" "-L" "/home/runner/work/bpf-linker/bpf-linker/target/sysroot/lib/rustlib/bpfel-unknown-none/lib" "target/bitcode/anon.bc" "/home/runner/work/bpf-linker/bpf-linker/target/sysroot/lib/rustlib/bpfel-unknown-none/lib/librustc_std_workspace_core-2[145](https://github.com/aya-rs/bpf-linker/actions/runs/8734403365/job/23965020239?pr=196#step:16:146)dea74949bc48.rlib" "/home/runner/work/bpf-linker/bpf-linker/target/sysroot/lib/rustlib/bpfel-unknown-none/lib/libcore-530cb4bfa41b092b.rlib" "/home/runner/work/bpf-linker/bpf-linker/target/sysroot/lib/rustlib/bpfel-unknown-none/lib/libcompiler_builtins-60fc49e7bc4ee087.rlib" "--cpu" "generic" "-L" "/home/runner/work/bpf-linker/bpf-linker/target/sysroot/lib/rustlib/bpfel-unknown-none/lib" "-o" "/tmp/assembly/anon_struct_c.s" "-O0" "--debug" "--emit=obj" "--btf" "--emit=asm"
    = note: error: failure linking module target/bitcode/anon.bc

I can try to fix it later today if you need.

@tamird
Copy link
Member Author

tamird commented Apr 18, 2024

Yeah it seems the regression is somewhere in rust-lang/rust@1cec373...becebb3. I don't have a Linux machine on hand so I'd appreciate your help. I'm trying to get better output in CI.

@tamird tamird force-pushed the clippy branch 3 times, most recently from e421050 to d6ac724 Compare April 18, 2024 11:25
@tamird
Copy link
Member Author

tamird commented Apr 18, 2024

Well I got more output, but it's not super helpful:

    = note: ERROR llvm: Invalid record
            Error: failure linking module target/bitcode/anon.bc

@tamird tamird force-pushed the clippy branch 4 times, most recently from b73904f to dd58a02 Compare April 18, 2024 11:41
tamird added 2 commits April 19, 2024 11:17
warning: field `0` is never read
   --> src/llvm/types/ir.rs:115:11
    |
115 |     Other(LLVMValueRef),
    |     ----- ^^^^^^^^^^^^
    |     |
    |     field in this variant
    |
    = note: `#[warn(dead_code)]` on by default
help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
    |
115 |     Other(()),
    |           ~~

error: usage of a legacy numeric constant
   --> src/linker.rs:525:55
    |
525 |                 format!("--unroll-max-upperbound={}", std::u32::MAX).into(),
    |                                                       ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
note: the lint level is defined here
   --> src/lib.rs:1:9
    |
1   | #![deny(clippy::all)]
    |         ^^^^^^^^^^^
    = note: `#[deny(clippy::legacy_numeric_constants)]` implied by `#[deny(clippy::all)]`
help: use the associated constant instead
    |
525 |                 format!("--unroll-max-upperbound={}", u32::MAX).into(),
    |                                                       ~~~~~~~~

error: usage of a legacy numeric constant
   --> src/linker.rs:526:50
    |
526 |                 format!("--unroll-threshold={}", std::u32::MAX).into(),
    |                                                  ^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#legacy_numeric_constants
help: use the associated constant instead
    |
526 |                 format!("--unroll-threshold={}", u32::MAX).into(),
    |                                                  ~~~~~~~~
@tamird tamird changed the title Appease clippy Appease nightly clippy Apr 19, 2024
@tamird
Copy link
Member Author

tamird commented Apr 19, 2024

@vadorovsky I've pinned nightly to 2024-04-16 to unblock this. I extracted the logging changes to #197 which I'll rebase after this merges.

@tamird tamird merged commit 50cdd7b into aya-rs:main Apr 19, 2024
10 checks passed
@tamird tamird deleted the clippy branch April 19, 2024 09:28
@vadorovsky
Copy link
Member

Awesome! Sorry that I didn't help yesterday. Hopefully I will find some time to bisect today.

@tamird
Copy link
Member Author

tamird commented Jun 11, 2024

@vadorovsky been a few months and we're still pinned. Would be really good to figure this out.

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

Successfully merging this pull request may close these issues.

2 participants