Skip to content

ci(macos): unlink zstd during the deps build instead of uninstalling it - #1237

Open
alandebortolo wants to merge 1 commit into
Snapmaker:mainfrom
DesignMaster-Solutions:fix/macos-deps-zstd-unlink
Open

alandebortolo wants to merge 1 commit into
Snapmaker:mainfrom
DesignMaster-Solutions:fix/macos-deps-zstd-unlink

Conversation

@alandebortolo

Copy link
Copy Markdown

What

In build_deps.yml, the macOS step hides Homebrew's zstd from the deps build with brew unlink zstd and restores it with brew link zstd, instead of brew uninstall --ignore-dependencies zstd + brew install zstd.

Why

Homebrew's own curl loads /opt/homebrew/opt/zstd/lib/libzstd.1.dylib. brew uninstall deletes opt/zstd, so the final brew install zstd cannot download anything and the job fails with Library not loaded: ... libzstd.1.dylib. This hits every macOS run that has no deps cache (forks, build-deps-only, cache misses); we saw it on the macOS rerun of #1235.

brew unlink removes the same 22 symlinks the build could pick up (include/zstd.h, zdict.h, zstd_errors.h, lib/libzstd*, lib/pkgconfig/libzstd.pc, lib/cmake/zstd, the binaries) but keeps opt/zstd, so brewed curl keeps working and brew link puts everything back.

Tested

On a Mac with Homebrew zstd 1.5.7_1 and brewed curl 8.23.0:

  • brew unlink zstd: 22 symlinks removed; include/zstd.h and lib/pkgconfig/libzstd.pc gone; opt/zstd still there.
  • brewed curl --version still loads (reports zstd/1.5.7), and brew fetch --force zstd with HOMEBREW_FORCE_BREWED_CURL=1 downloads the bottle (rc 0).
  • brew link zstd: 22 symlinks back.
  • YAML parses.

Limits

  • I did not reproduce the uninstall failure locally (it would break this machine's curl); the failure is from the CI log above.
  • Full macOS deps build with this change is running on my fork: https://github.com/DesignMaster-Solutions/OrcaSlicer/actions/runs/44958921529 (build-deps-only). I will post the result here.
  • I did not check whether any dependency finds zstd through opt/zstd by itself; nothing in the deps CMake that I know of searches there.

brew uninstall --ignore-dependencies zstd deletes opt/zstd, but Homebrew's
own curl loads libzstd from there, so the final 'brew install zstd' cannot
download anything (Library not loaded: libzstd.1.dylib). brew unlink hides
the headers, libs, pkg-config and CMake files from the deps build the same
way, keeps opt/zstd, and brew link puts them back.
@alandebortolo

Copy link
Copy Markdown
Author

CI proof on my fork, build-deps-only run without a deps cache, branch head e8be5ac:

https://github.com/DesignMaster-Solutions/OrcaSlicer/actions/runs/44958921529/job/137013250603

  • Step "Build on Mac arm64" (shell /bin/bash -e): Unlinking /opt/homebrew/Cellar/zstd/1.5.7_1... 22 symlinks removed., then the full universal deps build, then brew link zstd as the last command. Step and job finished green.
  • The same step on the rerun of Save a user preset without inheriting from a project-embedded preset (#1207) #1235 died at the final brew install zstd with Library not loaded (brewed curl lost libzstd when opt/zstd was removed by the uninstall).
  • Ubuntu and Windows Build Deps also green in the same run.

Limits: macOS slicer build in that run was still going when I wrote this; this PR only touches the deps step.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants