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

Fix "cross" configuration for release workflow #14

Merged
merged 10 commits into from
Oct 7, 2022

Conversation

philss
Copy link

@philss philss commented Oct 6, 2022

This is going to install the "libssl-dev" along wigh "openssl" in targets that don't have these packages by default.

It also fix a configuration to pass down the "RUSTLER_NIF_VERSION" env variable to containers building with cross.

Philip Sampaio added 5 commits October 6, 2022 12:34
This is going to install the "libssl-dev" along wigh "openssl" in
targets that don't have these packages by default.

It also fix a configuration to pass down the "RUSTLER_NIF_VERSION" env
variable to containers building with cross.
dpkg --add-architecture $CROSS_DEB_ARCH

apt-get update
apt-get install --assume-yes libssl-dev:$CROSS_DEB_ARCH openssl:$CROSS_DEB_ARCH
Copy link
Member

@jonatanklosko jonatanklosko Oct 6, 2022

Choose a reason for hiding this comment

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

@philss did you successfully build on arm-unknown-linux-gnueabihf and x86_64-unknown-linux-musl? When I tried that it failed for gnueabihf (I think because of cross-rs/cross#1018), while with musl I don't think there's a package available (looking here).

Copy link
Author

Choose a reason for hiding this comment

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

@jonatanklosko I could build for those targets locally. I'm trying to build using the CI.
Did you try to install using the "pre-build" command in the "Cross.toml" file? I also bumped cross version, so maybe this is the reason it worked for me.

Copy link
Member

Choose a reason for hiding this comment

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

That's what I did, but I may have missed something, if you can build then it's great :D

Copy link
Author

Choose a reason for hiding this comment

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

That's what I did, but I may have missed something, if you can build then it's great :D

Oh, I think I got it right now: https://github.com/philss/tokenizers/actions/runs/3198809038. It needs the vendored package for arm-unknown-linux-gnueabihf and x86_64-unknown-linux-musl, and we can't install the package on musl, but that works fine.

Copy link
Author

Choose a reason for hiding this comment

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

@jonatanklosko I think it should work good now.

Copy link
Member

@jonatanklosko jonatanklosko Oct 6, 2022

Choose a reason for hiding this comment

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

Yeah, vendoring definitely works, we can even make it such that this only happens on CI via feature flags:

[dependencies]
# ...
openssl = { version = "0.10", optional = true }

[features]
static_openssl = ["openssl/vendored"]

and cross build ... --features "static_openssl"

This does link openssl statically though.

Copy link
Author

Choose a reason for hiding this comment

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

Good idea! I couldn't avoid vendoring for those targets, so I'm going to add the feature flag.

@@ -9,6 +9,7 @@ env:
ELIXIR_VERSION: 1.13
OTP_VERSION: 24.2
MIX_ENV: test
TOKENIZERS_BUILD: "true"
Copy link
Member

Choose a reason for hiding this comment

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

Do we use this anywhere?

Copy link
Author

Choose a reason for hiding this comment

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

In the "native" module. We want to always force the build in the CI. See:

force_build: System.get_env("TOKENIZERS_BUILD") in ["1", "true"]

@jonatanklosko
Copy link
Member

Looks good to me, thanks @philss! @josevalim let me know if we should roll with this for the release or move downloading to elixir already :)

@josevalim
Copy link
Contributor

If it works, it works. Ship it! :)

Copy link
Member

@jonatanklosko jonatanklosko left a comment

Choose a reason for hiding this comment

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

Sounds good! @seanmor5 @cigrainger you can try a new release whenever :D

Copy link
Contributor

@cigrainger cigrainger left a comment

Choose a reason for hiding this comment

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

Fantastic. Thank you @philss!

@cigrainger cigrainger merged commit fe2f37f into elixir-nx:main Oct 7, 2022
@philss philss deleted the ps-fix-precomp-with-openssl branch October 8, 2022 03:06
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 this pull request may close these issues.

4 participants