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

cmd/go: support git/subcommand invocations for git9 on plan9 #68926

Closed
xplshn opened this issue Aug 17, 2024 · 10 comments
Closed

cmd/go: support git/subcommand invocations for git9 on plan9 #68926

xplshn opened this issue Aug 17, 2024 · 10 comments
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Plan9
Milestone

Comments

@xplshn
Copy link

xplshn commented Aug 17, 2024

Go version

go1.23.0 plan9/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN='/usr/glenda/bin'
GOCACHE='/usr/glenda/.config/go/cache'
GOENV='/usr/glenda/lib/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='plan9'
GOINSECURE=''
GOMODCACHE='/usr/glenda/.config/go/cache/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='plan9'
GOPATH='/usr/glenda/.config/go/cache'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/sys/lib/go/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/sys/lib/go/go/pkg/tool/plan9_amd64'
GOVCS=''
GOVERSION='go1.23.0'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/usr/glenda/lib/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='0'
GOMOD='/dev/null'
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 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1052339782=/tmp/go-build -gno-record-gcc-switches'

What did you do?

go install github.com/peajack/truefetch@main, but any install command will do. Actually, any command that relies on calling git.

What did you see happen?

go: github.com/peajack/truefetch@main: git init --bare in /usr/glenda/.config/go/cache/pkg/mod/cache/vcs/85d6972f1025dadd3cbae4796f5cd2cffa4c5c529c72c4081ee43145033f601d: exec: "git": executable file not found in $path
screenshot
NOTE: In ACME, you just 'type a button' in the bar and then do MOUSE3 to execute it, the output is then redirected to a new column in the editor. Executing the commands in 'window' (our "terminal") gives the same result.

What did you expect to see?

... Nothing, just go downloading the libraries/packages on which truefetch depends on and then compiling, like normal. On Plan9, the most recent, usable and reliable git port that we have is git9, which comes with 9front and can be found at /sys/src/cmd/git. The git binaries are at /bin/git/*. go should have called git/subCommand <args>, not git subCommand <args>.

@seankhliao seankhliao changed the title src/cmd/go: go will not always find git when using Plan9 cmd/go: support git/subcommand invocations for git9 on plan9 Aug 18, 2024
@krstlmnn
Copy link

Note that "git9" does not try to be totally compatible with the standard git binary and you can't just convert git <command> [<args>] to git/<command> [<args>] without consulting the manual pages. For example in this case git init --bare would be git/init -b.

Shouldn't this work with the rc wrapper from 9legacy, which predates "git9"?

@xplshn
Copy link
Author

xplshn commented Aug 18, 2024

Note that "git9" does not try to be totally compatible with the standard git binary and you can't just convert git <command> [<args>] to git/<command> [<args>] without consulting the manual pages. For example in this case git init --bare would be git/init -b.

Shouldn't this work with the rc wrapper from 9legacy, which predates "git9"?

Its not in 9front, which is the most popular plan9 distribution. And its been deprecated in favor of git9.

@krstlmnn
Copy link

I forgot about the compat script included in git9. As the manpage reads:

Git/compat spawns an rc subshell with a compatibility stub in $path. This compatibility stub provides enough of the unix git commands to run tools like go get but not much more.

@dmitshur dmitshur added OS-Plan9 NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. GoCommand cmd/go labels Aug 19, 2024
@dmitshur dmitshur added this to the Backlog milestone Aug 19, 2024
@dmitshur
Copy link
Contributor

CC @golang/plan9.

@millerresearch
Copy link
Contributor

Shouldn't this work with the rc wrapper from 9legacy, which predates "git9"?

Its not in 9front, which is the most popular plan9 distribution. And its been deprecated in favor of git9.

@krstlmnn is correct, as documented in the go wiki the wraoper is available to emulate just enough of git to be used by the go tools. It's not "in" 9front or any other version of Plan 9 -- it's just a simple shell script which you can download from 9legacy, and ensure it's bound in place of /bin/git before using go install. This works whatever flavour of Plan 9 you are using.

The 9front git9 command is something completely different -- it's a full reimplementation of git as a native Plan 9 style file server. But it's specific to 9front only -- the last time I checked, it wouldn't even compile under mainstream Plan 9.

If you want to use git9 instead of the usual wrapper, maybe consult the author @oridb about how to use the compat script for the purpose.

But I don't think there's any need to alter the go tools to accommodate 9front specially, when there's already a portable solution.

@oridb
Copy link
Contributor

oridb commented Aug 20, 2024

There's two different wrappers here: 'git/compat' and the http based wrapper scripts. Git/compat ships with 9front, but breaks pretty regularly, as go changes the features of git that it uses.

Right now, the module cache is the least painful option.

If the go team is open to it, invoking git9 would be a much better option. I'd be happy to take a shot at that, as well as figuring out how to test it.

@millerresearch
Copy link
Contributor

@oridb, can you give a current example where the portable rc wrapper doesn't work?

@oridb
Copy link
Contributor

oridb commented Sep 9, 2024

Sorry for the slow response -- I was on vacation. Looking at the reports I've gotten, bootstrapping has been the most painful part. I don't think the rc wrapper tries to deal with that (or with self-hosted repos).

I'll re-close, but I still think that if the go project is open to it, direct support for git/* would be nice on plan 9.

@oridb oridb closed this as completed Sep 9, 2024
@xplshn
Copy link
Author

xplshn commented Sep 9, 2024

Why is this closed as Completed..? Will this not be fixed?

@dmitshur dmitshur closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GoCommand cmd/go NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. OS-Plan9
Projects
None yet
Development

No branches or pull requests

6 participants