Skip to content

Conversation

wojiushixiaobai
Copy link

@wojiushixiaobai
Copy link
Author

.github/workflows/build.yml

name: Node.js custom build job

on:
  workflow_dispatch:
    inputs:
      version:
        description: 'Node.js version, e.g. v23.11.0'
        required: true
        default: 'v23.11.0'

jobs:
  build:
    runs-on: ubuntu-latest
    env:
      version: ${{ github.event.inputs.version }}
    strategy:
      matrix:
        os: [ubuntu-24.04, ubuntu-24.04-arm]
        
    steps:
      - uses: actions/checkout@v4
      - uses: docker/setup-buildx-action@v3

      - name: Set Workdir
        run: |
          mkdir -p ${{ github.workspace }}/workdir/staging
          sudo chmod -R 777 ${{ github.workspace }}/workdir/staging
          sudo chown -R 1000:docker ${{ github.workspace }}/workdir/staging

      - name: Build node.js
        run: |
          ./bin/local_build.sh -r musl -v ${{ env.version }} -w ${{ github.workspace }}/workdir

      - name: Upload Artifact
        uses: actions/upload-artifact@v4
        with:
          path: ${{ github.workspace }}/workdir/staging/release/${{ env.version }}/

Copy link

@jameschensmith jameschensmith Apr 4, 2025

Choose a reason for hiding this comment

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

Please feel free to disregard my feedback if it's not applicable. Should the Dockerfile be update to FROM alpine:3.21 based on your comment regarding loongarch64 support in Alpine Linux?

Copy link
Author

Choose a reason for hiding this comment

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

OK, let me correct it.

Comment on lines 16 to 20
alpineArch="$(apk --print-arch)"
case "${alpineArch##*-}" in
riscv64)
config_flags+="--openssl-no-asm"
;;
loongarch64)
# v18.x need, https://github.com/nodejs/node/blob/v18.x/Makefile#L939
make_flags+=" DESTCPU=loong64 ARCH=loong64"
config_flags+="--openssl-no-asm"
;;
esac
Copy link
Member

Choose a reason for hiding this comment

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

Can you tell me what this is trying to do? these builds normally only happen on x64 and we only get a single, stable arch build out of these to publish to unofficial-builds.nodejs.org. We have separate loong64 and riscc64 recipes to handle those cases.

Or are you trying to use this to do local builds for musl on these architectures?

Copy link
Author

Choose a reason for hiding this comment

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

This change allows you to directly run scripts on physical machines of other architectures to build.
This way we don't need to add files for other architectures, such as #157

Copy link
Member

Choose a reason for hiding this comment

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

the problem you're introducing here is that you've removed DESTCPU and ARCH from below and only added them back for loong64.

I think you should consider a few things here:

  1. Set the default DESTCPU and ARCH variables to use below
  2. Override them in loong64
  3. Remove the riscv64 path if you don't need it, let's not leave cruft around
  4. Document why you're doing the arch switch in the first place - like you've explained it here

@shyim
Copy link

shyim commented Sep 6, 2025

Hey,

can we help here in someway to get this merged? I want to install into Alpine specific Node versions this would help a lot :)

Signed-off-by: 吴小白 <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants