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

Cross compile armv7 (for RPI) #584

Merged
merged 15 commits into from
Jan 26, 2019
Merged

Cross compile armv7 (for RPI) #584

merged 15 commits into from
Jan 26, 2019

Conversation

ralphtheninja
Copy link
Member

@ralphtheninja ralphtheninja commented Jan 19, 2019

Lets use this branch to make some cross compiled binaries.

  • Switch to ahdinosaur/prebuildify#master (using specific commit, in case master moves)
  • Switch to vweevers/node-gyp-build#libc-and-arm-flavors
  • Pull in prebuildify-cross
  • Invoke prebuildify-cross for armv7 (raspberry pi)
  • Run it on Travis

@ralphtheninja ralphtheninja self-assigned this Jan 19, 2019
@vweevers vweevers added this to In progress in Level (old board) via automation Jan 19, 2019
@ralphtheninja
Copy link
Member Author

@vweevers
Copy link
Member

Not sure but I do know we gotta do #578 (comment).

@vweevers
Copy link
Member

@ralphtheninja
Copy link
Member Author

The problem is the custom platform, which breaks this line:
https://github.com/ahdinosaur/prebuildify/blob/2e6da5d9f875c8d538806808924480607a5858da/index.js#L138

Hmm ok, so opts.platform is set to something else than 'win32' and we try to run node-gyp instead of node-gyp.cmd?

@vweevers
Copy link
Member

Yea. I don't understand what sets the custom platform though. Maybe AppVeyor defines PLATFORM? 🤔

@ralphtheninja
Copy link
Member Author

So it seems AppVeyor defines PLATFORM as x64 which is used by MSVS. Trying PREBUILD_PLATFORM instead for now.

@ralphtheninja ralphtheninja changed the title [WIP] Temporarily move to master branch of ahdinosaur/prebuildify [WIP] Cross compile armv7 (for RPI) Jan 26, 2019
appveyor.yml Outdated Show resolved Hide resolved
@ralphtheninja
Copy link
Member Author

ralphtheninja commented Jan 26, 2019

@vweevers I'm wondering if we should just squeeze in N number of npm run prebuildify-cross-XYZ in here:

leveldown/.travis.yml

Lines 18 to 20 in 1c90e8f

- ARCHIVE_NAME="${TRAVIS_TAG:-latest}-$TRAVIS_OS_NAME-`uname -m`.tar"
- npm run prebuild
- tar --create --verbose --file="$ARCHIVE_NAME" --directory "$TRAVIS_BUILD_DIR/prebuilds" .

Since we do a single upload of $ARCHIVE_NAME it should work? Should give $ARCHIVE_NAME a better name though.

EDIT: We could just scratch the uname -m thingie.

@ralphtheninja
Copy link
Member Author

Hmm scratch my last comment. We should only try cross compiling on linux, so might need to check os name etc.

@ralphtheninja
Copy link
Member Author

Seems like Travis deploy mechanism doesn't like using an external script. I assume it's because $ARCHIVE_NAME is only defined in the script. Annoying.

@ralphtheninja
Copy link
Member Author

screenshot from 2019-01-26 14-11-28

@ralphtheninja ralphtheninja changed the title [WIP] Cross compile armv7 (for RPI) Cross compile armv7 (for RPI) Jan 26, 2019
@ralphtheninja
Copy link
Member Author

So, given some tweaks needed here and there (releasing prebuildify, prebuildify-cross) this is basically working now.

@staltz
Copy link
Contributor

staltz commented Jan 26, 2019

By the way, even though ARM is being nicely targeted, what about node versions? Node.js on mobile uses Node 8.6.0

package.json Outdated Show resolved Hide resolved
@ralphtheninja
Copy link
Member Author

ralphtheninja commented Jan 26, 2019

By the way, even though ARM is being nicely targeted, what about node versions? Node.js on mobile uses Node 8.6.0

@staltz leveldown is now based on N-api and is future compatible with all node versions starting from v8.6.0. This means we no longer need to target different node versions.

@vweevers
Copy link
Member

@ralphtheninja we can create a proper matrix after this PR (with one job for normal linux, another for cross builds).

@ralphtheninja
Copy link
Member Author

@ralphtheninja we can create a proper matrix after this PR (with one job for normal linux, another for cross builds).

Sounds good. Up for it? 😄

@ralphtheninja
Copy link
Member Author

ralphtheninja commented Jan 26, 2019

@vweevers Once we have the matrix up and running, maybe we should focus on differentiating between different arm versions? E.g. armv7 and armv8 (arm64 arch). Or maybe arm64 will work out of the box, given the prebuilds/${platform}-${arch} folder structure?

@vweevers
Copy link
Member

Once we have the matrix up and running, maybe we should focus on differentiating between different arm versions? E.g. armv7 and armv8 (arm64 arch).

Yeah. We need 1) a PR to prebuildify to add the tagging 2) add tag args here 3) node-gyp-build.

Copy link
Member

@vweevers vweevers left a comment

Choose a reason for hiding this comment

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

Remove - SET

@vweevers
Copy link
Member

Or maybe arm64 will work out of the box, given the prebuilds/${platform}-${arch} folder structure?

That's a good point 😄 It will work at least until we add other armv versions (and maybe that never happens).

@ralphtheninja ralphtheninja merged commit 90b3c54 into master Jan 26, 2019
Level (old board) automation moved this from In progress to Done Jan 26, 2019
@ralphtheninja ralphtheninja deleted the prebuildify-next branch January 26, 2019 16:35
@ralphtheninja
Copy link
Member Author

screenshot from 2019-01-26 18-05-28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants