Skip to content

Commit df2bd0e

Browse files
committed
Merge branch 'Xmader/ci/arm64-build' into chore/upgrade-spidermonkey-to-2d25134
2 parents baca709 + d5eca26 commit df2bd0e

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.github/workflows/test-and-publish.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
fail-fast: false
6161
matrix:
6262
# Use Ubuntu 20.04 / Ubuntu 24.04 / macOS 13 x86_64 / macOS 14 arm64 + Python 3.10 to build SpiderMonkey
63-
os: [ 'ubuntu-20.04', 'ubuntu-24.04', 'macos-13', 'macos-14' ] # macOS 14 runner exclusively runs on M1 hardwares
63+
os: [ 'ubuntu-20.04', 'ubuntu-24.04', 'macos-13', 'macos-14', 'pi' ] # macOS 14 runner exclusively runs on M1 hardwares
6464
# see https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available
6565
python_version: [ '3.10' ]
6666
runs-on: ${{ matrix.os }}
@@ -127,7 +127,7 @@ jobs:
127127
strategy:
128128
fail-fast: false
129129
matrix:
130-
os: [ 'ubuntu-20.04', 'ubuntu-24.04', 'macos-12', 'macos-14', 'windows-2022' ]
130+
os: [ 'ubuntu-20.04', 'ubuntu-24.04', 'macos-12', 'macos-14', 'windows-2022', 'pi' ]
131131
python_version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
132132
exclude:
133133
# actions/setup-python: The version '3.8'/'3.9' with architecture 'arm64' was not found for macOS.
@@ -146,6 +146,9 @@ jobs:
146146
- uses: actions/setup-python@v5
147147
with:
148148
python-version: ${{ matrix.python_version }}
149+
- name: Remove old poetry cache
150+
run: rm -rf ~/.cache/pypoetry
151+
if: ${{ matrix.os == 'pi' }}
149152
- name: Setup Poetry
150153
uses: snok/install-poetry@v1
151154
with:
@@ -162,9 +165,11 @@ jobs:
162165
fi
163166
echo "Installing python deps"
164167
poetry self add "poetry-dynamic-versioning[plugin]"
165-
poetry env use python3 # use the correct Python version we've set up
168+
poetry env use python$PYTHON_VERSION || poetry env use python3 # use the correct Python version we've set up
166169
poetry install --no-root --only=dev
167170
echo "Installed Dependencies"
171+
env:
172+
PYTHON_VERSION: ${{ matrix.python_version }}
168173
- name: Build Docs # only build docs once
169174
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.python_version == '3.11' }}
170175
run: |

setup.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ fi
3434
# Install rust compiler
3535
echo "Installing rust compiler"
3636
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain 1.76
37-
. $HOME/.cargo/env
38-
cargo install cbindgen
37+
CARGO_BIN="$HOME/.cargo/bin/cargo" # also works for Windows. On Windows this equals to %USERPROFILE%\.cargo\bin\cargo
38+
$CARGO_BIN install cbindgen
3939
# Setup Poetry
4040
echo "Installing poetry"
4141
curl -sSL https://install.python-poetry.org | python3 - --version "1.7.1"
4242
if [[ "$OSTYPE" == "msys"* ]]; then # Windows
4343
POETRY_BIN="$APPDATA/Python/Scripts/poetry"
4444
else
45-
POETRY_BIN=`echo ~/.local/bin/poetry` # expand tilde
45+
POETRY_BIN="$HOME/.local/bin/poetry"
4646
fi
4747
$POETRY_BIN self add 'poetry-dynamic-versioning[plugin]'
4848
echo "Done installing dependencies"
@@ -73,7 +73,7 @@ cd js/src
7373
mkdir -p _build
7474
cd _build
7575
mkdir -p ../../../../_spidermonkey_install/
76-
../configure \
76+
../configure --target=$(clang --print-target-triple) \
7777
--prefix=$(realpath $PWD/../../../../_spidermonkey_install) \
7878
--with-intl-api \
7979
$(if [[ "$OSTYPE" != "msys"* ]]; then echo "--without-system-zlib"; fi) \

src/JSObjectProxy.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ bool JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare_helper(JSObjectPr
245245
if (!js::GetPropertyKeys(GLOBAL_CX, *(self->jsObject), JSITER_OWNONLY, &props))
246246
{
247247
PyErr_Format(PyExc_SystemError, "%s JSAPI call failed", JSObjectProxyType.tp_name);
248-
return NULL;
248+
return false;
249249
}
250250

251251
// iterate recursively through members of self and check for equality
@@ -442,7 +442,7 @@ PyObject *JSObjectProxyMethodDefinitions::JSObjectProxy_repr(JSObjectProxy *self
442442
PyErr_Clear();
443443
}
444444

445-
if (_PyUnicodeWriter_WriteASCIIString(&writer, "<cannot repr type>", 19) < 0) {
445+
if (_PyUnicodeWriter_WriteASCIIString(&writer, "<cannot repr type>", 19) < 0) {
446446
goto error;
447447
}
448448
}

0 commit comments

Comments
 (0)