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

CI: integrate macOS #519

Open
ChinYikMing opened this issue Dec 15, 2024 · 10 comments
Open

CI: integrate macOS #519

ChinYikMing opened this issue Dec 15, 2024 · 10 comments
Assignees

Comments

@ChinYikMing
Copy link
Collaborator

ChinYikMing commented Dec 15, 2024

The current CI pipeline utilizes Linux-based x86-64 and Aarch64 machines for verification and validation (V&V). To enhance the portability of rv32emu, it is both reasonable and feasible to integrate macOS into the CI pipeline.

@ChinYikMing
Copy link
Collaborator Author

ChinYikMing commented Dec 15, 2024

A simple CI pipeline for system emulation:

...
+macOS:
+    runs-on: macos-latest
+   steps:
+    - uses: actions/checkout@v4
+    - name: install-dependencies
+      run: |
+            brew install make dtc expect
+    - name: boot Linux kernel test
+      run: |
+            make clean && make ENABLE_SYSTEM=1 && make ENABLE_SYSTEM=1 artifact -j$(sysctl -n hw.logicalcpu)
+            .ci/boot-linux.sh
+            make ENABLE_SYSTEM=1 clean
 ...

@ChinYikMing
Copy link
Collaborator Author

ChinYikMing commented Dec 15, 2024

The fetching of the checksum occasionally fails in previous actions(1, 2. 3, ...).

To fully close this issue, the failure should not occur too frequently and the macOS pipeline should be capable of performing V&V for both user and system emulation.

Found at #508

@jserv jserv added this to the release-2024.2 milestone Dec 15, 2024
@ChinYikMing
Copy link
Collaborator Author

The occasional failure could be fixed by #536.

@ChinYikMing ChinYikMing self-assigned this Feb 11, 2025
@ChinYikMing
Copy link
Collaborator Author

ChinYikMing commented Feb 11, 2025

CI breakage on macOS/M1 when running JIT test: CI link

It obviously shown that the function is not called ever. @vacantron Can you check it?

@vacantron
Copy link
Collaborator

vacantron commented Feb 11, 2025

It seems like it's been a long time since the last test on Arm64/MacOS. I'll fix it later.

@ChinYikMing
Copy link
Collaborator Author

I will try to integrate the minimal runnable CI for macOS first.

@ChinYikMing
Copy link
Collaborator Author

Shall we support macOS/Intel? The CI [1] breaks since it expects llvm18 library installed at path /usr/local/opt/ but Makefile detects at path /opt/homebrew/opt/ which is the default path of M series chips, so macOS/M1 runners do not suffer this when running JIT test suite.

Additionally, the behavior of gcc-14 on macOS/M1 does not align to clang, as different errors are displayed in [1], with most of them clearly related to the linker. Will try to fix it and embrace gcc-14 for macOS/M1.

[1] macOS CI breakage

@jserv
Copy link
Contributor

jserv commented Feb 12, 2025

Shall we support macOS/Intel?

Since Apple Silicon (Arm64) has become the predominant hardware platform for macOS, we should focus our CI pipeline on macOS/Arm64 rather than maintaining x64 support.

@yaoyhu
Copy link

yaoyhu commented Feb 12, 2025

uname -m on my M1 Pro Mac returns arm64, not aarch64. This required adding arm64 specific entries to common.mk. Is this the intended configuration, or am I missing a step in the setup process?

diff --git a/mk/common.mk b/mk/common.mk
index 2c721a6..c03dd7e 100644
--- a/mk/common.mk
+++ b/mk/common.mk
@@ -10,6 +10,8 @@ ifeq ($(UNAME_M),x86_64)
     HOST_PLATFORM := x86
 else ifeq ($(UNAME_M),aarch64)
     HOST_PLATFORM := aarch64
+else ifeq ($(UNAME_M),arm64)
+    HOST_PLATFORM := arm64
 else
     $(error Unsupported platform.)
 endif

@jserv
Copy link
Contributor

jserv commented Feb 12, 2025

uname -m on my M1 Pro Mac returns arm64, not aarch64. This required adding arm64 specific entries to common.mk.

Review the master branch, which now includes commit b23860d that adds macOS build support.

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

No branches or pull requests

4 participants