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

[GitHub] Fix slow sccache install on macOS by upgrading macOS version #77165

Merged
merged 2 commits into from Jan 6, 2024

Conversation

linux4life798
Copy link
Contributor

The "Setup ccache" step on macOS-11 builds takes between 15 to 20 mins, whereas this step takes a less than 10 seconds on other runners. The bulk of this time is spent at the "Install sccache" step, where brew emits warnings like "Warning: You are using macOS 11." and "We (and Apple) do not provide support for this old version...".

Bumping the version of macOS greatly decreases this cache setup time to about 20 seconds. Furthermore, it seems like it is speeding up general build times, too.

It appears that actions/runner-images#5900 has been resolved or obsoleted, so I do not believe
we need to lock macOS to 11 anymore.

@llvmbot
Copy link
Collaborator

llvmbot commented Jan 6, 2024

@llvm/pr-subscribers-github-workflow

Author: Craig Hesling (linux4life798)

Changes

The "Setup ccache" step on macOS-11 builds takes between 15 to 20 mins, whereas this step takes a less than 10 seconds on other runners. The bulk of this time is spent at the "Install sccache" step, where brew emits warnings like "Warning: You are using macOS 11." and "We (and Apple) do not provide support for this old version...".

Bumping the version of macOS greatly decreases this cache setup time to about 20 seconds. Furthermore, it seems like it is speeding up general build times, too.

It appears that actions/runner-images#5900 has been resolved or obsoleted, so I do not believe
we need to lock macOS to 11 anymore.


Full diff: https://github.com/llvm/llvm-project/pull/77165.diff

1 Files Affected:

  • (modified) .github/workflows/llvm-project-tests.yml (+1-3)
diff --git a/.github/workflows/llvm-project-tests.yml b/.github/workflows/llvm-project-tests.yml
index 02b1ab75e960ec..e8bdffc2293916 100644
--- a/.github/workflows/llvm-project-tests.yml
+++ b/.github/workflows/llvm-project-tests.yml
@@ -34,9 +34,7 @@ on:
         type: string
         # Use windows-2019 due to:
         # https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
-        # We're using a specific version of macOS due to:
-        # https://github.com/actions/virtual-environments/issues/5900
-        default: '["ubuntu-latest", "windows-2019", "macOS-11"]'
+        default: '["ubuntu-latest", "windows-2019", "macOS-latest"]'
 
 concurrency:
   # Skip intermediate builds: always.

@linux4life798
Copy link
Contributor Author

@tstellar, is there any way to confirm that the issue mentioned above is resolved or obsolete?

@tstellar
Copy link
Collaborator

tstellar commented Jan 6, 2024

@tstellar, is there any way to confirm that the issue mentioned above is resolved or obsolete?

You can try removing the workaround and see if it still builds.

@linux4life798
Copy link
Contributor Author

Test run with macOS-latest, but with the PKG_CONFIG_PATH env var removed.

https://github.com/linux4life798/llvm-project/actions/runs/7428652707/job/20216260090

@linux4life798
Copy link
Contributor Author

linux4life798 commented Jan 6, 2024

It looks like we are building properly on macOS-12 without the PKG_CONFIG_PATH workaround.

Here is another test run using macOS-12 from eb38995d6493623e5368d2b395d6ccc6c01bd612. The macOS-12 has finished building and succeeded.

  • The enabled llvm projects are clang;lldb;libclc;lld
  • The build target was ""

https://github.com/linux4life798/llvm-project/actions/runs/7428836371/job/20216662446

The "Setup ccache" step on macOS-11 builds takes between 15 to 20 mins,
whereas this step takes a less than 10 seconds on other runners.
The bulk of this time is spent at the "Install sccache" step, where brew
emits warnings like "Warning: You are using macOS 11." and
"We (and Apple) do not provide support for this old version...".

Bumping the version of macOS greatly decreases this cache setup time to
about 20 seconds. Furthermore, it seems like it is speeding up general
build times, too.

It appears that actions/runner-images#5900
has been resolved, so I do not believe we need to lock macOS to 11 anymore.
Remove the workaround for
actions/runner-images#5900, which seems to
be resolved.
@linux4life798
Copy link
Contributor Author

I forgot to change the macOS-11 reference in the workflow_dispatch section. This PR is ready for review.

Copy link
Collaborator

@tstellar tstellar left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@linux4life798
Copy link
Contributor Author

linux4life798 commented Jan 6, 2024

@tstellar, I don't have merge rights to this repo. What is the protocol for merging approved changed? I have a few PRs that have been approved, but not merged.

@tstellar tstellar merged commit 602c8fa into llvm:main Jan 6, 2024
4 checks passed
@tstellar
Copy link
Collaborator

tstellar commented Jan 6, 2024

@linux4life798 Which other PRs do you need merged?

@linux4life798 linux4life798 deleted the fix-slow-macOS-sccache-install branch January 6, 2024 06:16
@linux4life798
Copy link
Contributor Author

🙏 thank you! The local commit stack was getting pretty deep.

@linux4life798
Copy link
Contributor Author

linux4life798 commented Jan 7, 2024

It looks like there is some sccache / hendrikmuhs/ccache-action issue with macOS-12.

I explained the problem in hendrikmuhs/ccache-action#174, but basically macOS-12 builds will appears to restore their cache correctly, but the build doesn't appear to be using the cache (really slow), and then it fails to get the cache stats at the end of the run. This last part causes the cache to not be saved.

I'm running an experiment with macOS-11 and macOS-12 to see if the version bump alone triggers this:

@linux4life798
Copy link
Contributor Author

linux4life798 commented Jan 8, 2024

Hmm. It looks like macOS-11 does not see this cache issue. It worth noting that builds succeed on macOS-11 even with the PKG_CONFIG_PATH workaround removed.

I also tried to see if there was newer version of hendrikmuhs/ccache-action, but it looks like we are already using the newest version (the v1 tag was updated to the latest tag).

I am running another experiment to see if an older version of hendrikmuhs/ccache-action still shows this cache issue, but in the meantime, I think we should just revert the commit for this PR (602c8fa).

linux4life798 added a commit to linux4life798/llvm-project that referenced this pull request Jan 8, 2024
… version (llvm#77165)"

This reverts commit 602c8fa, due to
an sccache issue seen on larger builds using macOS-12 runners.

The issue is documented in in the following issue:
hendrikmuhs/ccache-action#174

The original PR is the following:
llvm#77165
tstellar pushed a commit that referenced this pull request Jan 8, 2024
… version (#77165)" (#77270)

This reverts commit 602c8fa, due to an
sccache issue seen on larger builds using macOS-12 runners.

The issue is documented in in the following issue:
hendrikmuhs/ccache-action#174

The original PR is the following:
#77165
justinfargnoli pushed a commit to justinfargnoli/llvm-project that referenced this pull request Jan 28, 2024
…llvm#77165)

The "Setup ccache" step on macOS-11 builds takes between 15 to 20 mins,
whereas this step takes a less than 10 seconds on other runners. The
bulk of this time is spent at the "Install sccache" step, where brew
emits warnings like "Warning: You are using macOS 11." and "We (and
Apple) do not provide support for this old version...".

Bumping the version of macOS greatly decreases this cache setup time to
about 20 seconds. Furthermore, it seems like it is speeding up general
build times, too.

It appears that
actions/runner-images#5900 has been
resolved or obsoleted, so I do not believe
we need to lock macOS to 11 anymore.
justinfargnoli pushed a commit to justinfargnoli/llvm-project that referenced this pull request Jan 28, 2024
… version (llvm#77165)" (llvm#77270)

This reverts commit 602c8fa, due to an
sccache issue seen on larger builds using macOS-12 runners.

The issue is documented in in the following issue:
hendrikmuhs/ccache-action#174

The original PR is the following:
llvm#77165
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.

None yet

3 participants