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

tests.cc-wrapper: run on more compilers #253752

Merged
merged 9 commits into from
Sep 8, 2023
Merged

Conversation

Artturin
Copy link
Member

@Artturin Artturin commented Sep 7, 2023

Split from #216273

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the jobs.tests are run here because of 36587a5

There's a useful snippet in the comments if we want to run these

      tests = forAllSystems
        (system:
          let pkgs = pkgsFor system; in
          pkgs.callPackages ../test {});

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests.cc-wrapper.gccMultiStdenv fails with

cc-wrapper-test-gcc> checking whether sanitizers are fully functional... ./sanitizers: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS32

@Artturin Artturin force-pushed the testsccwrapper branch 3 times, most recently from 3c9dd2a to ae26b91 Compare September 7, 2023 03:30
Copy link
Member Author

@Artturin Artturin Sep 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests.cc-wrapper.llvmPackages_15.libcxx fails with

cc-wrapper-test-clang-libcxx> checking whether compiler builds valid C++ binaries...
cc-wrapper-test-clang-libcxx> -/nix/store/8zxgqm6d879hskwh5g1l4crysl01kdv0-binutils-2.40/bin/ld: cannot find l: No such file or directory
$ diff pkgs/development/compilers/llvm/15/libcxx/default.nix pkgs/development/compilers/llvm/16/libcxx/default.nix
50,51d49
<   ] ++ lib.optionals stdenv.hostPlatform.isMusl [
<     ../../libcxx-0001-musl-hacks.patch
82,83d79
<       # (Backport fix from 16, which has LIBCXX_ADDITIONAL_LIBRARIES, but 15
<       # does not appear to)
86c82
<       #   -DLLVM_ENABLE_PROJECTS=libcxxabi;libunwind
---
>       #   -DLLVM_ENABLE_PROJECTS=libcxxabi;libunwinder
89,90c85
<       # "-DLIBCXX_ADDITIONAL_LIBRARIES=unwind"
<       "-DCMAKE_SHARED_LINKER_FLAGS=-lunwind"
---
>       "-DLIBCXX_ADDITIONAL_LIBRARIES=unwind"

the cause does not appear to be any of these diffs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests.cc-wrapper.gcc49Stdenv fails with

cc-wrapper-test-gcc> checking whether sanitizers are fully functional...
cc-wrapper-test-gcc> In file included from /nix/store/3c3vrabg4yy87y4qx8zsy5x2vdg132j5-sanitizers.c:1:0:
cc-wrapper-test-gcc> /nix/store/ix23ggz0k9vrhbl6ig7bwqcgf396rwmx-gcc-4.9.4/lib/gcc/x86_64-unknown-linux-gnu/4.9.4/include/sanitizer/asan_interface.h:53:3: error: unknown type name 'bool'
cc-wrapper-test-gcc>    bool __asan_address_is_poisoned(void const volatile *addr);
cc-wrapper-test-gcc>    ^
cc-wrapper-test-gcc> /nix/store/ix23ggz0k9vrhbl6ig7bwqcgf396rwmx-gcc-4.9.4/lib/gcc/x86_64-unknown-linux-gnu/4.9.4/include/sanitizer/asan_interface.h:66:40: error: unknown type name 'bool'
cc-wrapper-test-gcc>                             void *addr, bool is_write, size_t access_size);
cc-wrapper-test-gcc>                                         ^
cc-wrapper-test-gcc> /nix/store/ix23ggz0k9vrhbl6ig7bwqcgf396rwmx-gcc-4.9.4/lib/gcc/x86_64-unknown-linux-gnu/4.9.4/include/sanitizer/asan_interface.h:88:3: error: unknown type name 'bool'
cc-wrapper-test-gcc>    bool __asan_symbolize(const void *pc, char *out_buffer,
cc-wrapper-test-gcc>    ^
cc-wrapper-test-gcc> /nix/store/ix23ggz0k9vrhbl6ig7bwqcgf396rwmx-gcc-4.9.4/lib/gcc/x86_64-unknown-linux-gnu/4.9.4/include/sanitizer/asan_interface.h:98:3: error: unknown type name 'bool'
cc-wrapper-test-gcc>    bool __asan_get_ownership(const void *p);
cc-wrapper-test-gcc>    ^

@Artturin Artturin marked this pull request as ready for review September 7, 2023 04:36
@Artturin
Copy link
Member Author

Artturin commented Sep 7, 2023

@ofborg build tests.cc-wrapper

@Artturin Artturin requested a review from a user September 7, 2023 04:42
@Artturin
Copy link
Member Author

Artturin commented Sep 7, 2023

Will have to limit multilib gcc wrapper to x86_l64-inux only

error: Multilib gcc-wrapper-12.3.0 not supported for ‘x86_64-darwin’

@Artturin
Copy link
Member Author

Artturin commented Sep 7, 2023

@ofborg build tests.cc-wrapper

@Artturin
Copy link
Member Author

Artturin commented Sep 7, 2023

Eval fails seems to be because of this

$ nix-build pkgs/top-level/release.nix -A tests.cc-wrapper.gcc10Stdenv.aarch64-darwin
       error: evaluation aborted with the following error message: 'cannot find attribute `tests.cc-wrapper.gcc10Stdenv''

on the 3 other platfomrs the attr is there

rrbutani and others added 7 commits September 7, 2023 22:36
ignore `llvmPackages_latest`, it's an alias and it'll be a duplicate.
ignore `llvmPackages_git`, it's not supposed to be used in nixpkgs and
may be broken.
Show what libc is used, otherwise there's indication what libc is being
used. Ex in gccMultiStdenv.
…g for linux and x86_64

they're only supported on x86_64-linux
This reverts commit d33a309.

commit caused ofborg-eval to fail with

```
$ nix-build pkgs/top-level/release.nix -A tests.cc-wrapper.gcc10Stdenv.aarch64-darwin
       error: evaluation aborted with the following error message: 'cannot find attribute `tests.cc-wrapper.gcc10Stdenv''
```

on the 3 other platfomrs the attr is there
@Artturin
Copy link
Member Author

Artturin commented Sep 7, 2023

@ofborg build tests.cc-wrapper

@Artturin
Copy link
Member Author

Artturin commented Sep 7, 2023

@ofborg build tests.cc-wrapper.supported

@Artturin
Copy link
Member Author

Artturin commented Sep 7, 2023

@ofborg build tests.cc-wrapper.supported

@Artturin Artturin force-pushed the testsccwrapper branch 2 times, most recently from 777848d to ca50953 Compare September 7, 2023 21:49
@Artturin
Copy link
Member Author

Artturin commented Sep 7, 2023

@ofborg build tests.cc-wrapper.supported

@Artturin
Copy link
Member Author

Artturin commented Sep 7, 2023

@ofborg build tests.cc-wrapper.supported

@Artturin
Copy link
Member Author

Artturin commented Sep 7, 2023

@ofborg build tests.cc-wrapper.supported

@Artturin
Copy link
Member Author

Artturin commented Sep 7, 2023

aarch64-darwin fails with

ld: warning: object file (floatuntitf_s.o) was built for newer macOS version (11.0) than being linked (10.5)
ld: warning: ld: warning: object file (trunctfsf2_s.o) was built for newer macOS version (11.0) than being linked (10.5)
ld: warning: ld: warning: could not create compact unwind for ___fixunstfdi: register 20 saved somewhere other than in frame
object file (fixtfti_s.o) was built for newer macOS version (11.0) than being linked (10.5)
ld: warning: object file (extendhftf2_s.o) was built for newer macOS version (11.0) than being linked (10.5)
could not create compact unwind for ___fixtfdi: register 20 saved somewhere other than in frame
ld: warning: object file (trunctfhf2_s.o) was built for newer macOS version (11.0) than being linked (10.5)
ld: warning: could not create compact unwind for ___trunctfhf2: register 20 saved somewhere other than in frame
ld: warning: object file (fixhfti_s.o) was built for newer macOS version (11.0) than being linked (10.5)
ld: warning: could not create compact unwind for ___fixhfti: register 20 saved somewhere other than in frame
ld: warning: object file (extenddftf2_s.o) was built for newer macOS version (11.0) than being linked (10.5)
ld: warning: could not create compact unwind for ___fixtfti: register 20 saved somewhere other than in frame
ld: warning: ld: warning: object file (fixunshfti_s.o) was built for newer macOS version (11.0) than being linked (10.5)object file (floatuntihf_s.o) was built for newer macOS version (11.0) than being linked (10.5)
ld: warning: object file (trunctfdf2_s.o) was built for newer macOS version (11.0) than being linked (10.5)
ld: warning: could not create compact unwind for ___trunctfdf2: register 20 saved somewhere other than in frame
ld: warning: could not create compact unwind for ___floatuntihf: register 20 saved somewhere other than in frame
ld: warning: could not create compact unwind for ___trunctfsf2: register 20 saved somewhere other than in frame
ld: warning: object file (floattihf_s.o) was built for newer macOS version (11.0) than being linked (10.5)
ld: warning: could not create compact unwind for ___floattihf: register 20 saved somewhere other than in frame
ld: warning: 
ld: warning: could not create compact unwind for ___fixunshfti: register 20 saved somewhere other than in frame
object file (enable-execute-stack_s.o) was built for newer macOS version (11.0) than being linked (10.5)ld: warning: dylib (/nix/store/yvkqnf5nq9g204k3f61cvw5v9c09ngbg-gettext-0.21.1/lib/libintl.dylib) was built for newer macOS version (11.0) than being linked (10.5)
ld: warning: object file (emutls_s.o) was built for newer macOS version (11.0) than being linked (10.5)
ld: warning: could not create compact unwind for ___emutls_get_address: registers 23 and 24 not saved contiguously in frame
ld: warning: could not create compact unwind for ___enable_execute_stack: registers 19 and 20 not saved contiguously in frame
ld: symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o for architecture arm64
collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:995: libgcc_s.dylib] Error 1
make[3]: Leaving directory '/private/tmp/nix-build-gcc-11.4.0.drv-0/build/aarch64-apple-darwin/libgcc'
make[2]: *** [Makefile:18100: all-stage1-target-libgcc] Error 2
make[2]: Leaving directory '/private/tmp/nix-build-gcc-11.4.0.drv-0/build'
make[1]: *** [Makefile:22716: stage1-bubble] Error 2
make[1]: Leaving directory '/private/tmp/nix-build-gcc-11.4.0.drv-0/build'
make: *** [Makefile:23037: bootstrap] Error 2

EDIT: workaround added

filter out llvmPackages <=10 on aarch64-darwin, they're marked broken
and availableOn doesn't filter broken packages
@Artturin
Copy link
Member Author

Artturin commented Sep 8, 2023

@ofborg build tests.cc-wrapper.supported

@Artturin
Copy link
Member Author

Artturin commented Sep 8, 2023

Good enough, will try removing the special cases later.

@Artturin Artturin merged commit b540334 into NixOS:master Sep 8, 2023
22 checks passed
@Artturin Artturin deleted the testsccwrapper branch September 8, 2023 01:40
@rrbutani rrbutani added the 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants