Skip to content

macOS releases do not use ccache and take 5.5 hours #4053

Closed

Description

@ryanaslett

The macOS release process does not use ccache, and thus recompiles everything on every run, which means releases take 5.5 hours eo complete.

This is set in the makefile for osx.

https://github.com/nodejs/node/blob/69d32d1cfe7e05882e004e26f18beb378e15ff20/Makefile#L1111-L1185

The release machines are configured such that ccache should be available to the release process.

We need to adjust the build process/makefile to allow for ccache to be used if it is available, following the same pattern that other architectures use.

Activity

  1. ryanaslett commented on Mar 27, 2025

    @ryanaslett
    ContributorAuthor

    We should be able to modify the release machines to symlink cc to ccache to cause the macos release builds to use ccache without modifying the makefile.

  2. richardlau commented on Mar 27, 2025

    @richardlau
    Member

    FWIW we have some Ansible setup around ccache on macOS under the old, pre-ephemeral, setup:

    - name: "ccache : check whether /etc/paths contains '/usr/local/opt/ccache/libexec' (macos)"
    command: grep -Fxq "/usr/local/opt/ccache/libexec" /etc/paths
    register: ccache_mac
    check_mode: no
    ignore_errors: yes
    changed_when: no
    - name: "ccache : add ccache to the path (macos)"
    when: ccache_mac.rc == 1
    lineinfile:
    dest: "/etc/paths"
    insertbefore: BOF
    line: "/usr/local/opt/ccache/libexec"

    and explicitly adding to the PATH environment variable for the Jenkins agent:

    export PATH="$(brew --prefix)/opt/ccache/libexec:$PATH"

    May be worth checking if symlinks for the compilers are automatically created in $(brew --prefix)/opt/ccache/libexec by the ccache install?

  3. ryanaslett commented on Mar 31, 2025

    @ryanaslett
    ContributorAuthor

    May be worth checking if symlinks for the compilers are automatically created in $(brew --prefix)/opt/ccache/libexec by the ccache install?

    Indeed they are.

    I have added $(brew --prefix)/opt/ccache/libexec to the path variables set in jenkins for the ephemeral instances (similar to the previous start.sh entrypoint), and now the release jobs use the ccache.

    Unfortunately, the release images were not configured to use the shared cache, and used the local cache and ran out of disk running the universal binary builds. (Example: https://ci-release.nodejs.org/job/iojs+release/10883/nodes=osx13-release-pkg/)

    I have reconfigured the release images, but am having difficulty saving the images due to some glitch in the orka cluster.

    I have an open support ticket with MacStadium to hopefully resolve the cluster issue so I can make the required config changes.

    Shout out/thanks to @iuuukhueeee for asking good questions to help get this fixed.

  4. ryanaslett commented on Apr 1, 2025

    @ryanaslett
    ContributorAuthor

    Update: Have resolved the issues with the release images and they are now using the shared ccache.

    osx13-release-pkg build was down to 1 hour. Once all the versions have been rebuilt and re-fill the caches we should see releases back down to the "less than 1.5 hrs"

  5. ryanaslett commented on Apr 2, 2025

    @ryanaslett
    ContributorAuthor

    The osx13-x64-release-tar took 26 minutes (was 2.25 -> 2.5 hrs before)
    https://ci-release.nodejs.org/job/iojs+release/nodes=osx13-x64-release-tar/10894/

    The osx13-arm64-release-tar took 5min 53 s (was ~50 min before: https://ci-release.nodejs.org/job/iojs+release/nodes=osx13-arm64-release-tar/10891/

    the osx13-release-pkg is coming in at 23 min (was ~ 5hrs and 5 min before: https://ci-release.nodejs.org/job/iojs+release/nodes=osx13-release-pkg/10891/)

    I think we can call this one done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions