Skip to content

Commit

Permalink
Merge #2428
Browse files Browse the repository at this point in the history
2428: Don't fail make install if WASMER_INSTALL_PREFIX isn't set r=Hywan a=jcaesar

<!-- 
Prior to submitting a PR, review the CONTRIBUTING.md document for recommendations on how to test:
https://github.com/wasmerio/wasmer/blob/master/CONTRIBUTING.md#pull-requests

-->

# Description
Fixes #2413, also improves PACKAGING.md

Alternatively, I could make it so `make install` errors out with a nice and clean error message if that variable is not set (and tells people that they're not supposed to make install themselves?), or default WASMER_INSTALL_PREFIX to `/usr/local` (at the danger of being missed, resulting in incorrect installs).

# Review
- [ ] Add a short description of the change to the CHANGELOG.md file: Seems like an irrelevant fix - Necessary?


Co-authored-by: Julius Michaelis <[email protected]>
  • Loading branch information
bors[bot] and jcaesar authored Jul 6, 2021
2 parents 24f8fdb + d405de1 commit cdab1b2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,13 @@ install-misc:
install -Dm644 LICENSE "$(DESTDIR)"/share/licenses/wasmer/LICENSE

install-pkgconfig:
unset WASMER_DIR # Make sure WASMER_INSTALL_PREFIX is set during build
target/release/wasmer config --pkg-config | install -Dm644 /dev/stdin "$(DESTDIR)"/lib/pkgconfig/wasmer.pc
# Make sure WASMER_INSTALL_PREFIX is set during build
unset WASMER_DIR; \
if pc="$$(target/release/wasmer config --pkg-config 1>/dev/null 2>/dev/null)"; then \
echo "$$pc" | install -Dm644 /dev/stdin "$(DESTDIR)"/lib/pkgconfig/wasmer.pc; \
else \
echo 1>&2 "WASMER_INSTALL_PREFIX was not set during build, not installing wasmer.pc"; \
fi

install-wasmer-headless-minimal:
install -Dm755 target/release/wasmer-headless $(DESTDIR)/bin/wasmer-headless
Expand Down
4 changes: 3 additions & 1 deletion PACKAGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
with `WASMER_INSTALL_PREFIX`, e.g.:

```sh
$ WASMER_INSTALL_PREFIX=/usr make install
export WASMER_INSTALL_PREFIX=/usr
make
DESTDIR=.../usr make install
```

* In case you must build/install directly with `cargo`, make sure to
Expand Down

0 comments on commit cdab1b2

Please sign in to comment.