Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 917750 - go-env.eclass: wrong GOARCH value for riscv64, go: unsupported GOOS/GOARCH pair linux/riscv
Summary: go-env.eclass: wrong GOARCH value for riscv64, go: unsupported GOOS/GOARCH pa...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: riscv Linux
: Normal major
Assignee: Flatcar Linux Maintainers
URL:
Whiteboard:
Keywords: PullRequest
: 917751 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-11-22 15:39 UTC by Ryan Tsien
Modified: 2023-11-24 16:36 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ryan Tsien 2023-11-22 15:39:54 UTC
```
go: unsupported GOOS/GOARCH pair linux/riscv
```

Every ebuilds which inherit go-module.eclass which inherit the new go-env.eclass will report the above error message.

The supported GOARCH value of golang for riscv64 which has been supported by Gentoo is `riscv64` not `riscv`.


I think a new line like
```
riscv)  GOARCH="riscv64" ;;
```
should be inserted into the go-env_set_compile_environment function.

Reproducible: Always
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-11-22 15:59:00 UTC
*** Bug 917751 has been marked as a duplicate of this bug. ***
Comment 2 Ryan Tsien 2023-11-22 16:57:25 UTC
A deeper question:

does the arch name for riscv64 from tc-arch function is wrong?

RISC-V has 32-bit and 64-bit microprocessors, and the supported platform by Gentoo is 64-bit RISC-V, the default CHOST is `riscv64-unknown-linux-gnu` either.


So, is it necessary to change the arch name that generated by tc-arch function for RISC-V platform from riscv to riscv64 to disambiguate?
Comment 3 Flatcar Linux Maintainers 2023-11-23 14:58:16 UTC
Hello Ryan,

Thank you for reporting this! There's a WIP PR to un-break a number of platforms here: https://github.com/gentoo/gentoo/pull/33941

Could you please have a look and speak up here or on the Github issue if this fixes things for you?
Comment 4 Ryan Tsien 2023-11-23 15:08:36 UTC
(In reply to Flatcar Linux Maintainers from comment #3)

> There's a WIP PR to un-break a number of
> platforms here: https://github.com/gentoo/gentoo/pull/33941
> 
> Could you please have a look and speak up here or on the Github issue if
> this fixes things for you?

Yes, this patch fixes the above problem. I think it can be merged directly.
Comment 5 Larry the Git Cow gentoo-dev 2023-11-24 16:26:20 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0061d784248dc29adc92c7881d2854deb6cc12e1

commit 0061d784248dc29adc92c7881d2854deb6cc12e1
Author:     WANG Xuerui <xen0n@gentoo.org>
AuthorDate: 2023-11-23 08:04:18 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-11-24 16:26:14 +0000

    go-env.eclass: unify GOARCH mapping logic with dev-lang/go
    
    Previously the eclass featured its own GOARCH mapping, that took care
    of less cases than the dev-lang/go ebuild did, and broke Go packages on
    arches like loong (GOARCH=loong64), mips (4 GOARCHes supported in total)
    or riscv (GOARCH=riscv64).
    
    This patch adds a copy of the go_arch() helper from dev-lang/go to the
    eclass and switches the go-env_set_compile_environment() function to use
    that, to fix the problem at hand.
    
    Fixes: 878d04daaf34765e6224e58139a9c45921d7a0c3
    Closes: https://bugs.gentoo.org/917750
    Signed-off-by: WANG Xuerui <xen0n@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/go-env.eclass | 40 ++++++++++++++++++++++++++--------------
 1 file changed, 26 insertions(+), 14 deletions(-)