-
Notifications
You must be signed in to change notification settings - Fork 20
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
Install to subdirs #21
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drager
approved these changes
Oct 28, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think it looks good. Just need to figure out why the pipelines were cancelled and I think we're good to go.
It looks like the pipelines are failing with
and
|
Thanks a lot! |
3 tasks
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As discussed in wasm-pack#1163, this PR adds the ability to extract binaries (and libraries) to specific subdirectories, which is needed for dynamic linking on macOS.
Specifically, the macOS tarballs at https://github.com/WebAssembly/binaryen/releases/tag/version_110 contain this folder structure:
To install
wasm-opt
from the tarball, the dynamic linker needs to be able to findlibbinaryen.dylib
at the relative path../lib/libbinaryen.dylib
, so we need to be able to install it to an appropriate subdirectory that mimics the structure in the.tar.gz
file.To implement this, I've added a feature to this crate so that passing the strings
"bin/wasm-opt"
and"lib/libbinaryen.dylib"
to theCache::download
method will extract those files to matching subdirectories inside the cache directory, which can then be invoked as normal withDownload::binary
. This should be fully backwards-compatible since the subdirectories are only created when specifically passed in by the user.This is how this can be used in
wasm-pack
:I've written a working version in this test commit (or this branch), which is based on the wasm-pack#1163 PR. There's some error-handling-related hacks because
wasm-pack
still usesfailure
instead ofanyhow
(which this crate seems to have switched to in 2020, but never released to crates.io?), but apart from that it seems to work well.Make sure these boxes are checked! 📦✅
rustfmt
installedcargo fmt
on the code base before submitting✨✨ 😄 Thanks so much for contributing to binary-install! 😄 ✨✨