~alpine/devel

4 3

RE: rust triples (WAS: Re: Planning for 3.12 feature freeze)

Details
Message ID
<kcEE.jwTbMwvuQKKkHR3apIGq6Q.gNaPvrAJ1gE@srsyg17.sygroup-int.ch>
DKIM signature
missing
Download raw message
Hi

>
> Ok. I still think we should either use `*-unknown-linux` or `*-alpine-linux`
> consistenly only all arches.
>
> I don't know which is to prefer though.
>
> https://gitlab.alpinelinux.org/alpine/aports/issues/11349
>
> -nc
>

My 50 cents. I run x86_64-unknown-linux-musl from rustup. I still have

RUSTFLAGS="-C target-feature=-crt-static"

set. Packages like rocket (web framework) and diesel (ORM) work,
I haven't tried compiling firefox, though. It was planned to create
a triplet $arch-unknown-linux-dynmusl which is meant for hosts running
musl. [1] This hasn't happened yet and instead many bugs have been fixed so
$arch-unknown-linux-musl works as host and not only as a target. It was said,
that they never remove the requirement for -crt-static, because it will
break a lot of build-systems out there, that think $arch-unknown-linux-musl
is only a target for creating static binaries.

[1] https://github.com/rust-lang/rust/issues/59302

So my point is $arch-alpine-linux-musl feels correct. BUT could we just
introduce $arch-unknown-linux-dynmusl? Because if we patch crt-static away
on a rust-build using $arch-unknown-linux-musl, we might break things that
expect crt-static. If packages only look at the middle part *-unknown-linux-*
it might fix most problems. Either way it was a very bad idea to link
crt-static with the triplet.

Let me know if you think creating $arch-unknown-linux-dynmusl rust-build
is worth a try?

Best,
Jean-Louis

Re: rust triples (WAS: Re: Planning for 3.12 feature freeze)

Details
Message ID
<280DD35B-697F-41E2-89E7-7235690B8DD4@shiz.me>
In-Reply-To
<kcEE.jwTbMwvuQKKkHR3apIGq6Q.gNaPvrAJ1gE@srsyg17.sygroup-int.ch> (view parent)
DKIM signature
missing
Download raw message

> On Apr 3, 2 Reiwa, at 14:09, Jean-Louis Fuchs <jean-louis.fuchs@adfinis-sygroup.ch> wrote:
> 
> So my point is $arch-alpine-linux-musl feels correct. BUT could we just
> introduce $arch-unknown-linux-dynmusl? Because if we patch crt-static away
> on a rust-build using $arch-unknown-linux-musl, we might break things that
> expect crt-static.

I think this is a worse solution than making $arch-alpine-linux-musl dynamically linked,
as the author fo said patch, and expect it to break more things than an -alpine- triple
would.

> Either way it was a very bad idea to link crt-static with the triplet.

+1, but that’s sadly how it is for the upstream. I propose we move to $arch-alpine-linux-musl
everywhere and fix any outstanding issues with it. I can help if needed.

- Shiz

Re: rust triples (WAS: Re: Planning for 3.12 feature freeze)

Rasmus Thomsen <oss@cogitri.dev>
Details
Message ID
<015395a531ce48209d8223e1618bf8caca4cd4f8.camel@cogitri.dev>
In-Reply-To
<280DD35B-697F-41E2-89E7-7235690B8DD4@shiz.me> (view parent)
DKIM signature
missing
Download raw message
> Either way it was a very bad idea to link crt-static with the
> > > triplet.
> > 
> > +1, but that’s sadly how it is for the upstream. I propose we move
> to
> > $arch-alpine-linux-musl
> > everywhere and fix any outstanding issues with it. I can help if
> > needed.

That's be greatly appreciated, it didn't find rustc_macros for some
reason for me (I suppose it used crt-static in build for some reason).

Thanks,

Rasmus

Re: rust triples (WAS: Re: Planning for 3.12 feature freeze)

Details
Message ID
<20200403171727.7e4bb42b@ncopa-desktop.copa.dup.pw>
In-Reply-To
<280DD35B-697F-41E2-89E7-7235690B8DD4@shiz.me> (view parent)
DKIM signature
missing
Download raw message
Patch: +5 -5
On Fri, 3 Apr 2020 15:32:18 +0200
Shiz <hi@shiz.me> wrote:

> I propose we move to $arch-alpine-linux-musl everywhere and fix any
> outstanding issues with it. I can help if needed.

I think this would be the cleanest thing to do, however, I don't have
much experience with rust, so help would be appreciated.

I tried to build it on armv7 as a test:

diff --git a/community/rust/APKBUILD b/community/rust/APKBUILD
index bcde30fbd3..3941803500 100644
--- a/community/rust/APKBUILD
+++ b/community/rust/APKBUILD
@@ -7,7 +7,7 @@ pkgname=rust
pkgver=1.42.0
_llvmver=10
_bootver=1.41.1
pkgrel=1
pkgrel=2
pkgdesc="The Rust Programming Language"
url="https://www.rust-lang.org"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le"
@@ -88,10 +88,10 @@ case "$CARCH" in
               _build="i686-unknown-linux-musl"
               _target="$_build"
               ;;
       armv7)
               _build="armv7-unknown-linux-musleabihf"
               _target="$_build"
               ;;
#      armv7)
#              _build="armv7-unknown-linux-musleabihf"
#              _target="$_build"
#              ;;
       armhf)
               _build="arm-unknown-linux-musleabihf"
               _target="$_build"

It manages to build but during `abuild rootpkg` it fails. Apparently due to it needs uses cargo, but the installed cargo does not have an installed stdlib:

  Compiling quote v0.6.12
error[E0461]: couldn't find crate `core` with expected target triple armv7-alpine-linux-musleabihf
 |
 = note: the following crate versions were found:
         crate `core`, target triple armv7-unknown-linux-musleabihf: /usr/lib/rustlib/armv7-unknown-linux-musleabihf/lib/libcore-522d58512672202f.rlib

error[E0461]: couldn't find crate `core` with expected target triple armv7-alpine-linux-musleabihf
 |
 = note: the following crate versions were found:
         crate `core`, target triple armv7-unknown-linux-musleabihf:
         /usr/lib/rustlib/armv7-unknown-linux-musleabihf/lib/libcore-522d58512672202f.rlib

Is there a way to make cargo look into another directory? Or is it better to manually create bootstrap packages?

nc

> 
> - Shiz
>

Re: rust triples (WAS: Re: Planning for 3.12 feature freeze)

Rasmus Thomsen <oss@cogitri.dev>
Details
Message ID
<2a1589a885d5f7e81609ed43dee892555379aff6.camel@cogitri.dev>
In-Reply-To
<20200403171727.7e4bb42b@ncopa-desktop.copa.dup.pw> (view parent)
DKIM signature
missing
Download raw message
On Fri, 2020-04-03 at 17:17 +0200, Natanael Copa wrote:
> On Fri, 3 Apr 2020 15:32:18 +0200
> Shiz <hi@shiz.me> wrote:
> 
> > I propose we move to $arch-alpine-linux-musl everywhere and fix any
> > outstanding issues with it. I can help if needed.
> 
> I think this would be the cleanest thing to do, however, I don't have
> much experience with rust, so help would be appreciated.
> 
> I tried to build it on armv7 as a test:
> 
> diff --git a/community/rust/APKBUILD b/community/rust/APKBUILD
> index bcde30fbd3..3941803500 100644
> --- a/community/rust/APKBUILD
> +++ b/community/rust/APKBUILD
> @@ -7,7 +7,7 @@ pkgname=rust
>  pkgver=1.42.0
>  _llvmver=10
>  _bootver=1.41.1
> -pkgrel=1
> +pkgrel=2
>  pkgdesc="The Rust Programming Language"
>  url="https://www.rust-lang.org"
>  arch="x86_64 armv7 armhf aarch64 x86 ppc64le"
> @@ -88,10 +88,10 @@ case "$CARCH" in
>                 _build="i686-unknown-linux-musl"
>                 _target="$_build"
>                 ;;
> -       armv7)
> -               _build="armv7-unknown-linux-musleabihf"
> -               _target="$_build"
> -               ;;
> +#      armv7)
> +#              _build="armv7-unknown-linux-musleabihf"
> +#              _target="$_build"
> +#              ;;
>         armhf)
>                 _build="arm-unknown-linux-musleabihf"
>                 _target="$_build"
> 
> It manages to build but during `abuild rootpkg` it fails. Apparently
> due to it needs uses cargo, but the installed cargo does not have an
> installed stdlib:
> 
>    Compiling quote v0.6.12
> error[E0461]: couldn't find crate `core` with expected target triple
> armv7-alpine-linux-musleabihf
>   |
>   = note: the following crate versions were found:
>           crate `core`, target triple armv7-unknown-linux-musleabihf: 
> /usr/lib/rustlib/armv7-unknown-linux-musleabihf/lib/libcore-
> 522d58512672202f.rlib
> 
> error[E0461]: couldn't find crate `core` with expected target triple
> armv7-alpine-linux-musleabihf
>   |
>   = note: the following crate versions were found:
>           crate `core`, target triple armv7-unknown-linux-musleabihf:
>           /usr/lib/rustlib/armv7-unknown-linux-
> musleabihf/lib/libcore-522d58512672202f.rlib
> 
> Is there a way to make cargo look into another directory? Or is it
> better to manually create bootstrap packages?
> 
> -nc
> 

When you're switching triplets you would have to only adjust _target in
the first run since you're still building with the old triplet.
Reply to thread Export thread (mbox)