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

Cannot install v0.17.0 from source #100

Closed
adamgoose opened this issue Sep 4, 2023 · 4 comments
Closed

Cannot install v0.17.0 from source #100

adamgoose opened this issue Sep 4, 2023 · 4 comments

Comments

@adamgoose
Copy link

adamgoose commented Sep 4, 2023

$ go install -x github.com/risor-io/risor/cmd/risor@v0.17.0
# get https://proxy.golang.org/github.com/@v/v0.17.0.info
# get https://proxy.golang.org/github.com/risor-io/@v/v0.17.0.info
# get https://proxy.golang.org/github.com/risor-io/risor/cmd/risor/@v/v0.17.0.info
# get https://proxy.golang.org/github.com/risor-io/risor/cmd/@v/v0.17.0.info
# get https://proxy.golang.org/github.com/risor-io/risor/cmd/risor/@v/v0.17.0.info: 404 Not Found (0.120s)
# get https://proxy.golang.org/github.com/risor-io/risor/cmd/@v/v0.17.0.info: 404 Not Found (0.120s)
# get https://proxy.golang.org/github.com/@v/v0.17.0.info: 404 Not Found (0.206s)
# get https://proxy.golang.org/github.com/risor-io/@v/v0.17.0.info: 404 Not Found (0.206s)
# go: github.com/risor-io/risor/cmd/risor@v0.17.0: module github.com/risor-io/risor@v0.17.0 found, but does not contain package github.com/risor-io/risor/cmd/risor
Go Version Details
go version go1.20.4 darwin/arm64

GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/adam/Library/Caches/go-build"
GOENV="/Users/adam/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/adam/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/adam/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/nix/store/rhmf86rrq5sksqhg1544dq6hvxrr5cvg-go-1.20.4/share/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/nix/store/rhmf86rrq5sksqhg1544dq6hvxrr5cvg-go-1.20.4/share/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.20.4"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/adam/tmp/risor-test/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 -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/rg/284c6b7s3bl6mxdzlczyqf8m0000gp/T/go-build1938590258=/tmp/go-build -gno-record-gcc-switches -fno-common"

This is likely due to a combination of the following factors:

Potential fix: follow the steps here to remove the package from the index, then re-cache it?

Obligatory edit: 💯 😎

@adamgoose
Copy link
Author

Cloning the repo and running go install from the ./cmd/risor directory works as expected.

@myzie
Copy link
Collaborator

myzie commented Sep 5, 2023

Thanks for helping figure this out @adamgoose. I think nested Go modules is the right approach for the project long term, but transitioning to it has been painful.

It is especially weird that cmd/risor seems worse off than other submodules e.g. modules/pgx. They're virtually identical in terms of how the submodules were introduced later.

I'm working on this...

@myzie
Copy link
Collaborator

myzie commented Sep 18, 2023

@adamgoose - There is now a v1.1.1 release of Risor, which helped resolve some of the Go module weirdness that was lingering.

However I'm seeing that the replace directives in the cmd/risor Go module interfere with go install:

$ go install github.com/risor-io/risor/cmd/risor@latest
go: github.com/risor-io/risor/cmd/risor@latest (in github.com/risor-io/risor/cmd/risor@v1.1.1):
        The go.mod file for the module providing named packages contains one or
        more replace directives. It must not contain directives that would cause
        it to be interpreted differently than if it were the main module.

My initial searching on this problem makes this look like it's a challenge for other projects as well. I don't really want to get rid of the replace directives. I'll have to look at this more.

LMK what you think.

@myzie
Copy link
Collaborator

myzie commented Nov 23, 2023

I documented the current recommended source install steps:

https://github.com/risor-io/risor#build-and-install-the-cli-from-source

We are subject to the Go limitation with replace directives discussed here which does unfortunately prevent using go install with just the Risor URL.

@myzie myzie closed this as completed Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants