Skip to content

Build Python Runtime #121

Build Python Runtime

Build Python Runtime #121

name: Build Python Runtime
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-22.04
name: build Python runtime
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Setup Linux
if: runner.os == 'Linux'
run: |
export DEBIAN_FRONTEND=noninteractive
wget https://apt.llvm.org/llvm.sh
sed -i '/apt-get install/d' llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
sudo apt-get install -y --no-install-recommends clang-18 lld-18 libunwind-18 libc++abi1-18 libc++1-18 libc++-18-dev
echo "build:linux --action_env=CC=/usr/lib/llvm-18/bin/clang" >> .bazelrc
echo "build:linux --host_action_env=CC=/usr/lib/llvm-18/bin/clang" >> .bazelrc
- name: Configure download mirrors
shell: bash
run: |
if [ ! -z "${{ secrets.WORKERS_MIRROR_URL }}" ] ; then
# Strip comment in front of WORKERS_MIRROR_URL, then substitute secret to use it.
sed -e '/WORKERS_MIRROR_URL/ { s@# *@@; s@WORKERS_MIRROR_URL@${{ secrets.WORKERS_MIRROR_URL }}@; }' -i.bak WORKSPACE
fi
- name: Build and upload Pyodide capnproto bundle
env:
R2_ACCOUNT_ID: ${{ secrets.PYODIDE_CAPNP_R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.PYODIDE_CAPNP_R2_ACCESS_KEY_ID }}
R2_SECRET_ACCESS_KEY: ${{ secrets.PYODIDE_CAPNP_R2_SECRET_ACCESS_KEY }}
run: |
bazel build @workerd//src/pyodide:python_bundles @workerd//src/pyodide:bundle_version_info --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev
# boto3 v1.36.0 fails with:
# NotImplemented error occurred in CreateMultipartUpload operation: Header 'x-amz-checksum-algorithm' with value 'CRC32' not implemented
pip install 'boto3<1.36.0'
python3 src/pyodide/upload_bundles.py