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

jfrog go-publish fails in workspace mode #1850

Open
jackwhelpton opened this issue Feb 27, 2023 · 3 comments
Open

jfrog go-publish fails in workspace mode #1850

jackwhelpton opened this issue Feb 27, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@jackwhelpton
Copy link

jackwhelpton commented Feb 27, 2023

Describe the bug

Running go-publish from a subdirectory (module) of a multi-module workspace fails.

Current behavior

[Info] Using go: go1.20
[Info] Running 'go list -mod=mod -m' in <dir omitted>
[Error] Failed running Go command: 'go list -mod=mod -m' in <dir-omitted> with error: 'exit status 1 - go: -mod may only be set to readonly when in workspace mode, but it is set to "mod"
Remove the -mod flag to use the default readonly value,
or set GOWORK=off to disable workspace mode.

Reproduction steps

Execute jfrog gp v1.0.0 in a subdirectory (module) of a workspace whose root contains a go.work.

Expected behavior

Within a subdirectory representing a single module, that module should be published.
Ideally, running from the root containing a go.work directory should publish all modules.

Up for some discussion on exact desired behavior, but the current failure is not ideal.

Presumably the go list command could be invoked with -mod=readonly rather than -mod=mod?

JFrog CLI version

2.34.2

Operating system type and version

debian:11.6-slim

JFrog Artifactory version

7.41.12

JFrog Xray version

No response

@jackwhelpton jackwhelpton added the bug Something isn't working label Feb 27, 2023
@GaikwadPratik
Copy link

Is there any solution to this? This bug has been opened for almost a year now. With evolving usage of go workspace, we will need this sooner than later.

@GaikwadPratik
Copy link

GaikwadPratik commented Jun 13, 2024

@gtshepard
Copy link

gtshepard commented Jul 8, 2024

Also hitting this issue with doing local build step.

Would greatly appreciate if this could be made a priority. important project has mono-repo structure.

maybe a flag for workspace mode could be provided.

jf go build --build-name=ascii-zoo-v0.0.2 --build-number=1
17:26:48 [🔵Info] Using go: go1.22.4
17:26:48 [🔵Info] Running 'go list -mod=mod -m' in /Users/gshepard/go/src/ascii-zoo/sdk/gozoo
17:26:48 [🔵Info] Trace ID for JFrog Platform logs: 956b574c05e4c935
17:26:48 [🚨Error] Failed running Go command: 'go list -mod=mod -m' in /Users/gshepard/go/src/ascii-zoo/sdk/gozoo with error: 'exit status 1 - go: -mod may only be set to readonly or vendor ### when in workspace mode, but it is set to "mod"
        Remove the -mod flag to use the default readonly value, 
        or set GOWORK=off to disable workspace mode.

before seeing this is hardcoded, tried setting GOFLAGS to
-mod=readonly does not change the behavior either.

go env -w GOFLAGS=-mod=readonly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants