Skip to content

[go1.19] Known fails and build issues fix #1263

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

Merged
merged 3 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ func pruneImports(file *ast.File) {
path, _ := strconv.Unquote(in.Path.Value)
directivePrefix, hasPath := directiveImports[path]
if hasPath && astutil.HasDirectivePrefix(file, directivePrefix) {
// since the import is otherwise unused set the name to blank.
in.Name = ast.NewIdent(`_`)
delete(unused, name)
if len(unused) == 0 {
return
Expand Down
9 changes: 8 additions & 1 deletion build/build_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,14 @@ func TestOverlayAugmentation(t *testing.T) {

//go:linkname runtimeNano runtime.nanotime
func runtimeNano() int64`,
noCodeChange: true,
want: `import _ "unsafe"
import "embed"

//go:embed hello.txt
var eFile embed.FS

//go:linkname runtimeNano runtime.nanotime
func runtimeNano() int64`,
expInfo: map[string]overrideInfo{
`eFile`: {},
`runtimeNano`: {},
Expand Down
6 changes: 5 additions & 1 deletion circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ parameters:
go_version:
type: string
default: "1.19.13"
chocolatey_go_version:
type: string
# Chocolatey doesn't have 1.19.13, closest is 1.19.9
default: "1.19.9"
nvm_version:
type: string
default: "0.38.0"
Expand Down Expand Up @@ -171,7 +175,7 @@ jobs:
- run:
name: Install Go
command: |
choco install golang --version="<< pipeline.parameters.go_version >>" -my
choco install golang --version="<< pipeline.parameters.chocolatey_go_version >>" -my
go version
(Get-Command go).Path
[Environment]::SetEnvironmentVariable(
Expand Down
9 changes: 8 additions & 1 deletion tests/gorepo/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,16 @@ var knownFails = map[string]failReason{
// These are new tests in Go 1.18
"fixedbugs/issue46938.go": {category: notApplicable, desc: "tests -d=checkptr compiler mode, which GopherJS doesn't support"},
"fixedbugs/issue47928.go": {category: notApplicable, desc: "//go:nointerface is a part of GOEXPERIMENT=fieldtrack and is not supported by GopherJS"},
"fixedbugs/issue49665.go": {category: other, desc: "attempts to pass -gcflags=-G=3 to enable generics, GopherJS doesn't expect the flag; re-enable in Go 1.19 where the flag is removed"},
"fixedbugs/issue48898.go": {category: other, desc: "https://github.com/gopherjs/gopherjs/issues/1128"},
"fixedbugs/issue48536.go": {category: usesUnsupportedPackage, desc: "https://github.com/gopherjs/gopherjs/issues/1130"},
"fixedbugs/issue53600.go": {category: lowLevelRuntimeDifference, desc: "GopherJS println format is different from Go's"},

// These are new tests in Go 1.19
"fixedbugs/issue50672.go": {category: usesUnsupportedGenerics, desc: "Checking function nesting with one function having a type parameter."},
"fixedbugs/issue53137.go": {category: usesUnsupportedGenerics, desc: "Checking setting type parameter of struct in parameter of a generic function."},
"fixedbugs/issue53309.go": {category: usesUnsupportedGenerics, desc: "Checking unused type parameter in method call to interface"},
"fixedbugs/issue53635.go": {category: usesUnsupportedGenerics, desc: "Checking switch type against nil type with unsupported type parameters"},
"fixedbugs/issue53653.go": {category: lowLevelRuntimeDifference, desc: "GopherJS println format of int64 is different from Go's"},
}

type failCategory uint8
Expand All @@ -164,6 +170,7 @@ const (
neverTerminates // Test never terminates (so avoid starting it).
usesUnsupportedPackage // Test fails because it imports an unsupported package, e.g., "unsafe".
requiresSourceMapSupport // Test fails without source map support (as configured in CI), because it tries to check filename/line number via runtime.Caller.
usesUnsupportedGenerics // Test uses generics (type parameters) that are not currently supported.
compilerPanic
unsureIfGopherJSSupportsThisFeature
lowLevelRuntimeDifference // JavaScript runtime behaves differently from Go in ways that are difficult to work around.
Expand Down