GNU bug report logs - #55833
cross-base error: wrong type argument in position 1

Previous Next

Package: guix;

Reported by: Ekaitz Zarraga <ekaitz <at> elenq.tech>

Date: Tue, 7 Jun 2022 15:44:02 UTC

Severity: normal

To reply to this bug, email your comments to 55833 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#55833; Package guix. (Tue, 07 Jun 2022 15:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ekaitz Zarraga <ekaitz <at> elenq.tech>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Tue, 07 Jun 2022 15:44:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ekaitz Zarraga <ekaitz <at> elenq.tech>
To: "bug-guix <at> gnu.org" <bug-guix <at> gnu.org>,
 "othacehe <at> gnu.org" <othacehe <at> gnu.org>
Subject: cross-base error: wrong type argument in position 1
Date: Tue, 07 Jun 2022 15:43:13 +0000
Hi all,

I'm experiencing the following error when I try to make something like (cross-libc "riscv64-unknown-linux-gnu") and it broke in every single setup I already have for months and was working properly. In fact, it works as expected when using a time-machine to the past.

```
$ guix shell -m manifest.scm
Backtrace:
In guix/scripts/environment.scm:
   953:13 19 (_)
In guix/store.scm:
  2168:25 18 (run-with-store #<store-connection 256.99 7f651e026870> …)
In guix/scripts/environment.scm:
   955:14 17 (_ _)
In guix/profiles.scm:
    627:3 16 (_ _)
In srfi/srfi-1.scm:
   586:29 15 (map1 (#<<manifest-entry> name: "gcc" version: "4.6.…> …))
   586:29 14 (map1 (#<<manifest-entry> name: "binutils-cross-risc…> …))
   586:17 13 (map1 (#<<manifest-entry> name: "glibc-cross-riscv64…> …))
In guix/profiles.scm:
  1889:19 12 (_ _)
In guix/packages.scm:
  1269:17 11 (supported-package? #<package glibc-cross-riscv64-unkn…> …)
In guix/memoization.scm:
    101:0 10 (_ #<hash-table 7f650b8bae00 153/223> #<package glibc-…> …)
In guix/packages.scm:
  1239:12  9 (_)
In srfi/srfi-1.scm:
   460:18  8 (fold #<procedure 7f650ba4b540 at guix/packages.scm:12…> …)
In guix/packages.scm:
  1243:42  7 (_ _ ("x86_64-linux" "i686-linux"))
In guix/memoization.scm:
    101:0  6 (_ #<hash-table 7f650b8bae00 153/223> #<package linux-…> …)
In guix/packages.scm:
  1247:37  5 (_)
  1507:16  4 (package->bag _ _ _ #:graft? _)
  1612:43  3 (thunk)
In gnu/packages/cross-base.scm:
   352:33  2 (loop (#:phases (modify-phases %standard-phases # …) …) #)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure struct-vtable: Wrong type argument in position 1 (expecting struct): #f
```

I think the error was introduced in the commit b55310603f0df7d5ae02d47cb8d4be58bf1d41ca but I can't really explain what's happening.

You can replicate this using the manifest from: https://github.com/ekaitz-zarraga/gcc

It won't work if you have guix updated, but it will if you use the time-machine with the `channels.scm` file in the same repo.

You can also try with smaller packages (the repo is a full gcc4.6, use it under your own risk (: ), anything that uses `(cross-libc "riscv64-unknown-linux-gnu")` will trigger the error.

I would fix this myself but I don't really understand what's going on. If anyone guides me a little I'm open to fix it myself.

Thank you all!
Ekaitz

ElenQ Technology
Ethical Innovation




Information forwarded to bug-guix <at> gnu.org:
bug#55833; Package guix. (Tue, 07 Jun 2022 18:35:01 GMT) Full text and rfc822 format available.

Message #8 received at 55833 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Ekaitz Zarraga <ekaitz <at> elenq.tech>, 55833 <at> debbugs.gnu.org, othacehe <at> gnu.org
Subject: Re: bug#55833: cross-base error: wrong type argument in position 1
Date: Tue, 07 Jun 2022 20:33:58 +0200
[Message part 1 (text/plain, inline)]
Ekaitz Zarraga schreef op di 07-06-2022 om 15:43 [+0000]:
> I think the error was introduced in the commit b55310603f0df7d5ae02d47cb8d4be58bf1d41ca but I can't really explain what's happening.

I guess it's due to the introduction of

  lookup-platform-by-target-or-system

Proposed solution:

  * rename platform-linux-architecture to
    '%platform-linux-architecture'
    and define a wrapper 'platform-linux-architecture' displaying
    a proper error message ‘unsupported target’ or such.

and

  * use "riscv64-linux-gnu" instead of "riscv64-unknown-linux-gnu"
    (as expected by (guix platforms riscv)).

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#55833; Package guix. (Wed, 08 Jun 2022 10:36:02 GMT) Full text and rfc822 format available.

Message #11 received at 55833 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Maxime Devos <maximedevos <at> telenet.be>, Ekaitz Zarraga
 <ekaitz <at> elenq.tech>, 55833 <at> debbugs.gnu.org, othacehe <at> gnu.org
Subject: Re: bug#55833: cross-base error: wrong type argument in position 1
Date: Wed, 08 Jun 2022 12:35:41 +0200
Hello Maxime and Ekaitz,
Maxime Devos <maximedevos <at> telenet.be> writes:

> Ekaitz Zarraga schreef op di 07-06-2022 om 15:43 [+0000]:
> Proposed solution:
>
>   * rename platform-linux-architecture to
>     '%platform-linux-architecture'
>     and define a wrapper 'platform-linux-architecture' displaying
>     a proper error message ‘unsupported target’ or such.
>
> and
>
>   * use "riscv64-linux-gnu" instead of "riscv64-unknown-linux-gnu"
>     (as expected by (guix platforms riscv)).

I don't think we should deviate from the usual behaviour of a procedure
returning #f it wasn't able to find the thing it was searching for.
Ideally, cross-libc should take a platform argument itself, so that we
can lookup the target earlier and throw an exception there instead.

WDYT?

Best,
-- 
Josselin Poiret




Information forwarded to bug-guix <at> gnu.org:
bug#55833; Package guix. (Wed, 08 Jun 2022 13:07:01 GMT) Full text and rfc822 format available.

Message #14 received at 55833 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Josselin Poiret <dev <at> jpoiret.xyz>, Ekaitz Zarraga <ekaitz <at> elenq.tech>, 
 55833 <at> debbugs.gnu.org, othacehe <at> gnu.org
Subject: Re: bug#55833: cross-base error: wrong type argument in position 1
Date: Wed, 08 Jun 2022 15:06:10 +0200
[Message part 1 (text/plain, inline)]
Josselin Poiret schreef op wo 08-06-2022 om 12:35 [+0200]:
> >    * rename platform-linux-architecture to
> >      '%platform-linux-architecture'
> >      and define a wrapper 'platform-linux-architecture' displaying
> >      a proper error message ‘unsupported target’ or such.
> > 
> > and
> > 
> >    * use "riscv64-linux-gnu" instead of "riscv64-unknown-linux-gnu"
> >      (as expected by (guix platforms riscv)).
> 
> I don't think we should deviate from the usual behaviour of a
> procedure
> returning #f it wasn't able to find the thing it was searching for.

The proposal was to modify platform-linux-architecture, which doesn't
search for anything and doesn't return #false.  It already throws an
exception:

> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> In procedure struct-vtable: Wrong type argument in position 1
> (expecting struct): #f

The proposal is to make the error message clearer, by raising an
exception ourselves instead of leaving it to struct-vtable.

(My proposal might have been confusing due to the mention of
lookup-platform-by-target-or-system which doesn't seem relevant on
second sight?)

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#55833; Package guix. (Wed, 08 Jun 2022 13:13:02 GMT) Full text and rfc822 format available.

Message #17 received at 55833 <at> debbugs.gnu.org (full text, mbox):

From: Maxime Devos <maximedevos <at> telenet.be>
To: Josselin Poiret <dev <at> jpoiret.xyz>, Ekaitz Zarraga <ekaitz <at> elenq.tech>, 
 55833 <at> debbugs.gnu.org, othacehe <at> gnu.org
Subject: Re: bug#55833: cross-base error: wrong type argument in position 1
Date: Wed, 08 Jun 2022 15:12:00 +0200
[Message part 1 (text/plain, inline)]
Josselin Poiret schreef op wo 08-06-2022 om 12:35 [+0200]:
> I don't think we should deviate from the usual behaviour of a procedure
> returning #f it wasn't able to find the thing it was searching for.
> Ideally, cross-libc should take a platform argument itself, so that we
> can lookup the target earlier and throw an exception there instead.

Wait my proposal cannot work as-is because linux-architecture=#false
for Hurd platforms ...

FWIW, I think the current usual behaviour is not ideal, and that these
kind of procedures should raise an exception instead, like
specification->package:

scheme@(guix-user)> (specification->package "foobar")
guix repl: fout: foobar: onbekend pakket ; <-- unknown package

Or search-input-file or search-input-directory.

Maybe it could raise a &non-linux-platform condition like
search-input-file raises &search-error condition?

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#55833; Package guix. (Wed, 08 Jun 2022 16:30:04 GMT) Full text and rfc822 format available.

Message #20 received at 55833 <at> debbugs.gnu.org (full text, mbox):

From: Ekaitz Zarraga <ekaitz <at> elenq.tech>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: othacehe <at> gnu.org, 55833 <at> debbugs.gnu.org
Subject: Re: bug#55833: cross-base error: wrong type argument in position 1
Date: Wed, 08 Jun 2022 16:29:36 +0000
Hi,

> * use "riscv64-linux-gnu" instead of "riscv64-unknown-linux-gnu"
> (as expected by (guix platforms riscv)).


There's an slight problem with that. I tried to do it and I can't
build my custom gcc without sending the full triplet (with -unknown)
and if I make the other parts of the system, like binutils without the
-unknown part, the gcc is unable to find `ld`.

I have to dig on this further but it looks like this has further
effects on the system.

Best,
Ekaitz




Information forwarded to bug-guix <at> gnu.org:
bug#55833; Package guix. (Wed, 08 Jun 2022 17:12:02 GMT) Full text and rfc822 format available.

Message #23 received at 55833 <at> debbugs.gnu.org (full text, mbox):

From: Ekaitz Zarraga <ekaitz <at> elenq.tech>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: othacehe <at> gnu.org, 55833 <at> debbugs.gnu.org
Subject: Re: bug#55833: cross-base error: wrong type argument in position 1
Date: Wed, 08 Jun 2022 17:11:17 +0000
Forget it, there was some code missing to match the platform correctly in my
custom GCC. Added it and now it's working without the `unknown` part.

Cheers




This bug report was last modified 3 years and 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.