Skip to content

.gen: rename subdirectory for 1.16 compatibility #3980

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

Closed
buyology opened this issue Feb 11, 2021 · 4 comments
Closed

.gen: rename subdirectory for 1.16 compatibility #3980

buyology opened this issue Feb 11, 2021 · 4 comments

Comments

@buyology
Copy link

Starting from 1.16:

In module mode, the go command now disallows import paths that
include non-ASCII characters or path elements with a leading dot character
(.). Module paths with these characters were already disallowed, […]
so this change affects only paths within module subdirectories.

So attempting to compile packages depending on uber/cadence will fail with:

../../vendor/go.uber.org/cadence/internal/client.go:30:2: malformed import path "go.uber.org/cadence/.gen/go/cadence/workflowserviceclient": leading dot in path element
../../vendor/go.uber.org/cadence/internal/internal_workflow_testsuite.go:39:2: malformed import path "go.uber.org/cadence/.gen/go/cadence/workflowservicetest": leading dot in path element
../../vendor/go.uber.org/cadence/internal/activity.go:29:2: malformed import path "go.uber.org/cadence/.gen/go/shared": leading dot in path element

As per golang/go#43985 (comment):

The only specific affected module we know of so far is go.uber.org/cadence, but because the affected import statement is an internal package it could be fixed for external consumers by an internal-only change within a patch release for that module (namely, moving the packages currently in the .gen subdirectory to another location and updating the imports within the module).

(emphasis added)

@Groxx
Copy link
Member

Groxx commented Feb 17, 2021

Yea, seems like it's picky all the time. With just eval "$(gimme 1.16)" and:

// main.go
package main
import "go.uber.org/cadence/workflow"
func main() {
    _ = workflow.NewDisconnectedContext()
}

// go.mod
module temp

I get this on go mod tidy (among other failures):

go: downloading golang.org/x/text v0.3.0
temp imports
	go.uber.org/cadence/workflow imports
	go.uber.org/cadence/.gen/go/shared: malformed import path "go.uber.org/cadence/.gen/go/shared": leading dot in path element

so this probably has to be done pretty soon.

@buyology
Copy link
Author

buyology commented Feb 27, 2021

Looks like this is going to be relaxed in 1.16.1 after all: golang/go#43985 (comment)

@Groxx
Copy link
Member

Groxx commented Mar 1, 2021

Excellent. Thank you for the update! I'll wait on these, it'd be better to not force the breakage if we don't have to.

@buyology
Copy link
Author

With the recent 1.16.2 release this is no longer an issue. Closing.

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

Successfully merging a pull request may close this issue.

2 participants