Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,18 @@ jobs:
os: ubuntu-24.04
profile: maxperf
allow_fail: false
- target: aarch64-apple-darwin
os: macos-14
profile: maxperf
allow_fail: false
steps:
- uses: actions/checkout@v5
- uses: rui314/setup-mold@v1
- uses: dtolnay/rust-toolchain@stable
Comment on lines +78 to 85
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

rui314/setup-mold GitHub Action macOS support

💡 Result:

rui314/setup-mold is effectively Linux-only for typical use, because mold does not support linking Mach-O binaries on macOS (its Mach-O support was removed). On a macOS GitHub Actions runner you may be able to install mold (e.g., via Homebrew), but attempting to use it as the system linker will fail for native macOS builds. [1] [2]

Implication for GitHub Actions: don’t use - uses: rui314/setup-mold@v1 on runs-on: macos-* unless you’re doing something nonstandard like cross-linking non-Mach-O targets; for native macOS builds you’ll need a different linker. [1] [2]

Sources:
[1] GitHub issue “Is macos supported” in rui314/mold (shows macOS link failure / not supported) (github.com)
[2] Homebrew mold formula notes Mach-O support removed (formulae.brew.sh)

Citations:


🏁 Script executed:

# Check the actual workflow file to understand the current state
find . -name "release.yml" -o -name "*.yml" | grep -E "workflows|github" | head -20

Repository: berachain/bera-reth

Length of output: 425


🏁 Script executed:

cat .github/workflows/release.yml

Repository: berachain/bera-reth

Length of output: 13003


Guard setup-mold to Linux runners.
The setup-mold action will fail on the macOS runner since mold does not support Mach-O binaries (support was removed). Conditionally run this step only on Linux.

Suggested fix
      - uses: rui314/setup-mold@v1
+       if: ${{ !startsWith(matrix.configs.os, 'macos') }}
🤖 Prompt for AI Agents
In @.github/workflows/release.yml around lines 78 - 85, The setup-mold step in
the GitHub Actions workflow should be guarded so it only runs on Linux runners;
update the step that uses rui314/setup-mold@v1 to include a conditional (e.g.,
an if: that checks runner.os == 'Linux') so the action is skipped on macOS jobs
(this ensures the mold setup is not executed for the macos-14 job and prevents
failures).

with:
target: ${{ matrix.configs.target }}
- name: Install cross main
id: cross_main
if: ${{ !startsWith(matrix.configs.os, 'macos') }}
Copy link

Choose a reason for hiding this comment

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

why this? cross main not needed on apple silicon?

Copy link
Author

Choose a reason for hiding this comment

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

Apparently cross will default to cargo on Apple Silicon anyways.

run: |
cargo install cross --git https://github.com/cross-rs/cross
- uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -211,6 +215,7 @@ jobs:
|:---:|:---:|:---:|:---|
| <img src="https://www.svgrepo.com/download/473700/linux.svg" width="50"/> | x86_64 | [bera-reth-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/bera-reth-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/bera-reth-${{ env.VERSION }}-x86_64-unknown-linux-gnu.tar.gz.asc) |
| <img src="https://www.svgrepo.com/download/473700/linux.svg" width="50"/> | aarch64 | [bera-reth-${{ env.VERSION }}-aarch64-unknown-linux-gnu.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/bera-reth-${{ env.VERSION }}-aarch64-unknown-linux-gnu.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/bera-reth-${{ env.VERSION }}-aarch64-unknown-linux-gnu.tar.gz.asc) |
| <img src="https://www.svgrepo.com/download/473712/macos.svg" width="50"/> | aarch64 | [bera-reth-${{ env.VERSION }}-aarch64-apple-darwin.tar.gz](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/bera-reth-${{ env.VERSION }}-aarch64-apple-darwin.tar.gz) | [PGP Signature](https://github.com/${{ env.REPO_NAME }}/releases/download/${{ env.VERSION }}/bera-reth-${{ env.VERSION }}-aarch64-apple-darwin.tar.gz.asc) |
| <img src="https://www.svgrepo.com/download/473589/docker.svg" width="50"/> | Docker | [${{ env.IMAGE_NAME }}](${{ env.DOCKER_IMAGE_NAME_URL }}) | - |
ENDBODY
)
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ build-x86_64-unknown-linux-gnu: ## Build bera-reth for x86_64-unknown-linux-gnu
build-aarch64-unknown-linux-gnu: ## Build bera-reth for aarch64-unknown-linux-gnu
cross build --target aarch64-unknown-linux-gnu --features "$(FEATURES)" --profile "$(PROFILE)"

.PHONY: build-aarch64-apple-darwin
build-aarch64-apple-darwin: ## Build bera-reth for macOS Apple Silicon
Copy link

Choose a reason for hiding this comment

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

this isn't being used in CI anywhere (in release.yml)

Copy link
Author

Choose a reason for hiding this comment

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

It's for practicality of:

make build-aarch64-apple-darwin;

cargo build --target aarch64-apple-darwin --features "$(FEATURES)" --profile "$(PROFILE)"

###############################################################################
### Development ###
###############################################################################
Expand Down
7 changes: 7 additions & 0 deletions scripts/test-build-targets.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ echo "Testing cross-compilation targets..."
test_build_target "x86_64-unknown-linux-gnu" "Linux x86_64"
test_build_target "aarch64-unknown-linux-gnu" "Linux aarch64"

# macOS target (only test on macOS, since it can't be cross-compiled from other platforms)
if [[ "$PLATFORM" == "macos" ]]; then
test_build_target "aarch64-apple-darwin" "macOS Apple Silicon"
else
echo -e "${YELLOW}⏭️ Skipping macOS target (requires macOS platform)${NC}"
fi

echo ""
echo "🎉 Build target testing complete!"
echo ""
Expand Down
Loading