Skip to content

Commit d8aa448

Browse files
committed
attempt to also build mac intel packages
1 parent d1bf645 commit d8aa448

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ jobs:
7878
matrix:
7979
platform:
8080
- arm64
81-
name: Build (darwin)
81+
- x86_64
82+
name: Build (darwin) (${{ matrix.platform }})
8283
outputs:
8384
GEM_VERSION: ${{ steps.set-metadata.outputs.GEM_VERSION }}
8485
runs-on: macos-15-xlarge
@@ -123,10 +124,9 @@ jobs:
123124
run: |
124125
./libexec/inject-libv8 ${{ steps.set-metadata.outputs.NODE_VERSION }}
125126
- name: Test V8 in C++
126-
if: matrix.platform != 'arm64'
127127
run: |
128128
cd test/gtest
129-
cmake -S . -B build
129+
cmake -S . -B build -DCMAKE_OSX_ARCHITECTURES=${{ matrix.platform }}
130130
cd build
131131
cmake --build .
132132
./c_v8_tests
@@ -351,15 +351,15 @@ jobs:
351351
matrix:
352352
platform:
353353
- x86_64
354-
# arm64
355-
name: Test (darwin)
354+
- arm64
355+
name: Test (darwin) (${{ matrix.platform }})
356356
needs: build-darwin
357357
runs-on: macos-15-xlarge
358358
steps:
359359
- name: Set metadata
360360
id: set-metadata
361361
run: |
362-
ruby -e 'puts Gem.platforms.last.to_s.gsub(/-darwin-?\d+/, "-darwin")' | tee gem_platform
362+
echo "${{ matrix.platform }}-darwin" | tee gem_platform
363363
echo "GEM_PLATFORM=$(cat gem_platform)" >> $GITHUB_OUTPUT
364364
- name: Download a single artifact
365365
uses: actions/download-artifact@v4

README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,14 @@ Here's an informal list of platforms we push so far, with equally informal tiers
3232

3333
Tier 0 (CI built and tested):
3434

35-
- x86_64-darwin (17 to 20)
35+
- x86_64-darwin
36+
- arm64-darwin
3637
- x86_64-linux
3738
- x86_64-linux-musl
39+
- aarch64-linux
3840

3941
Tier 1 (manual build and test):
4042

41-
- arm64-darwin (20)
42-
43-
Tier 2 (manual build and test, has known stability issues):
44-
45-
- aarch64-linux
4643
- aarch64-linux-musl
4744

4845
As a fallback, the source gem (`ruby` gem platform) should compile on all Node supported platforms (including e.g. ppc64le or solaris), but we may not have tested it. Help is welcome!
@@ -61,9 +58,9 @@ There is an outstanding issue with rubygems and bundler, where it may misselect
6158

6259
## Versioning
6360

64-
The gem versioning is Node-based, e.g node 15.14.0 gives the gem 15.14.0.0. The last number is an increment for libv8-node fixes. We try as mucha s possible not to include too much changes in such gem fixes, so you can consider these like "patch" in semver.
61+
The gem versioning is Node-based, e.g node 15.14.0 gives the gem 15.14.0.0. The last number is an increment for libv8-node fixes. We try as much as possible not to include too much changes in such gem fixes, so you can consider these like "patch" in semver.
6562

66-
Compared to the `libv8` gem, there is no odd/even scheme, thanks to the intriduction in bundler of the `force_ruby_platform` flag.
63+
Compared to the `libv8` gem, there is no odd/even scheme, thanks to the introduction in bundler of the `force_ruby_platform` flag.
6764

6865
## Requirements
6966

libexec/build-libv8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ fi
4545

4646
if [ "${BUILDTYPE}" = "Release" ] && [ "${GITHUB_ACTIONS}" != "" ]; then
4747
case "${target_platform}" in
48-
arm64*-darwin*)
48+
*-darwin*)
4949
# dwarf debug info for v8 is so massive the macos
5050
# builder runs out of disk space when it's enabled
5151
find out -name '*.mk' -exec sed -i '' -e 's/gdwarf-2/g0/g' {} ';'

test/gtest/CMakeLists.txt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,15 @@ target_link_libraries(
2727
)
2828

2929
string(TOLOWER ${CMAKE_SYSTEM_NAME} system_name)
30-
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} system_arch)
30+
if(APPLE AND CMAKE_OSX_ARCHITECTURES)
31+
string(TOLOWER ${CMAKE_OSX_ARCHITECTURES} system_arch)
32+
else()
33+
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} system_arch)
34+
endif()
35+
36+
if(system_arch STREQUAL "aarch64")
37+
set(system_arch "arm64")
38+
endif()
3139

3240
set(vendor_arch "${system_arch}-${system_name}")
3341

0 commit comments

Comments
 (0)