* Build Mesa with a different toolchain version
@ 2021-06-02 0:46 Thiago Jung Bauermann
2021-06-02 1:53 ` Thiago Jung Bauermann
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Thiago Jung Bauermann @ 2021-06-02 0:46 UTC (permalink / raw)
To: help-guix
Hello,
I'm having and issue with Mesa on i686-linux which I suspect is caused by
the version of GCC used to build it (i.e. 7.5.0).
To test my theory, I'm trying to build Mesa with a newer version of the
compiler. I tried a few different things, but none worked. I would be
grateful if someone could help me figure out how to do this:
Try #1:
$ guix build --system=i686-linux \
--with-input=gcc-toolchain=gcc-toolchain@10.3.0 mesa
[…]
successfully built /gnu/store/bg01dw0178yb7v9xr4zmq5f05200f2ql-mesa-20.2.4.drv
/gnu/store/mvy7pl73yqrd9pi3k3xq14i6dmnfbl8s-mesa-20.2.4-bin
/gnu/store/ii8fbly1s19qwpnwv002fd2pxk2h96ba-mesa-20.2.4
So aparently it worked. But when checking the libraries, they still
link to GCC 7.5.0.
$ ldd /gnu/store/ii8fbly1s19qwpnwv002fd2pxk2h96ba-mesa-20.2.4/lib/libOSMesa.so.8.0.0 | grep gcc
libstdc++.so.6 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libstdc++.so.6 (0xf51d9000)
libgcc_s.so.1 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libgcc_s.so.1 (0xf50b9000)
And surprisingly, when changing the requested gcc-toolchain version,
guix doesn't attempt to build anything and just returns the same
store items from the “10.3.0” build:
$ guix build --system=i686-linux --with-input=gcc-toolchain=gcc-toolchain@11.1.0 mesa
/gnu/store/mvy7pl73yqrd9pi3k3xq14i6dmnfbl8s-mesa-20.2.4-bin
/gnu/store/ii8fbly1s19qwpnwv002fd2pxk2h96ba-mesa-20.2.4
Try #2:
Next, I tried using ‘package-input-rewriting’ by putting the following
package definition in a channel I created locally (with the appropriate
‘#:use-module’ directives at the top):
```
(define gcc->gcc-10
(package-input-rewriting `((,gcc . ,gcc-10)
(,(make-libstdc++ gcc) . ,(make-libstdc++ gcc-10)))))
(define-public mesa-10
(package
(inherit (gcc->gcc-10 mesa))
(name "mesa-10")))
```
And then:
$ guix pull && guix build --system=i686-linux mesa-10
[…]
successfully built /gnu/store/g4j9kmxgp6lashyipcydn7i6vh2v4s3c-mesa-10-20.2.4.drv
/gnu/store/8iiwn9cnjlfxfi7m1fmdavzgr7y38vv7-mesa-10-20.2.4-bin
/gnu/store/hjci6cqw76hvdawdl04kjmbajklsdwx2-mesa-10-20.2.4
And unfortunately I saw many GCC 7.5.0 processes in the build, for example
(command line abridged because it's too big):
$ pgrep -u guixbuilder01 -a -f cc1
119240 /gnu/store/…-gcc-7.5.0/libexec/gcc/i686-unknown-linux-gnu/7.5.0/cc1 […]
And indeed, still linked to GCC 7.5.0 libraries:
$ ldd /gnu/store/hjci6cqw76hvdawdl04kjmbajklsdwx2-mesa-10-20.2.4/lib/libOSMesa.so.8.0.0 | grep gcc
libstdc++.so.6 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libstdc++.so.6 (0xf51ff000)
libgcc_s.so.1 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libgcc_s.so.1 (0xf50df000)
Also tried using GCC 11 by doing `s/-10/-11/g` in the code I quoted above
and building again:
$ guix build --system=i686-linux mesa-11
[…]
successfully built /gnu/store/vnmwibfpsw3fkm7q7y6z4r5273ri4qra-mesa-11-20.2.4.drv
/gnu/store/w5l307c1vnsik5h1zd9bcjzld2yp6xyl-mesa-11-20.2.4-bin
/gnu/store/l98bxwa5psb3yx56hhb78zr043s10p7q-mesa-11-20.2.4
At least this time it redoes the build instead of just returning the same
store items, but I still see the GCC 7.5.0 processes during the build:
$ pgrep -u guixbuilder01 -a -f cc1
127514 /gnu/store/…-gcc-7.5.0/libexec/gcc/i686-unknown-linux-gnu/7.5.0/cc1 […]
And again, linked with GCC 7.5.0 libraries:
$ ldd /gnu/store/l98bxwa5psb3yx56hhb78zr043s10p7q-mesa-11-20.2.4/lib/libOSMesa.so.8.0.0 | grep gcc
libstdc++.so.6 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libstdc++.so.6 (0xf51e4000)
libgcc_s.so.1 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libgcc_s.so.1 (0xf50c4000)
--
Thanks,
Thiago
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Build Mesa with a different toolchain version
2021-06-02 0:46 Build Mesa with a different toolchain version Thiago Jung Bauermann
@ 2021-06-02 1:53 ` Thiago Jung Bauermann
2021-06-02 9:44 ` Tobias Geerinckx-Rice
2021-06-02 9:22 ` Efraim Flashner
2021-06-02 9:42 ` Tobias Geerinckx-Rice
2 siblings, 1 reply; 9+ messages in thread
From: Thiago Jung Bauermann @ 2021-06-02 1:53 UTC (permalink / raw)
To: help-guix
After sending the email, I thought of another thing to try, but it didn't
help. I thought I'd mention it here for completeness:
Try #3:
Using this definition in my local channel:
```
(define gcc->gcc-10
(package-input-rewriting `((,gcc-7 . ,gcc-10)
(,(make-libstdc++ gcc-7) . ,(make-libstdc++ gcc-10)))))
(define-public mesa-10
(package
(inherit (gcc->gcc-10 mesa))
(name "mesa-10")))
```
i.e., the only change relative to the previous try was to look for ‘gcc-7’
rather than ‘gcc’ to make the substitution.
But unfortunately guix build didn't even try to rebuild the package.
It just returned the store items that were built in try #2:
$ guix build --system=i686-linux mesa-10
/gnu/store/8iiwn9cnjlfxfi7m1fmdavzgr7y38vv7-mesa-10-20.2.4-bin
/gnu/store/hjci6cqw76hvdawdl04kjmbajklsdwx2-mesa-10-20.2.4
I believe this shows that ‘gcc’ already points to ‘gcc-7’. I just can't
change it for some reason…
--
Thanks,
Thiago
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Build Mesa with a different toolchain version
2021-06-02 0:46 Build Mesa with a different toolchain version Thiago Jung Bauermann
2021-06-02 1:53 ` Thiago Jung Bauermann
@ 2021-06-02 9:22 ` Efraim Flashner
2021-06-03 5:14 ` Thiago Jung Bauermann
2021-06-02 9:42 ` Tobias Geerinckx-Rice
2 siblings, 1 reply; 9+ messages in thread
From: Efraim Flashner @ 2021-06-02 9:22 UTC (permalink / raw)
To: Thiago Jung Bauermann; +Cc: help-guix
[-- Attachment #1: Type: text/plain, Size: 5129 bytes --]
On Tue, Jun 01, 2021 at 09:46:56PM -0300, Thiago Jung Bauermann wrote:
> Hello,
>
> I'm having and issue with Mesa on i686-linux which I suspect is caused by
> the version of GCC used to build it (i.e. 7.5.0).
>
> To test my theory, I'm trying to build Mesa with a newer version of the
> compiler. I tried a few different things, but none worked. I would be
> grateful if someone could help me figure out how to do this:
>
> Try #1:
>
> $ guix build --system=i686-linux \
> --with-input=gcc-toolchain=gcc-toolchain@10.3.0 mesa
I believe you have the wrong command here. What you want is
$ guix build --system=i686-linux \
--with-c-toolchain=mesa=gcc-toolchain@10 mesa
$ guix gc --references /gnu/store/8klhnfd8a5syhfl3bj2zqc06fvxiqdwa-mesa-20.2.4 | grep gcc
/gnu/store/nyxr5cb88x18mnhj88zkd9yisdlnxhl2-gcc-toolchain-10.3.0
/gnu/store/rgj02zlyqrg7ygcynwv8w35nc5czxi9l-gcc-10.3.0-lib
$ guix environment --ad-hoc gcc-toolchain -- ldd /gnu/store/8klhnfd8a5syhfl3bj2zqc06fvxiqdwa-mesa-20.2.4/lib/libOSMesa.so.8.0.0 | grep gcc
libstdc++.so.6 => /gnu/store/rgj02zlyqrg7ygcynwv8w35nc5czxi9l-gcc-10.3.0-lib/lib/libstdc++.so.6 (0x00007ff4c0b28000)
libgcc_s.so.1 => /gnu/store/rgj02zlyqrg7ygcynwv8w35nc5czxi9l-gcc-10.3.0-lib/lib/libgcc_s.so.1 (0x00007ff4c09cb000)
> […]
> successfully built /gnu/store/bg01dw0178yb7v9xr4zmq5f05200f2ql-mesa-20.2.4.drv
> /gnu/store/mvy7pl73yqrd9pi3k3xq14i6dmnfbl8s-mesa-20.2.4-bin
> /gnu/store/ii8fbly1s19qwpnwv002fd2pxk2h96ba-mesa-20.2.4
>
> So aparently it worked. But when checking the libraries, they still
> link to GCC 7.5.0.
>
> $ ldd /gnu/store/ii8fbly1s19qwpnwv002fd2pxk2h96ba-mesa-20.2.4/lib/libOSMesa.so.8.0.0 | grep gcc
> libstdc++.so.6 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libstdc++.so.6 (0xf51d9000)
> libgcc_s.so.1 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libgcc_s.so.1 (0xf50b9000)
>
> And surprisingly, when changing the requested gcc-toolchain version,
> guix doesn't attempt to build anything and just returns the same
> store items from the “10.3.0” build:
>
> $ guix build --system=i686-linux --with-input=gcc-toolchain=gcc-toolchain@11.1.0 mesa
> /gnu/store/mvy7pl73yqrd9pi3k3xq14i6dmnfbl8s-mesa-20.2.4-bin
> /gnu/store/ii8fbly1s19qwpnwv002fd2pxk2h96ba-mesa-20.2.4
>
> Try #2:
>
> Next, I tried using ‘package-input-rewriting’ by putting the following
> package definition in a channel I created locally (with the appropriate
> ‘#:use-module’ directives at the top):
>
> ```
> (define gcc->gcc-10
> (package-input-rewriting `((,gcc . ,gcc-10)
> (,(make-libstdc++ gcc) . ,(make-libstdc++ gcc-10)))))
>
> (define-public mesa-10
> (package
> (inherit (gcc->gcc-10 mesa))
> (name "mesa-10")))
> ```
>
> And then:
>
> $ guix pull && guix build --system=i686-linux mesa-10
> […]
> successfully built /gnu/store/g4j9kmxgp6lashyipcydn7i6vh2v4s3c-mesa-10-20.2.4.drv
> /gnu/store/8iiwn9cnjlfxfi7m1fmdavzgr7y38vv7-mesa-10-20.2.4-bin
> /gnu/store/hjci6cqw76hvdawdl04kjmbajklsdwx2-mesa-10-20.2.4
>
> And unfortunately I saw many GCC 7.5.0 processes in the build, for example
> (command line abridged because it's too big):
>
> $ pgrep -u guixbuilder01 -a -f cc1
> 119240 /gnu/store/…-gcc-7.5.0/libexec/gcc/i686-unknown-linux-gnu/7.5.0/cc1 […]
>
> And indeed, still linked to GCC 7.5.0 libraries:
>
> $ ldd /gnu/store/hjci6cqw76hvdawdl04kjmbajklsdwx2-mesa-10-20.2.4/lib/libOSMesa.so.8.0.0 | grep gcc
> libstdc++.so.6 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libstdc++.so.6 (0xf51ff000)
> libgcc_s.so.1 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libgcc_s.so.1 (0xf50df000)
>
> Also tried using GCC 11 by doing `s/-10/-11/g` in the code I quoted above
> and building again:
>
> $ guix build --system=i686-linux mesa-11
> […]
> successfully built /gnu/store/vnmwibfpsw3fkm7q7y6z4r5273ri4qra-mesa-11-20.2.4.drv
> /gnu/store/w5l307c1vnsik5h1zd9bcjzld2yp6xyl-mesa-11-20.2.4-bin
> /gnu/store/l98bxwa5psb3yx56hhb78zr043s10p7q-mesa-11-20.2.4
>
> At least this time it redoes the build instead of just returning the same
> store items, but I still see the GCC 7.5.0 processes during the build:
>
> $ pgrep -u guixbuilder01 -a -f cc1
> 127514 /gnu/store/…-gcc-7.5.0/libexec/gcc/i686-unknown-linux-gnu/7.5.0/cc1 […]
>
> And again, linked with GCC 7.5.0 libraries:
>
> $ ldd /gnu/store/l98bxwa5psb3yx56hhb78zr043s10p7q-mesa-11-20.2.4/lib/libOSMesa.so.8.0.0 | grep gcc
> libstdc++.so.6 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libstdc++.so.6 (0xf51e4000)
> libgcc_s.so.1 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libgcc_s.so.1 (0xf50c4000)
>
> --
> Thanks,
> Thiago
>
>
>
>
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Build Mesa with a different toolchain version
2021-06-02 0:46 Build Mesa with a different toolchain version Thiago Jung Bauermann
2021-06-02 1:53 ` Thiago Jung Bauermann
2021-06-02 9:22 ` Efraim Flashner
@ 2021-06-02 9:42 ` Tobias Geerinckx-Rice
2021-06-02 11:13 ` Tobias Geerinckx-Rice
2021-06-03 5:17 ` Thiago Jung Bauermann
2 siblings, 2 replies; 9+ messages in thread
From: Tobias Geerinckx-Rice @ 2021-06-02 9:42 UTC (permalink / raw)
To: Thiago Jung Bauermann; +Cc: help-guix
[-- Attachment #1: Type: text/plain, Size: 2564 bytes --]
Thiago,
Thiago Jung Bauermann 写道:
> $ guix build --system=i686-linux \
> --with-input=gcc-toolchain=gcc-toolchain@10.3.0 mesa
> […]
> successfully built
> /gnu/store/bg01dw0178yb7v9xr4zmq5f05200f2ql-mesa-20.2.4.drv
> /gnu/store/mvy7pl73yqrd9pi3k3xq14i6dmnfbl8s-mesa-20.2.4-bin
> /gnu/store/ii8fbly1s19qwpnwv002fd2pxk2h96ba-mesa-20.2.4
--with-input=gcc-toolchain=… is a no-op: no package has a
‘gcc-toolchain’ input.
It exists only because people kept installing the ‘unwrapped’ (now
hidden) GCC package with ‘guix install gcc’ and expecting a
working compiler. gcc-toolchain wraps the entire toolchain so ‘$
gcc my.c’ produces working binaries. It is not used internally by
Guix.
> So aparently it worked.
It worked in the sense that the package was built successfully
with gcc@7.5. If your undescribed issue was a build issue, it's
not deterministic. If it's a run-time bug, whatever it is will
still happen.
> And surprisingly, when changing the requested gcc-toolchain
> version,
> guix doesn't attempt to build anything and just returns the same
> store items from the “10.3.0” build:
It's not surprising, it's proof that your transformation's a
no-op. Guix is very good at hashing changes; it doesn't ‘miss’ or
cache stale things.
Two things that work (but read both):
~$ guix build --with-input=gcc=gcc@10 mesa
guix build: package 'gcc' has been superseded by 'gcc-toolchain'
Is this why you tried =gcc-toolchain= above? :-) The hint isn't
relevant in this edge case, you can ignore it for once.
I've included this option because it's the working variant of your
first command. However, it rebuilds the *entire* dependency chain
of Mesa with GCC 10: glibc, bash, ed, python-minimal, guile…
It's cool that Guix makes this task so easy, but you probably want
just
~$ guix build --with-c-toolchain=mesa=gcc-toolchain@10 mesa
This special-case option will do the right things to rebuild
(only) mesa with the toolchain of your choice. Note the =mesa=
difference in syntax: the package you want to rebuild, not the one
you want to replace:
[…]
C compiler for the host machine: gcc (gcc 10.3.0 "gcc (GCC)
10.3.0")
C linker for the host machine: gcc ld.bfd 2.34
C++ compiler for the host machine: c++ (gcc 10.3.0 "c++ (GCC)
10.3.0")
C++ linker for the host machine: c++ ld.bfd 2.34
[…]
Not a user of PACKAGE-INPUT-REWRITING so I'll leave that to
someone else.
Kind regards,
T G-R
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Build Mesa with a different toolchain version
2021-06-02 1:53 ` Thiago Jung Bauermann
@ 2021-06-02 9:44 ` Tobias Geerinckx-Rice
0 siblings, 0 replies; 9+ messages in thread
From: Tobias Geerinckx-Rice @ 2021-06-02 9:44 UTC (permalink / raw)
To: Thiago Jung Bauermann; +Cc: help-guix
[-- Attachment #1: Type: text/plain, Size: 638 bytes --]
Thiago Jung Bauermann 写道:
> (define gcc->gcc-10
> (package-input-rewriting `((,gcc-7 . ,gcc-10)
> (,(make-libstdc++ gcc-7)
> . ,(make-libstdc++ gcc-10)))))
>
> (define-public mesa-10
> (package
> (inherit (gcc->gcc-10 mesa))
> (name "mesa-10")))
> ```
>
> i.e., the only change relative to the previous try was to look
> for ‘gcc-7’
> rather than ‘gcc’ to make the substitution.
This might be because GCC & friends are implicit inputs brought in
through the build system, not listed by the package itself.
Kind regards,
T G-R
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Build Mesa with a different toolchain version
2021-06-02 9:42 ` Tobias Geerinckx-Rice
@ 2021-06-02 11:13 ` Tobias Geerinckx-Rice
2021-06-03 5:35 ` Thiago Jung Bauermann
2021-06-03 5:17 ` Thiago Jung Bauermann
1 sibling, 1 reply; 9+ messages in thread
From: Tobias Geerinckx-Rice @ 2021-06-02 11:13 UTC (permalink / raw)
Cc: Thiago Jung Bauermann, help-guix
[-- Attachment #1: Type: text/plain, Size: 560 bytes --]
Two notes after a calming walk in the woods:
Tobias Geerinckx-Rice 写道:
> no package has a ‘gcc-toolchain’ input.
Not true: 2 do. I meant that ‘the toolchain’ used to build
everything…
> It is not used internally by Guix.
…is not the "gcc-toolchain" package as such.
> (package (inherit gcc->gcc-10 mesa) …)
Just turn it around:
(define-public mesa/gcc-10
(package
(inherit mesa)
(native-inputs
`(("gcc" ,gcc-10)
,@(package-native-inputs mesa)))))
Kind regards,
T G-R
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 243 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Build Mesa with a different toolchain version
2021-06-02 9:22 ` Efraim Flashner
@ 2021-06-03 5:14 ` Thiago Jung Bauermann
0 siblings, 0 replies; 9+ messages in thread
From: Thiago Jung Bauermann @ 2021-06-03 5:14 UTC (permalink / raw)
To: help-guix
Hi,
Thank you for your response.
Em quarta-feira, 2 de junho de 2021, às 06:22:48 -03, Efraim Flashner escreveu:
> On Tue, Jun 01, 2021 at 09:46:56PM -0300, Thiago Jung Bauermann wrote:
> > Hello,
> >
> > I'm having and issue with Mesa on i686-linux which I suspect is caused
> > by the version of GCC used to build it (i.e. 7.5.0).
> >
> > To test my theory, I'm trying to build Mesa with a newer version of the
> > compiler. I tried a few different things, but none worked. I would be
> > grateful if someone could help me figure out how to do this:
> >
> > Try #1:
> >
> > $ guix build --system=i686-linux \
> >
> > --with-input=gcc-toolchain=gcc-toolchain@10.3.0 mesa
>
> I believe you have the wrong command here. What you want is
> $ guix build --system=i686-linux \
> --with-c-toolchain=mesa=gcc-toolchain@10 mesa
Thanks, that worked! I read most of the Guix manual, but I had forgotten
about the `--with-c-toolchain` option. Searching for it in the manual
also made me find the `package-with-c-toolchain` function, which does
the same thing from Scheme code.
Though there’s something weird about Mesa’s build process. Different
libraries end up linked to different GCC versions. :-/
$ guix build --system=i686-linux --with-c-toolchain=mesa=gcc-toolchain@10 mesa
[…]
successfully built /gnu/store/59mczv3gwq3bnnw2jqcj8vqimihqi6c1-mesa-20.2.4.drv
/gnu/store/8zlcwhd10nj2kv56ip5cgf5rg7523yvm-mesa-20.2.4-bin
/gnu/store/5w54z00fldvgdknn06xp66irqslhp6ff-mesa-20.2.4
$ ldd /gnu/store/5w54z00fldvgdknn06xp66irqslhp6ff-mesa-20.2.4/lib/libOSMesa.so.8.0.0 G gcc
libstdc++.so.6 => /gnu/store/92p8kxb6a5xpdi6srb8cj71fggqpkmjk-gcc-10.3.0-lib/lib/libstdc++.so.6 (0xf52e7000)
libgcc_s.so.1 => /gnu/store/92p8kxb6a5xpdi6srb8cj71fggqpkmjk-gcc-10.3.0-lib/lib/libgcc_s.so.1 (0xf51c6000)
$ ldd /gnu/store/5w54z00fldvgdknn06xp66irqslhp6ff-mesa-20.2.4/lib/libGL.so.1.2.0 G gcc
libgcc_s.so.1 => /gnu/store/1527570cy2g7ld4wppmh3skvi27kvm43-gcc-7.5.0-lib/lib/libgcc_s.so.1 (0xf78ed000)
Also the 32-bit game I’m trying to run somehow gets linked to different
Mesa builds too:
libGL.so.1 => /gnu/store/27yzdsj09mm3ijj4zhikcgjjqjlr74yc-mesa-20.2.4/lib/libGL.so.1 (0xf71a9000)
libgbm.so.1 => /gnu/store/6k4wj4472nbws2z4fqy1qmnp07say5x7-mesa-20.2.4/lib/libgbm.so.1 (0xf66c5000)
libglapi.so.0 => /gnu/store/27yzdsj09mm3ijj4zhikcgjjqjlr74yc-mesa-20.2.4/lib/libglapi.so.0 (0xf6621000)
The 27yz… build is the GCC 10.3.0 one, and 6k4wj… is the GCC 7.5.0 one.
Perhaps my time would be better spent trying to help get ‘core-updates’
in shape rather than trying to work around a 4 years old compiler bug¹.
--
Thanks,
Thiago
¹ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=866354 – the bug is
in armel, but I’m getting the exact same error message in Mesa, so I
suspect it also affects i686.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Build Mesa with a different toolchain version
2021-06-02 9:42 ` Tobias Geerinckx-Rice
2021-06-02 11:13 ` Tobias Geerinckx-Rice
@ 2021-06-03 5:17 ` Thiago Jung Bauermann
1 sibling, 0 replies; 9+ messages in thread
From: Thiago Jung Bauermann @ 2021-06-03 5:17 UTC (permalink / raw)
To: Tobias Geerinckx-Rice; +Cc: help-guix
Hello,
Thank you for your response.
Em quarta-feira, 2 de junho de 2021, às 06:42:41 -03, Tobias Geerinckx-Rice
escreveu:
> Thiago,
>
> Thiago Jung Bauermann 写道:
>
> > $ guix build --system=i686-linux \
> >
> > --with-input=gcc-toolchain=gcc-toolchain@10.3.0 mesa
> >
> > […]
> > successfully built
> > /gnu/store/bg01dw0178yb7v9xr4zmq5f05200f2ql-mesa-20.2.4.drv
> > /gnu/store/mvy7pl73yqrd9pi3k3xq14i6dmnfbl8s-mesa-20.2.4-bin
> > /gnu/store/ii8fbly1s19qwpnwv002fd2pxk2h96ba-mesa-20.2.4
>
> --with-input=gcc-toolchain=… is a no-op: no package has a
> ‘gcc-toolchain’ input.
>
> It exists only because people kept installing the ‘unwrapped’ (now
> hidden) GCC package with ‘guix install gcc’ and expecting a
> working compiler. gcc-toolchain wraps the entire toolchain so ‘$
> gcc my.c’ produces working binaries. It is not used internally by
> Guix.
Ah! Thanks for the information. I didn’t have a clear picture of the
relationship between ‘gcc’ and ‘gcc-toolchain’.
> > So aparently it worked.
>
> It worked in the sense that the package was built successfully
> with gcc@7.5. If your undescribed issue was a build issue, it's
> not deterministic. If it's a run-time bug, whatever it is will
> still happen.
Right, it still happens. It’s a runtime issue. “worked” here referred to
triggering a package rebuild and having it completing successfuly.
> > And surprisingly, when changing the requested gcc-toolchain
> > version,
> > guix doesn't attempt to build anything and just returns the same
>
> > store items from the “10.3.0” build:
> It's not surprising, it's proof that your transformation's a
> no-op. Guix is very good at hashing changes; it doesn't ‘miss’ or
> cache stale things.
Nice. It’s good to understand that piece of the puzzle.
> Two things that work (but read both):
>
> ~$ guix build --with-input=gcc=gcc@10 mesa
> guix build: package 'gcc' has been superseded by 'gcc-toolchain'
>
> Is this why you tried =gcc-toolchain= above? :-) The hint isn't
> relevant in this edge case, you can ignore it for once.
I didn’t even try this command actually. I had noticed that I couldn’t
manipulate the ‘gcc’ package from the command line, so I assumed that
passing it to `--with-input` wouldn’t work. I thought it was only possible
to reference it in Scheme code, via the ‘gcc’ variable.
> I've included this option because it's the workin variant of your
> first command. However, it rebuilds the *entire* dependency chain
> of Mesa with GCC 10: glibc, bash, ed, python-minimal, guile…
>
> It's cool that Guix makes this task so easy,
It’s very cool indeed! Unfortunately, here it’s failing early in the
rebuild process, while trying to build ‘bash-minimal’:
```
configure: WARNING: unrecognized options: --enable-fast-install
checking build system type... i686-unknown-linux-gnu
checking host system type... i686-unknown-linux-gnu
Beginning configuration for bash-5.0-release for i686-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/tmp/guix-build-bash-minimal-5.0.16.drv-0/bash-5.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
```
> but you probably want just
>
> ~$ guix build --with-c-toolchain=mesa=gcc-toolchain@10 mesa
>
> This special-case option will do the right things to rebuild
> (only) mesa with the toolchain of your choice. Note the =mesa=
> difference in syntax: the package you want to rebuild, not the one
> you want to replace:
>
> […]
> C compiler for the host machine: gcc (gcc 10.3.0 "gcc (GCC)
> 10.3.0")
> C linker for the host machine: gcc ld.bfd 2.34
> C++ compiler for the host machine: c++ (gcc 10.3.0 "c++ (GCC)
> 10.3.0")
> C++ linker for the host machine: c++ ld.bfd 2.34
> […]
Yes, that is indeed what I was looking for. Unfortunately, as I mentioned
in my other email, with this option Mesa builds some libraries with GCC
10.3.0 and others with 7.5.0. There must be something strange going on with
its build system.
> Not a user of PACKAGE-INPUT-REWRITING so I'll leave that to
> someone else.
I was able to use ‘package-with-c-toolchain’, though I get the same mixed-
toolchains result.
As I mentioned in the other email, I’m beginning to wonder if my time would
be better spend trying to help getting core-updates ready. Then I’d get
gcc-8 by default.
--
Thanks,
Thiago
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: Build Mesa with a different toolchain version
2021-06-02 11:13 ` Tobias Geerinckx-Rice
@ 2021-06-03 5:35 ` Thiago Jung Bauermann
0 siblings, 0 replies; 9+ messages in thread
From: Thiago Jung Bauermann @ 2021-06-03 5:35 UTC (permalink / raw)
To: Tobias Geerinckx-Rice; +Cc: help-guix
Em quarta-feira, 2 de junho de 2021, às 08:13:17 -03, Tobias Geerinckx-Rice
escreveu:
> Two notes after a calming walk in the woods:
Always a good idea!
> Tobias Geerinckx-Rice 写道:
>
> > no package has a ‘gcc-toolchain’ input.
>
> Not true: 2 do. I meant that ‘the toolchain’ used to build
> everything…
>
> > It is not used internally by Guix.
>
> …is not the "gcc-toolchain" package as such.
Thanks for the clarification.
> > (package (inherit gcc->gcc-10 mesa) …)
>
> Just turn it around:
>
> (define-public mesa/gcc-10
> (package
> (inherit mesa)
> (native-inputs
> `(("gcc" ,gcc-10)
> ,@(package-native-inputs mesa)))))
This worked (except for the mixed-toolchains issue):
(define-public mesa-10
(package
(inherit (package-with-c-toolchain mesa
`(("toolchain" ,gcc-toolchain-10))))
(name "mesa-10")))
--
Thanks,
Thiago
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-06-03 5:35 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-02 0:46 Build Mesa with a different toolchain version Thiago Jung Bauermann
2021-06-02 1:53 ` Thiago Jung Bauermann
2021-06-02 9:44 ` Tobias Geerinckx-Rice
2021-06-02 9:22 ` Efraim Flashner
2021-06-03 5:14 ` Thiago Jung Bauermann
2021-06-02 9:42 ` Tobias Geerinckx-Rice
2021-06-02 11:13 ` Tobias Geerinckx-Rice
2021-06-03 5:35 ` Thiago Jung Bauermann
2021-06-03 5:17 ` Thiago Jung Bauermann
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.