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

llvmPackages_git.llvm: run the tests on macOS #222220

Merged

Conversation

alyssais
Copy link
Member

Description of changes

Port of c7231c0 ("llvmPackages_15.llvm: run the tests on macOS").

The sysctl native check input was taken from
6d0c876 ("llvmPackages_15.llvm: add in a missing check dep"), because it looks like it was supposed to be part of c7231c0 instead.

New PR for #220759, which I rebased badly.

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.05 Release Notes (or backporting 22.11 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.

@ofborg ofborg bot added 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild labels Mar 20, 2023
@alyssais
Copy link
Member Author

@ofborg build llvmPackages_git.llvm

@adamcstephens
Copy link
Contributor

adamcstephens commented Mar 21, 2023

This failed for me on aarch64-darwin

FAIL: LLVM :: MC/ELF/cfi-version.ll (27957 of 44194)

-- Testing: 44194 tests, 8 workers --
FAIL: LLVM :: MC/ELF/cfi-version.ll (27957 of 44194)
******************** TEST 'LLVM :: MC/ELF/cfi-version.ll' FAILED ********************
Script:
--
: 'RUN: at line 1';   /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/llc /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/test/MC/ELF/cfi-version.ll -o - -dwarf-version 2 -filetype=obj | /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/llvm-dwarfdump -v - | /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/FileCheck /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/test/MC/ELF/cfi-version.ll --check-prefix=DWARF2
: 'RUN: at line 2';   /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/llc /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/test/MC/ELF/cfi-version.ll -o - -dwarf-version 3 -filetype=obj | /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/llvm-dwarfdump -v - | /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/FileCheck /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/test/MC/ELF/cfi-version.ll --check-prefix=DWARF3
: 'RUN: at line 3';   /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/llc /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/test/MC/ELF/cfi-version.ll -o - -dwarf-version 4 -filetype=obj | /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/llvm-dwarfdump -v - | /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/FileCheck /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/test/MC/ELF/cfi-version.ll --check-prefix=DWARF4
: 'RUN: at line 4';   /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/llc /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/test/MC/ELF/cfi-version.ll -o - -dwarf-version 5 -filetype=obj | /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/llvm-dwarfdump -v - | /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/bin/FileCheck /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/test/MC/ELF/cfi-version.ll --check-prefix=DWARF4
--
Exit Code: 1

Command Output (stderr):
--
/private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/test/MC/ELF/cfi-version.ll:43:11: error: DWARF2: expected string not found in input
; DWARF2: .debug_frame contents:
          ^
<stdin>:1:1: note: scanning from here
-: file format Mach-O arm64
^
<stdin>:61:1: note: possible intended match here
.debug_line contents:
^

Input file: <stdin>
Check file: /private/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/test/MC/ELF/cfi-version.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: -: file format Mach-O arm64 
check:43'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
            2:  
check:43'0     ~
            3: .debug_abbrev contents: 
check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~
            4: Abbrev table for offset: 0x00000000 
check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            5: [1] DW_TAG_compile_unit DW_CHILDREN_yes 
check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            6:  DW_AT_producer DW_FORM_strp 
check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
            .
            .
            .
           56:  DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed) 
check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           57:  DW_AT_byte_size [DW_FORM_data1] (0x04) 
check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           58:  
check:43'0     ~
           59: 0x00000054: NULL 
check:43'0     ~~~~~~~~~~~~~~~~~
           60:  
check:43'0     ~
           61: .debug_line contents: 
check:43'0     ~~~~~~~~~~~~~~~~~~~~~~
check:43'1     ?                      possible intended match
           62: debug_line[0x00000000] 
check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~
           63: Line table prologue: 
check:43'0     ~~~~~~~~~~~~~~~~~~~~~
           64:  total_length: 0x00000036 
check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           65:  format: DWARF32 
check:43'0     ~~~~~~~~~~~~~~~~~
           66:  version: 2 
check:43'0     ~~~~~~~~~~~~
            .
            .
            .
>>>>>>

--

********************
********************
Failed Tests (1):
  LLVM :: MC/ELF/cfi-version.ll


Testing Time: 877.59s
  Skipped          :     7
  Unsupported      :  1972
  Passed           : 48229
  Expectedly Failed:   176
  Failed           :     1
FAILED: CMakeFiles/check-all /tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/CMakeFiles/check-all 
cd /tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build && /nix/store/gl9hiqy6x9prqxs7iv6xg43bk1h9kl6c-python3-3.10.10-env/bin/python3.10 /tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/./bin/llvm-lit -svj8 --no-progress-bar --param polly_site_config=/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/tools/polly/test/lit.site.cfg --param polly_unit_site_config=/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/tools/polly/test/Unit/lit.site.cfg --param polly_site_config=/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/tools/polly/test/Unit/lit.site.cfg --param polly_site_config=/tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/tools/polly/test/UnitIsl/lit.site.cfg /tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/tools/polly/test /tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/tools/polly/test/Unit /tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/tools/polly/test/UnitIsl /tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/utils/lit /tmp/nix-build-llvm-unstable-2022-26-07.drv-0/llvm-src-unstable-2022-26-07/llvm/build/test
ninja: build stopped: subcommand failed.

@RaitoBezarius
Copy link
Member

RaitoBezarius commented Mar 21, 2023

I'm not sure that debug frames sections are emitted on aarch64-darwin, it seems like a upstream bug to not skip the test on this platform.
They do it for Windows on x64 or arm64, I believe.

@alyssais
Copy link
Member Author

it seems like a upstream bug to not skip the test on this platform.

Do you know why it might work on LLVM 15, where we already run the tests? Maybe there's some upstream change, or maybe we're doing something different in the remaining delta?

@RaitoBezarius
Copy link
Member

Reading https://reviews.llvm.org/D67216 seems to indicate that .debug_frame should always be present on ARM toolchain.
(Potentially relevant: https://reviews.llvm.org/D87011).

I will investigate more tomorrow.

@RaitoBezarius
Copy link
Member

Switching to llvm15 revision, I have those two errors:

LLVM :: MC/ELF/cfi-version.ll
LLVM-Unit :: Support/./SupportTests/HostTest/getMacOSHostVersion

Therefore, there's still a diff indeed missing.

@rrbutani
Copy link
Contributor

rrbutani commented Mar 22, 2023

@RaitoBezarius I just skipped that test on Darwin in #194634: 0ee5251 (this commit also has a fix for the HostTest/getMacOSHostVersion failure you're seeing). In retrospect I probably should have only skipped the test on aarch64 Darwin..

Upstream has indeed correctly gated this test in LLVM16+: llvm/llvm-project@3716851.

@RaitoBezarius
Copy link
Member

@RaitoBezarius I just skipped that test on Darwin in #194634: 0ee5251 (this commit also has a fix for the HostTest/getMacOSHostVersion failure you're seeing).

Upstream has indeed correctly gated this test in LLVM16+: llvm/llvm-project@3716851.

Thanks for the details. We only need to do the same then, @alyssais.

@rrbutani
Copy link
Contributor

Haven't tested locally (ofborg timed out) yet but I expect we'll also need parts of eafb8fb to get the tests to pass on x86_64-darwin.


Has anyone looked into the aarch64-linux failure already?

@RaitoBezarius
Copy link
Member

Haven't tested locally (ofborg timed out) yet but I expect we'll also need parts of eafb8fb to get the tests to pass on x86_64-darwin.

Got it.

Has anyone looked into the aarch64-linux failure already?

Not yet.

@RaitoBezarius RaitoBezarius marked this pull request as draft March 24, 2023 00:21
@RaitoBezarius RaitoBezarius force-pushed the llvmPackages_git.llvm-tests-macos branch from 8c14365 to f67c00c Compare March 24, 2023 00:22
@RaitoBezarius RaitoBezarius marked this pull request as ready for review March 24, 2023 00:22
@RaitoBezarius RaitoBezarius force-pushed the llvmPackages_git.llvm-tests-macos branch from f67c00c to 7f6e59f Compare March 24, 2023 00:22
@RaitoBezarius
Copy link
Member

Tests are now fixed for aarch64-darwin, let's see what Ofborg has to say.

@adamcstephens
Copy link
Contributor

This builds successfully for me now on aarch64-darwin.

@RaitoBezarius
Copy link
Member

@ofborg build llvmPackages_git.llvm

@rrbutani
Copy link
Contributor

rrbutani commented Mar 24, 2023

@RaitoBezarius did you mean to squash the commits you pushed? (If so, I think it's still worth noting in the commit message that this includes fixes from 00839fe, 0ee5251, and abba4c313bcf515aceac1c9d96c61bd78b70f090)

Also the aarch64-linux FileCheck fail ofborg was seeing (our motivation for bumping llvmPackages_git to 15 before continuing to work on it) seems to have disappeared; pretty spooky 👀.

@RaitoBezarius
Copy link
Member

@RaitoBezarius did you mean to squash the commits you pushed? (If so, I think it's still worth noting in the commit message that this includes fixes from 00839fe, 0ee5251, and abba4c3)

I have left them as-is so we can decide at the end what do we want to squash. :)
But please don't hesitate to rewrite the history accordingly.

Also the aarch64-linux FileCheck fail ofborg was seeing (our motivation for bumping llvmPackages_git to 15 before continuing to work on it) seems to have disappeared; pretty spooky eyes.

Heh. :)

@RaitoBezarius
Copy link
Member

@ofborg build llvmPackages_git.llvm

Copy link
Member

@RaitoBezarius RaitoBezarius left a comment

Choose a reason for hiding this comment

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

Good to go AFAIK. ofborg failures are timeouts, tested separately by contributors in this discussion.

Port of c7231c0 ("llvmPackages_15.llvm: run the tests on macOS").

The sysctl native check input was taken from
6d0c876 ("llvmPackages_15.llvm: add in a missing check dep"),
because it looks like it was supposed to be part of c7231c0
instead.
@RaitoBezarius RaitoBezarius force-pushed the llvmPackages_git.llvm-tests-macos branch 2 times, most recently from d55c631 to 94a151d Compare March 26, 2023 14:45
@RaitoBezarius
Copy link
Member

The PR is ready @alyssais @rrbutani ; formatted with the two original commits of LLVM15.

@alyssais
Copy link
Member Author

Let's reference the original commit in the commit message, like I did?

Port of 0ee5251 ("llvmPackages_15.llvm:
adjust a path, skip an xfail test on darwin")
@RaitoBezarius RaitoBezarius force-pushed the llvmPackages_git.llvm-tests-macos branch from 94a151d to 3f9a9ad Compare March 26, 2023 15:56
@RaitoBezarius
Copy link
Member

Let's reference the original commit in the commit message, like I did?

Done, will do the same for the other PRs. Apologies for the formatting back'n'forth. :)

@alyssais
Copy link
Member Author

Looks fine to me now.

Port of eafb8fb ("llvmPackages_15.llvm: fix the tests on `x86_64-darwin`")
@RaitoBezarius
Copy link
Member

With this: tests on (aarch64|x86_64)-darwin are passing. Retargeting master.

@RaitoBezarius RaitoBezarius marked this pull request as draft March 28, 2023 11:12
@RaitoBezarius RaitoBezarius changed the base branch from staging to master March 28, 2023 11:12
@RaitoBezarius RaitoBezarius marked this pull request as ready for review March 28, 2023 11:12
@RaitoBezarius RaitoBezarius merged commit 43c847c into NixOS:master Mar 28, 2023
@alyssais alyssais deleted the llvmPackages_git.llvm-tests-macos branch March 28, 2023 19:27
@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
Labels
6.topic: darwin Running or building packages on Darwin 6.topic: llvm/clang Issues related to llvmPackages, clangStdenv and related 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild 10.rebuild-linux: 0 This PR does not cause any packages to rebuild
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants