9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Some problems about golang on plan9/arm64
@ 2025-05-08 17:27 fish4terrisa
  2025-05-08 17:49 ` Danny Wilkins via 9fans
  2025-05-08 18:01 ` Skip Tavakkolian
  0 siblings, 2 replies; 5+ messages in thread
From: fish4terrisa @ 2025-05-08 17:27 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

I know that currently golang doesn't support plan9/arm64, and maybe wont support it in the future.
And someone already made a port of golang to plan9/arm64 at here: https://github.com/psilva261/go-arm64.plan9
I already successfully built and installed it on 9front/arm64 on my rpi. (using a linux machine to get a bootstrap for go plan9/arm64, and then copy it to rpi, build the full golang toolchain there.)
I confirmed that this port of golang can compile some simple projects and the golang compiler correctly.
However I encountered a problem:
Some go projects may import the package 'golang.org/x/sys', , which caused the go compiler to fetch the upstream source code, and fails to compile due to the lack of plan9/arm64 in upstream.
Does anyone know any workarounds?
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T875b01e7d1d3d05b-M16a8d806dabadb4901d7be81
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 1696 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Some problems about golang on plan9/arm64
  2025-05-08 17:27 [9fans] Some problems about golang on plan9/arm64 fish4terrisa
@ 2025-05-08 17:49 ` Danny Wilkins via 9fans
  2025-05-08 18:01 ` Skip Tavakkolian
  1 sibling, 0 replies; 5+ messages in thread
From: Danny Wilkins via 9fans @ 2025-05-08 17:49 UTC (permalink / raw)
  To: 9fans

On Thu, May 08, 2025 at 05:27:20PM +0000, fish4terrisa@fishinix.org wrote:
> Some go projects may import the package 'golang.org/x/sys', , which caused the go compiler to fetch the upstream source code, and fails to compile due to the lack of plan9/arm64 in upstream.
> Does anyone know any workarounds?
I believe what you're looking for is the "replace" directive in the
relevant go modules, which will let you satisfy the dependency with
a local copy which you've ported to arm64.


------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T875b01e7d1d3d05b-Md82a3b181d02bd17c0d2c872
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Some problems about golang on plan9/arm64
  2025-05-08 17:27 [9fans] Some problems about golang on plan9/arm64 fish4terrisa
  2025-05-08 17:49 ` Danny Wilkins via 9fans
@ 2025-05-08 18:01 ` Skip Tavakkolian
  2025-05-08 18:06   ` fish4terrisa-MSDSM
  1 sibling, 1 reply; 5+ messages in thread
From: Skip Tavakkolian @ 2025-05-08 18:01 UTC (permalink / raw)
  To: 9fans

could you use go mod 'replace' to provide a local stub?

On Thu, May 8, 2025 at 10:41 AM <fish4terrisa@fishinix.org> wrote:
>
> I know that currently golang doesn't support plan9/arm64, and maybe wont support it in the future.
> And someone already made a port of golang to plan9/arm64 at here: https://github.com/psilva261/go-arm64.plan9
> I already successfully built and installed it on 9front/arm64 on my rpi. (using a linux machine to get a bootstrap for go plan9/arm64, and then copy it to rpi, build the full golang toolchain there.)
> I confirmed that this port of golang can compile some simple projects and the golang compiler correctly.
> However I encountered a problem:
> Some go projects may import the package 'golang.org/x/sys', , which caused the go compiler to fetch the upstream source code, and fails to compile due to the lack of plan9/arm64 in upstream.
> Does anyone know any workarounds?
> 9fans / 9fans / see discussions + participants + delivery options Permalink

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T875b01e7d1d3d05b-M29b0985226b0dae230337f9a
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Some problems about golang on plan9/arm64
  2025-05-08 18:01 ` Skip Tavakkolian
@ 2025-05-08 18:06   ` fish4terrisa-MSDSM
  2025-05-08 20:08     ` Ron Minnich
  0 siblings, 1 reply; 5+ messages in thread
From: fish4terrisa-MSDSM @ 2025-05-08 18:06 UTC (permalink / raw)
  To: 9fans

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

ok thx.
Also I saw that nearly all code in x/sys is share with the go toolchain, and it seems that these packages are generated from the go toolchain source code. Does anyone know any clues about it? Or I need to manually edit the x/sys source code?
------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T875b01e7d1d3d05b-Mced3e9eb97af4c1db8c6f57e
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

[-- Attachment #2: Type: text/html, Size: 981 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [9fans] Some problems about golang on plan9/arm64
  2025-05-08 18:06   ` fish4terrisa-MSDSM
@ 2025-05-08 20:08     ` Ron Minnich
  0 siblings, 0 replies; 5+ messages in thread
From: Ron Minnich @ 2025-05-08 20:08 UTC (permalink / raw)
  To: 9fans

I don't think you want to use go mod or replace directives any more,
that's been replaced (for me at any rate) with
go work

so, example, suppose I am working in my cpu directory
(github.com/u-root/cpu, and I want my cpu command to pull from a
locally changed u-root
My cpu directory is ~/cpu, and u-root is ~/u-root.
I would do this
cd ~/cpu
go work init
go work use ~/u-root

and now I'm using a local copy.

The nice part about this is it does not change any files that are
managed by git.
I've been very happy with go work

On Thu, May 8, 2025 at 11:32 AM fish4terrisa-MSDSM
<fish4terrisa@fishinix.org> wrote:
>
> ok thx.
> Also I saw that nearly all code in x/sys is share with the go toolchain, and it seems that these packages are generated from the go toolchain source code. Does anyone know any clues about it? Or I need to manually edit the x/sys source code?
> 9fans / 9fans / see discussions + participants + delivery options Permalink

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T875b01e7d1d3d05b-M2e36ca9f8c45ebe1d77b3fda
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2025-05-08 20:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-05-08 17:27 [9fans] Some problems about golang on plan9/arm64 fish4terrisa
2025-05-08 17:49 ` Danny Wilkins via 9fans
2025-05-08 18:01 ` Skip Tavakkolian
2025-05-08 18:06   ` fish4terrisa-MSDSM
2025-05-08 20:08     ` Ron Minnich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).