Skip to content

Conversation

nrranjithnr
Copy link

Summary

Allow linuxstatic platform builds for ppc64 architecture by bypassing the platform validation check.

Changes

  • Modified the platform validation logic in lib/index.ts to skip the platform mismatch check when building for ppc64 architecture
  • Added && arch !== 'ppc64' condition to allow linuxstatic builds on ppc64 without validation errors

Impact

  • Users can now build linuxstatic binaries for ppc64 architecture without platform validation blocking the process
  • No breaking changes to existing functionality
  • Maintains existing platform validation for other architectures except ppc64

Use Case

This enables building static Linux binaries on ppc64 systems, which is particularly useful for PowerPC environments that need statically linked executables.

@nrranjithnr nrranjithnr changed the title feat: Allow linuxstatic builds for ppc64 architecture Allow linuxstatic builds for ppc64 architecture Oct 2, 2025
@nrranjithnr
Copy link
Author

@robertsLando, could you please take a look at this when you have a moment? Thanks!

@nrranjithnr
Copy link
Author

@robertsLando robertsLando changed the title Allow linuxstatic builds for ppc64 architecture feat: allow linuxstatic builds for ppc64 architecture Oct 3, 2025

if (hostPlatform !== platform) {
if (hostPlatform !== 'alpine' || platform !== 'linuxstatic') {
if ((hostPlatform !== 'alpine' || platform !== 'linuxstatic') && arch !== 'ppc64') {
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if this makes sense, I mean shouldn't you only be able to build ppc64 from a ppc64 arch?

Copy link
Author

Choose a reason for hiding this comment

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

When I run the node24-linuxstatic-ppc64 build on a ppc64 machine, it doesn’t proceed because of this validation. I applied a patch to fix the code and tested it on a ppc64 machine — it worked for linuxstatic. So by default, it should work when running on a ppc64 machine; the only issue is that this validation is blocking it.

Copy link
Author

Choose a reason for hiding this comment

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

[root@rh-rn-pvm test]# pkg --targets node24-linuxstatic-ppc64 --out-dir test/build .
> [email protected]
> Fetching base Node.js binaries to PKG_CACHE_PATH
  fetched-v24.8.0-linuxstatic-ppc64   [                    ] 0%
> Error! 404: Not Found
> Not found in remote cache:
  {"tag":"v3.5","name":"node-v24.8.0-linuxstatic-ppc64"}
> Building base binary from source:
  built-v24.8.0-linuxstatic-ppc64
> Error! Not able to build for 'linuxstatic' here, only for 'linux'
[root@rh-rn-pvm test]# uname -s
Linux
[root@rh-rn-pvm test]# uname -r
4.18.0-553.76.1.el8_10.ppc64le
[root@rh-rn-pvm test]# 

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.

2 participants