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

Distro packaging improvements #2135

Merged
merged 9 commits into from
Mar 3, 2021
Merged

Distro packaging improvements #2135

merged 9 commits into from
Mar 3, 2021

Conversation

jcaesar
Copy link
Contributor

@jcaesar jcaesar commented Feb 22, 2021

Description

Having installed wasmer from both gentoo and AUR (packaged by svenstaro, an Arch Maintainer), I was stumped to find that both build wasmer without compilers, not actually allowing me to run any wasm. (The AUR PKGBUILD has since been patched, but the gentoo ebuild maintainer… who knows.)

I figured that the obvious improvement would be to deny compilation if not at least one compiler is enabled, but I think more can be done to help packaging. I added

  • a way to set a default for WASMER_DIR at compile time
  • an install target for the Makefile
  • a PACKAGING.md with some suggestions to distro maintainers

Disclaimer: I'm not a package maintainer anywhere, so these might be entirely off the rails. Commit 1 and 2 seem fairly reasonable to me, but for the other two, I'm not so sure.

Review

  • Add a short description of the the change to the CHANGELOG.md file

Copy link
Member

@syrusakbary syrusakbary left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks for the addition!

@syrusakbary
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Feb 25, 2021
2135: Distro packaging improvements r=syrusakbary a=jcaesar

# Description
Having installed wasmer from both gentoo and AUR (packaged by svenstaro, an Arch Maintainer), I was stumped to find that both build wasmer without compilers, not actually allowing me to run any wasm. (The AUR PKGBUILD has since been patched, but the gentoo ebuild maintainer… who knows.)

I figured that the obvious improvement would be to deny compilation if not at least one compiler is enabled, but I think more can be done to help packaging. I added
* a way to set a default for `WASMER_DIR` at compile time
* an install target for the Makefile
* a `PACKAGING.md` with some suggestions to distro maintainers

Disclaimer: I'm not a package maintainer anywhere, so these might be entirely off the rails. Commit 1 and 2 seem fairly reasonable to me, but for the other two, I'm not so sure.

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Julius Michaelis <[email protected]>
@bors
Copy link
Contributor

bors bot commented Feb 25, 2021

Build failed:

@syrusakbary
Copy link
Member

bors r-

Makefile Outdated Show resolved Hide resolved
Comment on lines +681 to +684
install -Dm755 target/release/libwasmer_c_api.so "$(DESTDIR)/lib/libwasmer.so.$$pkgver" && \
ln -sf "libwasmer.so.$$pkgver" "$(DESTDIR)/lib/libwasmer.so.$$shortver" && \
ln -sf "libwasmer.so.$$pkgver" "$(DESTDIR)/lib/libwasmer.so.$$majorver" && \
ln -sf "libwasmer.so.$$pkgver" "$(DESTDIR)/lib/libwasmer.so"
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add a mention that install-capi-lib is for Linux distros only, which excludes Darwin and Windows. A simple documentation line dropped before install-capi-lib would be OK for me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess I could also migrate some parts over from package-capi to support Windows/Darwin, but I have little in the way of testing it.

I'm also not exactly happy with the duplication between package-* and install-*, but I don't think I can smoothly migrate whatever is using package-* to install-*. I'll leave that for someone with more inside knowledge.

Makefile Outdated Show resolved Hide resolved
PACKAGING.md Outdated Show resolved Hide resolved
PACKAGING.md Outdated Show resolved Hide resolved
@Hywan
Copy link
Contributor

Hywan commented Feb 25, 2021

Thank you for the patch, it looks great! I made some feedbacks and found some issues, nothing difficult to fix.

Do you think we could test that in the CI?

@Hywan Hywan self-assigned this Feb 25, 2021
@Hywan Hywan added 🎉 enhancement New feature! 📚 documentation Do you like to read? 🤖 bot Bip bip labels Feb 25, 2021
@jcaesar
Copy link
Contributor Author

jcaesar commented Feb 25, 2021

(I hope to have some time to integrate the suggested fixes this evening...)
Btw, which style of PR ammendment do you prefer? Fixup the old commits, or add new ones so it's easier to review?

@Hywan
Copy link
Contributor

Hywan commented Feb 25, 2021

Just add as many commits as you want for the moment, we will see at the end :-).

@jcaesar
Copy link
Contributor Author

jcaesar commented Feb 26, 2021

All right. Want to give bors another spin then? I think it might pass now.

@syrusakbary
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 26, 2021

👎 Rejected by code reviews

@syrusakbary
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 26, 2021

👎 Rejected by code reviews

Copy link
Contributor

@Hywan Hywan left a comment

Choose a reason for hiding this comment

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

I think it's good now!

@Hywan
Copy link
Contributor

Hywan commented Feb 26, 2021

bors r+

bors bot added a commit that referenced this pull request Feb 26, 2021
2135: Distro packaging improvements r=Hywan a=jcaesar

# Description
Having installed wasmer from both gentoo and AUR (packaged by svenstaro, an Arch Maintainer), I was stumped to find that both build wasmer without compilers, not actually allowing me to run any wasm. (The AUR PKGBUILD has since been patched, but the gentoo ebuild maintainer… who knows.)

I figured that the obvious improvement would be to deny compilation if not at least one compiler is enabled, but I think more can be done to help packaging. I added
* a way to set a default for `WASMER_DIR` at compile time
* an install target for the Makefile
* a `PACKAGING.md` with some suggestions to distro maintainers

Disclaimer: I'm not a package maintainer anywhere, so these might be entirely off the rails. Commit 1 and 2 seem fairly reasonable to me, but for the other two, I'm not so sure.

# Review

- [ ] Add a short description of the the change to the CHANGELOG.md file


Co-authored-by: Julius Michaelis <[email protected]>
Co-authored-by: Ivan Enderlin <[email protected]>
@bors
Copy link
Contributor

bors bot commented Feb 26, 2021

Build failed:

@@ -678,7 +719,7 @@ lint-packages:
RUSTFLAGS=${RUSTFLAGS} cargo clippy -p wasmer-compiler
RUSTFLAGS=${RUSTFLAGS} cargo clippy -p wasmer-compiler-cranelift
RUSTFLAGS=${RUSTFLAGS} cargo clippy -p wasmer-compiler-singlepass
RUSTFLAGS=${RUSTFLAGS} cargo clippy -p wasmer-cli
RUSTFLAGS=${RUSTFLAGS} cargo clippy --manifest-path lib/cli/Cargo.toml $(compiler_features)
Copy link
Contributor

Choose a reason for hiding this comment

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

Since LLVM is likely to be part of $(compiler_features) set, the Lint workflow in the CI must install LLVM now.

Copy link
Contributor Author

@jcaesar jcaesar Mar 1, 2021

Choose a reason for hiding this comment

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

I see. I guess I'll add that to the CI setup. There actually was one problem in the code that would have been caught by linting with all compilers on. Should I additionally keep the "lint with all off"?

Copy link
Contributor

Choose a reason for hiding this comment

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

I reckon we should keep the Lints as they are in master for the moment, and open another PR or a new issue to update them so that they include $(compiler_features) (which makes sense!).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's not an option, as compiling without any compiler_features will fail. But I guess I could temporarily remove linting wasmer-cli and do another PR? Dangerous...

@jcaesar jcaesar force-pushed the distro branch 4 times, most recently from 5284dc4 to 4885b7c Compare March 1, 2021 08:34
@Hywan
Copy link
Contributor

Hywan commented Mar 1, 2021

bors try

@jcaesar
Copy link
Contributor Author

jcaesar commented Mar 1, 2021

Sorry, my push missed the "bors try" by about 90 seconds. Took me some force-pushing to get installing llvm right, but lint should work now.

@MarkMcCaskey
Copy link
Contributor

bors try

@bors
Copy link
Contributor

bors bot commented Mar 1, 2021

try

Already running a review

@syrusakbary
Copy link
Member

bors try

@bors
Copy link
Contributor

bors bot commented Mar 3, 2021

try

Already running a review

@syrusakbary
Copy link
Member

bors try-

@syrusakbary
Copy link
Member

bors try

@jcaesar
Copy link
Contributor Author

jcaesar commented Mar 3, 2021

Maybe bors will be happy if you "bors r-" "bors r+" it once? Or, if it is bugging around, I can also close this pr and reopen with the same commits...

@syrusakbary
Copy link
Member

bors r-

@syrusakbary
Copy link
Member

bors try-

@syrusakbary
Copy link
Member

bors r+

@syrusakbary
Copy link
Member

I'll merge manually and see if tests pass later or not. Bors seems broken

@syrusakbary syrusakbary merged commit 1ee7b4a into wasmerio:master Mar 3, 2021
@jcaesar jcaesar deleted the distro branch March 3, 2021 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖 bot Bip bip 📚 documentation Do you like to read? 🎉 enhancement New feature!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants