Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some edge cases with IBM / smartOS platforms #114

Closed
refack opened this issue Nov 24, 2018 · 3 comments
Closed

Some edge cases with IBM / smartOS platforms #114

refack opened this issue Nov 24, 2018 · 3 comments

Comments

@refack
Copy link
Contributor

refack commented Nov 24, 2018

I'm trying to migrate node-test-node-addon-api to use NVS (instead of the hand rolled scripts it uses now.

I was able to remove ~100 lines, and get much better flexibility, but I've hit some edge cases:

  1. smartOS - uname -m says 'i86pc' when we want need x64
  2. AIX - uname -m spits out some UID instead of ppc64
  3. ppc-be - supported only by node <= 7 - so NVS can't bootstrap
  4. AIX - tar doesn't like -z

Example trying to test with:
node6 - https://ci.nodejs.org/job/refack-node-test-node-addon-api/23/
node12 - https://ci.nodejs.org/job/refack-node-test-node-addon-api/22/

This is my current monkey patch part on the bootstraping:

# Use NVS for cross platform node install
NODEJS_VERSION="$NODEJS_MAJOR_VERSION"
if [ ${NODEJS_MAJOR_VERSION} -gt "11" ]; then
  NODEJS_VERSION="nightly/$NODEJS_VERSION"
fi

echo "######### solve edge cases for nvs #########"
case $nodes in
  *s390x)
    export LD_LIBRARY_PATH=/data/gcc-4.9/lib64
  ;;
  aix*)
    # we mock uname since the native one with '-m' gives some guid
    echo '#\!bash -xe' > uname
    echo 'if [[ "$1" == "-m" ]]; then echo "ppc64"; else echo "AIX"; fi' >> uname
    chmod 755 uname
    export PATH=$PWD:$PATH
  ;;
  smart*)
    # we mock uname since the native with '-m' one says 'i86pc'
    echo '#\!bash -xe' > uname
    echo 'if [[ "$1" == "-m" ]]; then echo "x64"; else echo "SunOS"; fi' >> uname
    chmod 755 uname
    export PATH=$PWD:$PATH
  ;;
esac

export NVS_USE_XZ=0
export NVS_HOME="$PWD/temp_nvs"
. $NVS_HOME/nvs.sh add $NODEJS_VERSION
nvs use $NODEJS_VERSION

P.S. Had to github-search to find the ability to NVS_USE_XZ=0. Couldn't find documentation for that.

@jasongin
Copy link
Owner

Interesting. I don't have experience with or access to any of these uncommon platforms. Would you be willing to submit a patch to nvs.sh that fixes the uname based platform and arch detection?

@refack
Copy link
Contributor Author

refack commented Nov 27, 2018

Sure. Might take a while, but I'll set a reminder for myself.

@jasongin
Copy link
Owner

Fixed by #169

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 a pull request may close this issue.

2 participants