Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/exp/shiny: won't build on loong64 #70855

Closed
justledbetter opened this issue Dec 15, 2024 · 6 comments
Closed

x/exp/shiny: won't build on loong64 #70855

justledbetter opened this issue Dec 15, 2024 · 6 comments
Labels
arch-loong64 Issues solely affecting the loongson architecture. help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@justledbetter
Copy link

justledbetter commented Dec 15, 2024

Go version

go version go1.23.4 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/brian/.cache/go-build'
GOENV='/home/brian/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/brian/.go/pkg/mod'
GONOPROXY='nemu.us/*'
GONOSUMDB='nemu.us/*'
GOOS='linux'
GOPATH='/home/brian/.go'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.4'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/brian/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/brian/nemu-hc/nemu/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3390701732=/tmp/go-build -gno-record-gcc-switches'

What did you do?

Using a very simple example:

package main

import (
        "github.com/aarzilli/nucular"
        "image"
)

func main() {
        win := nucular.NewMasterWindowSize(
                0, "Sample Window", image.Point{100, 100},
                func(w *nucular.Window) {
                        w.Row(0).Dynamic(1)
                        w.Label("This won't build if GOARCH=loong64", "LC")
                },
        )
        win.Main()
}

What did you see happen?

It works on the platforms defined in the buildtags, but not loong64:

$ GOARCH=amd64 go build && echo worked
worked
$ GOARCH=arm64 go build && echo worked
worked
$ GOARCH=mips64 go build && echo worked
worked
$ GOARCH=loong64 go build && echo worked
# golang.org/x/exp/shiny/driver/x11driver
../.go/pkg/mod/golang.org/x/exp/[email protected]/driver/x11driver/buffer.go:112:12: undefined: shmClose
../.go/pkg/mod/golang.org/x/exp/[email protected]/driver/x11driver/screen.go:328:23: undefined: shmOpen
../.go/pkg/mod/golang.org/x/exp/[email protected]/driver/x11driver/screen.go:334:5: undefined: shmClose

What did you expect to see?

Simple fix seems to be to modify the source:

$ diff shm_sysopen_syscall.go~ shm_sysopen_syscall.go
5c5
< //go:build (linux || dragonfly) && (amd64 || arm || arm64 || mips64 || mips64le)
---
> //go:build (linux || dragonfly) && (amd64 || arm || arm64 || mips64 || mips64le || loong64)
@gopherbot gopherbot added this to the Unreleased milestone Dec 15, 2024
@Jorropo
Copy link
Member

Jorropo commented Dec 15, 2024

Simple fix seems to be to modify the source:

Nice do you want do send a patch ?

@hyangah hyangah modified the milestones: Unreleased, Unplanned Dec 15, 2024
@dmitshur dmitshur changed the title x/exp: shiny won't build on loong64 x/exp/shiny: won't build on loong64 Dec 16, 2024
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. arch-loong64 Issues solely affecting the loongson architecture. labels Dec 16, 2024
@justledbetter
Copy link
Author

@Jorropo Would be delighted to - Here's a patch against the master branch of github.com/golang/exp, as reported by git diff. My apologies for not being familiar with the right way to do this, happy to resubmit it however you prefer me to!

diff --git a/shiny/driver/x11driver/shm_shmopen_syscall.go b/shiny/driver/x11driver/shm_shmopen_syscall.go
index 74f571b..a5a7233 100644
--- a/shiny/driver/x11driver/shm_shmopen_syscall.go
+++ b/shiny/driver/x11driver/shm_shmopen_syscall.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build (linux || dragonfly) && (amd64 || arm || arm64 || mips64 || mips64le)
+//go:build (linux || dragonfly) && (amd64 || arm || arm64 || mips64 || mips64le || loong64)
 
 package x11driver

@Jorropo
Copy link
Member

Jorropo commented Dec 16, 2024

@justledbetter the simplest way is for you to open a pr at https://github.com/golang/exp/compare we have a bot that will upload to our tracker.

If I send your diff I guess it'll count as mine and then I don't think I can review it.

@justledbetter
Copy link
Author

Gotcha! Should be done in golang/exp#77 :)

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/636695 mentions this issue: exp/shiny: adds loong64 to list of supported archs (Resolves golang/go#70855)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-loong64 Issues solely affecting the loongson architecture. help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants