Skip to content

Add nightly workflow to test x86_64 backend against llvm-test-suite - #1536

Open
Bhoumik Patidar (BhoumikPatidar) wants to merge 1 commit into
qualcomm:mainfrom
BhoumikPatidar:llvm-test-suite
Open

Add nightly workflow to test x86_64 backend against llvm-test-suite#1536
Bhoumik Patidar (BhoumikPatidar) wants to merge 1 commit into
qualcomm:mainfrom
BhoumikPatidar:llvm-test-suite

Conversation

@BhoumikPatidar

Copy link
Copy Markdown
Contributor

Links and runs SingleSouce (1891 tests), MultiSource (201 tests) and MicroBenchmarks (22 tests) subdirectories from llvm/llvm-test-suite for x86_64.

ld.eld is fetched via FetchNightlyToolset.

No failures expected.

uses: egor-tensin/setup-clang@23bc15cd4207e45f1566447deb48f4ff3ef932cb #v2.3
with:
version: "20"
platform: x64

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clang 22 to mimic the nightly builder.

sudo apt install -y libc++-dev libc++abi-dev \
libclang-rt-20-dev cmake ninja-build llvm-20 llvm-20-tools
pip3 install lit
echo "PATH=/usr/lib/llvm-20/bin:$PATH" >> $GITHUB_ENV

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

follow up : Can we make the nightly builder use a common action to install things, so that whatever LLVM/clang is used is at one place ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

okay, added to tasks

with:
name: llvm-test-suite-results
path: test-output.txt
retention-days: 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

retetion days 1?

run: |
if grep -q '^FAIL: ' test-output.txt; then
grep '^FAIL: ' test-output.txt
exit 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need this ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not needed, removed it.

-DCMAKE_C_COMPILER=$(which clang) \
-DCMAKE_CXX_COMPILER=$(which clang++) \
-DCMAKE_C_FLAGS="-fuse-ld=$ELD_BIN" \
-DCMAKE_CXX_FLAGS="-fuse-ld=$ELD_BIN -stdlib=libc++" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think you need to use --ld-path. Not sure if -fuse-ld respects eld.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

-fuse-ld does respect eld but emits warning warning: '-fuse-ld=' taking a path is deprecated; use '--ld-path=' instead.
I will switch to --ld-path.

lit -j$(nproc) \
build-llvm-test-suite/SingleSource \
build-llvm-test-suite/MultiSource \
build-llvm-test-suite/MicroBenchmarks \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add a comment on why other llvm test suites are not enabled. Add everything and comment it out.

-DCMAKE_C_FLAGS="-fuse-ld=$ELD_BIN" \
-DCMAKE_CXX_FLAGS="-fuse-ld=$ELD_BIN -stdlib=libc++" \
-DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=$ELD_BIN -stdlib=libc++" \
-DTEST_SUITE_SUBDIRS="SingleSource;MultiSource;MicroBenchmarks" \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do you need this as you are saying lit to run specific folders ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

currently its needed because we are restricting the folders because of the BitCode failures.
Without this CMake compiles/builds all default that we are not currently executing.
After the BitCode fix, we dont restrict folders so this wont be needed then.

@@ -0,0 +1,116 @@
name: Nightly LLVM Test Suite (x86_64)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Follow up : enable for other targets as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

okay, added to tasks


on:
schedule:
- cron: '0 3 * * *' # 9:00 PM CST

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs to run after the nightly completes, now it overlaps I believe.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

changed to 5:00 AM CST

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the goal is just to always run it after the nightly, would it be worth using workflow_run (with types as completed) rather than scheduling it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, using workflow_run instead of scheduling should be better. This can also prevent cases where the nightly fails and the artifact expires and leads to these workflows failing. Parth (@parth-07) Shankar Easwaran (@quic-seaswara) what do you suggest?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

FWIW, since originaly suggesting this, we've had the zizmor checks turned on which will complain about workflow_run being insecure (we're seeing these errors in CPULLVM right now). So, maybe workflow_run wasn't such a good suggestion in hindsight 😅

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think workflow_run is a good suggestion for jobs that depend upon nightly artifact for the cases Bhoumik Patidar (@BhoumikPatidar) pointed out
I am using it here : #1611

who added zizmor? is it really needed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

My understanding from what happened with cpullvm is it was turned on at an organization level (github.com/qualcomm).

Again only based on what we saw in cpullvm, most of the things reported are/were legitimate issues and the fixes follow recommended practices so it's probably good from that perspective.

For workflow_run specifically, I didn't look into why it is/was considered insecure, so can't comment on that part.

if: github.repository == 'qualcomm/eld' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
env:
ELD_SOURCE_DIR: ${{ github.workspace }}/llvm-project/llvm/tools/eld

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can improve this to run on a PR as well, which would be great.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great addition to ELD

Comment on lines +23 to +26
- name: Checkout eld
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
path: llvm-project/llvm/tools/eld
Links and runs SingleSouce(1891 tests), MultiSource(201 tests) and MicroBenchmarks(22 tests) subdirectories from llvm/llvm-test-suite for x86_64.
ld.eld is fetched via FetchNightlyToolset. No failures expected.

Signed-off-by: Bhoumik Patidar <bpatidar@qti.qualcomm.com>
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.

7 participants