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

nushell: update from 0.18.1 to 0.20.0 #5773

Merged
merged 1 commit into from
Sep 29, 2020
Merged

Conversation

finagolfin
Copy link
Member

Work this out on the CI, here we go.

@finagolfin finagolfin added the WIP Work in progress, do not close the issue (PR). label Sep 4, 2020
@finagolfin finagolfin removed the WIP Work in progress, do not close the issue (PR). label Sep 4, 2020
@@ -28,6 +28,9 @@ termux_setup_rust() {
ENV_NAME=${ENV_NAME//-/_}
export $ENV_NAME=$CC
export TARGET_CFLAGS="$CFLAGS $CPPFLAGS"
# This was getting applied for the host build of Rust macros or whatever, so
# unset it.
unset CFLAGS
Copy link
Member Author

Choose a reason for hiding this comment

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

@its-pointless, let me know if this is okay to remove for all crates, as the target flag is set just above and this one was getting picked up by C crates that are built for the host, for macros or whatever, and breaking the build.

Copy link
Member Author

Choose a reason for hiding this comment

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

@xeffyr or @Grimler91, any opinion on removing this flag for all crates that use C code? I believe it was wrong to keep this, but I don't use Rust.

Copy link
Member

Choose a reason for hiding this comment

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

So, without unsetting you were getting build errors during some host compilation for nushell due to unknown flags?

Looks like a reasonable change, but might be a good idea to test build a couple of rust packages after the flag has been unset

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but not unknown, the CI error showed that the problem was these cross-compilation flags wrongly being applied to the host build (see the compiler command used and resulting error).

I don't think testing other Rust packages will show anything, as this would have broken them already, just like the previous version of nushell built fine. The problem only came up when nushell started depending on OpenSSL in this version, and compiling that C crate dependency for the host finally surfaced this bug.

I will try building a few Rust packages anyway though, to make sure.

Copy link
Member Author

Choose a reason for hiding this comment

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

I tried compiling the librsvg, ripgrep, and starship packages with this patch applied, no problem. I will look into a fix for the x86_64 build and then merge.

@its-pointless
Copy link
Contributor

its-pointless commented Sep 8, 2020

It looks like the linker can't find the libc.so in the sysroot at link time. its also using /usr/bin/ld hmmm

or it could be its trying to link against libssl in termux directory for host build instead of usual location.

@finagolfin
Copy link
Member Author

The latter, the host build is being passed the Termux prefix to link against for some reason and fails only for x86_64, since the target arch is the same as the host. It's not because of LDFLAGS, seems to be a cargo bug.

@its-pointless
Copy link
Contributor

i got it working https://github.com/its-pointless/termux-packages/blob/nushell/packages/nushell/build.sh
its a shitty hack but yeah it works.

@finagolfin
Copy link
Member Author

Heh, that's a lot of work to avoid what is probably a cargo problem, passing a cross-compilation sysroot to the host build.

@finagolfin finagolfin changed the title nushell: update again from 0.18.1 to 0.19.0 nushell: update from 0.18.1 to 0.20.0 Sep 29, 2020
…ing issues,

and unset CFLAGS for all crates, as it was getting applied to host builds
@finagolfin
Copy link
Member Author

Alright, might as well get this in, can come back to x86_64 later.

@finagolfin finagolfin merged commit d0d3745 into termux:master Sep 29, 2020
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.

None yet

3 participants