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

Go: Support 1.24 #18306

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
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: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ use_repo(
)

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(version = "1.23.1")
go_sdk.download(version = "1.24rc1")

go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
go_deps.from_file(go_mod = "//go/extractor:go.mod")
Expand Down
2 changes: 1 addition & 1 deletion go/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ inputs:
go-test-version:
description: Which Go version to use for running the tests
required: false
default: "~1.23.1"
default: "1.24.0-rc.1"
run-code-checks:
description: Whether to run formatting, code and qhelp generation checks
required: false
Expand Down
2 changes: 1 addition & 1 deletion go/extractor/autobuilder/build-environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

var minGoVersion = util.NewSemVer("1.11")
var maxGoVersion = util.NewSemVer("1.23")
var maxGoVersion = util.NewSemVer("1.24")

type versionInfo struct {
goModVersion util.SemVer // The version of Go found in the go directive in the `go.mod` file.
Expand Down
8 changes: 4 additions & 4 deletions go/extractor/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -475,12 +475,12 @@ func extractObjects(tw *trap.Writer, scope *types.Scope, scopeLabel trap.Label)
populateTypeParamParents(funcObj.Type().(*types.Signature).TypeParams(), obj)
populateTypeParamParents(funcObj.Type().(*types.Signature).RecvTypeParams(), obj)
}
// Populate type parameter parents for named types. Note that we
// skip type aliases as the original type should be the parent
// of any type parameters.
if typeNameObj, ok := obj.(*types.TypeName); ok && !typeNameObj.IsAlias() {
// Populate type parameter parents for named types.
if typeNameObj, ok := obj.(*types.TypeName); ok {
if tp, ok := typeNameObj.Type().(*types.Named); ok {
populateTypeParamParents(tp.TypeParams(), obj)
} else if tp, ok := typeNameObj.Type().(*types.Alias); ok {
populateTypeParamParents(tp.TypeParams(), obj)
}
}
extractObject(tw, obj, lbl)
Expand Down
4 changes: 2 additions & 2 deletions go/extractor/go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/github/codeql-go/extractor

go 1.23
go 1.24

toolchain go1.23.1
toolchain go1.24rc1

// when updating this, run
// bazel run @rules_go//go -- mod tidy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,61 @@ numberOfTypeParameters
| internal/bytealg.HashStrRev | 0 | T | interface { string \| []uint8 } |
| internal/bytealg.IndexRabinKarp | 0 | T | interface { string \| []uint8 } |
| internal/bytealg.LastIndexRabinKarp | 0 | T | interface { string \| []uint8 } |
| internal/poll.ignoringEINTR2 | 0 | T | interface { } |
| internal/runtime/atomic.Pointer.CompareAndSwap | 0 | T | interface { } |
| internal/runtime/atomic.Pointer.CompareAndSwapNoWB | 0 | T | interface { } |
| internal/runtime/atomic.Pointer.Load | 0 | T | interface { } |
| internal/runtime/atomic.Pointer.Store | 0 | T | interface { } |
| internal/runtime/atomic.Pointer.StoreNoWB | 0 | T | interface { } |
| internal/sync.HashTrieMap.All | 0 | K | comparable |
| internal/sync.HashTrieMap.All | 1 | V | interface { } |
| internal/sync.HashTrieMap.CompareAndDelete | 0 | K | comparable |
| internal/sync.HashTrieMap.CompareAndDelete | 1 | V | interface { } |
| internal/sync.HashTrieMap.CompareAndSwap | 0 | K | comparable |
| internal/sync.HashTrieMap.CompareAndSwap | 1 | V | interface { } |
| internal/sync.HashTrieMap.Delete | 0 | K | comparable |
| internal/sync.HashTrieMap.Load | 0 | K | comparable |
| internal/sync.HashTrieMap.Load | 1 | V | interface { } |
| internal/sync.HashTrieMap.LoadAndDelete | 0 | K | comparable |
| internal/sync.HashTrieMap.LoadAndDelete | 1 | V | interface { } |
| internal/sync.HashTrieMap.LoadOrStore | 0 | K | comparable |
| internal/sync.HashTrieMap.LoadOrStore | 1 | V | interface { } |
| internal/sync.HashTrieMap.Range | 0 | K | comparable |
| internal/sync.HashTrieMap.Range | 1 | V | interface { } |
| internal/sync.HashTrieMap.Store | 0 | K | comparable |
| internal/sync.HashTrieMap.Store | 1 | V | interface { } |
| internal/sync.HashTrieMap.Swap | 0 | K | comparable |
| internal/sync.HashTrieMap.Swap | 1 | V | interface { } |
| internal/sync.HashTrieMap.find | 0 | K | comparable |
| internal/sync.HashTrieMap.find | 1 | V | interface { } |
| internal/sync.HashTrieMap.iter | 0 | K | comparable |
| internal/sync.HashTrieMap.iter | 1 | V | interface { } |
| internal/sync.entry | 0 | K | comparable |
| internal/sync.entry.compareAndDelete | 0 | K | comparable |
| internal/sync.entry.compareAndDelete | 1 | V | interface { } |
| internal/sync.entry.compareAndSwap | 0 | K | comparable |
| internal/sync.entry.compareAndSwap | 1 | V | interface { } |
| internal/sync.entry.loadAndDelete | 0 | K | comparable |
| internal/sync.entry.loadAndDelete | 1 | V | interface { } |
| internal/sync.entry.lookup | 0 | K | comparable |
| internal/sync.entry.lookup | 1 | V | interface { } |
| internal/sync.entry.lookupWithValue | 0 | K | comparable |
| internal/sync.entry.lookupWithValue | 1 | V | interface { } |
| internal/sync.entry.swap | 0 | K | comparable |
| internal/sync.entry.swap | 1 | V | interface { } |
| internal/sync.newEntryNode | 0 | K | comparable |
| internal/sync.newEntryNode | 1 | V | interface { } |
| iter.Pull | 0 | V | interface { } |
| iter.Pull2 | 0 | K | interface { } |
| iter.Pull2 | 1 | V | interface { } |
| iter.Seq | 0 | V | interface { } |
| iter.Seq2 | 0 | K | interface { } |
| iter.Seq2 | 1 | V | interface { } |
| os.doInRoot | 0 | T | interface { } |
| os.ignoringEINTR2 | 0 | T | interface { } |
| reflect.rangeNum | 1 | N | interface { int64 \| uint64 } |
| runtime.AddCleanup | 0 | T | interface { } |
| runtime.AddCleanup | 1 | S | interface { } |
| runtime.fandbits | 0 | F | floaty |
| runtime.fmax | 0 | F | floaty |
| runtime.fmin | 0 | F | floaty |
Expand Down
8 changes: 8 additions & 0 deletions go/ql/test/library-tests/semmle/go/Types/Aliases.expected
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ entities
| aliases.go | aliases.go:22:6:22:6 | T | 1 | aliases.go:19:6:19:7 | S3 |
| aliases.go | aliases.go:25:6:25:6 | H | 1 | file://:0:0:0:0 | signature type |
| aliases.go | aliases.go:25:8:25:11 | Afs3 | 1 | aliases.go:19:6:19:7 | S3 |
| aliases.go | aliases.go:29:6:29:11 | MyType | 1 | aliases.go:29:6:29:11 | MyType |
| aliases.go | aliases.go:29:13:29:19 | MyTypeT | 1 | file://:0:0:0:0 | type parameter type |
| aliases.go | aliases.go:29:34:29:34 | x | 1 | file://:0:0:0:0 | type parameter type |
| aliases.go | aliases.go:32:6:32:16 | MyTypeAlias | 1 | aliases.go:29:6:29:11 | MyType |
| aliases.go | aliases.go:32:18:32:29 | MyTypeAliasT | 1 | file://:0:0:0:0 | type parameter type |
| aliases.go | aliases.go:34:6:34:19 | useMyTypeAlias | 1 | file://:0:0:0:0 | signature type |
| aliases.go | aliases.go:34:21:34:21 | a | 1 | aliases.go:29:6:29:11 | MyType |
| aliases.go | aliases.go:35:2:35:2 | b | 1 | aliases.go:29:6:29:11 | MyType |
#select
| F | func(struct { x int }) int |
| G | func(struct { x int }) int |
Expand Down
119 changes: 60 additions & 59 deletions go/ql/test/library-tests/semmle/go/Types/Field_getPackage.expected
Original file line number Diff line number Diff line change
@@ -1,59 +1,60 @@
| aliases.go:6:26:6:26 | x | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| aliases.go:8:26:8:26 | x | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| aliases.go:19:17:19:17 | x | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| cyclic.go:4:3:4:3 | s | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| cyclic.go:8:3:8:3 | u | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| cyclic.go:9:2:9:2 | f | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| cyclic.go:13:2:13:2 | t | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| cyclic.go:17:2:17:2 | s | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| depth.go:6:2:6:2 | b | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| depth.go:7:2:7:2 | c | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| depth.go:11:2:11:2 | f | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| depth.go:15:2:15:2 | d | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| depth.go:19:2:19:2 | f | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| embedded.go:4:2:4:2 | A | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| embedded.go:8:3:8:5 | Baz | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| embedded.go:12:2:12:4 | Qux | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| embedded.go:13:2:13:4 | Baz | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| generic.go:4:2:4:11 | valueField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| generic.go:5:2:5:13 | pointerField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| generic.go:6:2:6:11 | arrayField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| generic.go:7:2:7:11 | sliceField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| generic.go:8:2:8:9 | mapField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| generic.go:12:2:12:13 | pointerField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| generic.go:16:2:16:5 | root | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| generic.go:20:2:20:12 | structField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| generic.go:21:2:21:9 | mapField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| generic.go:25:2:25:12 | structField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| generic.go:29:2:29:13 | pointerField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| main.go:18:7:18:15 | NameClash | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| pkg1/embedding.go:19:23:19:26 | base | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/embedding.go:22:27:22:30 | base | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/embedding.go:25:24:25:31 | embedder | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/embedding.go:28:24:28:31 | embedder | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/embedding.go:36:2:36:5 | base | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/embedding.go:37:2:37:2 | f | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/promotedStructs.go:5:2:5:7 | SField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/promotedStructs.go:14:2:14:7 | PField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/promotedStructs.go:22:22:22:22 | S | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/promotedStructs.go:25:22:25:22 | P | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:6:2:6:2 | f | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:7:2:7:4 | Foo | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:8:2:8:4 | Bar | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:12:2:12:4 | Foo | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:13:2:13:4 | Bar | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:17:3:17:5 | Foo | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:18:3:18:5 | Bar | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:22:3:22:5 | Foo | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:23:2:23:4 | Bar | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:27:2:27:4 | val | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:28:2:28:5 | flag | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:32:2:32:5 | flag | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg1/tst.go:62:7:62:15 | NameClash | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg1 |
| pkg2/tst.go:4:2:4:2 | g | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg2 |
| pkg2/tst.go:8:2:8:2 | g | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg2 |
| pkg2/tst.go:17:2:17:8 | NCField | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types/pkg2 |
| struct_tags.go:4:2:4:7 | field1 | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| struct_tags.go:5:2:5:7 | field2 | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| struct_tags.go:9:2:9:7 | field1 | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| struct_tags.go:10:2:10:7 | field2 | package github.com/github/codeql-go/ql/test/library-tests/semmle/go/Types |
| aliases.go:6:26:6:26 | x | package codeql-go-types |
| aliases.go:8:26:8:26 | x | package codeql-go-types |
| aliases.go:19:17:19:17 | x | package codeql-go-types |
| aliases.go:29:34:29:34 | x | package codeql-go-types |
| cyclic.go:4:3:4:3 | s | package codeql-go-types |
| cyclic.go:8:3:8:3 | u | package codeql-go-types |
| cyclic.go:9:2:9:2 | f | package codeql-go-types |
| cyclic.go:13:2:13:2 | t | package codeql-go-types |
| cyclic.go:17:2:17:2 | s | package codeql-go-types |
| depth.go:6:2:6:2 | b | package codeql-go-types |
| depth.go:7:2:7:2 | c | package codeql-go-types |
| depth.go:11:2:11:2 | f | package codeql-go-types |
| depth.go:15:2:15:2 | d | package codeql-go-types |
| depth.go:19:2:19:2 | f | package codeql-go-types |
| embedded.go:4:2:4:2 | A | package codeql-go-types |
| embedded.go:8:3:8:5 | Baz | package codeql-go-types |
| embedded.go:12:2:12:4 | Qux | package codeql-go-types |
| embedded.go:13:2:13:4 | Baz | package codeql-go-types |
| generic.go:4:2:4:11 | valueField | package codeql-go-types |
| generic.go:5:2:5:13 | pointerField | package codeql-go-types |
| generic.go:6:2:6:11 | arrayField | package codeql-go-types |
| generic.go:7:2:7:11 | sliceField | package codeql-go-types |
| generic.go:8:2:8:9 | mapField | package codeql-go-types |
| generic.go:12:2:12:13 | pointerField | package codeql-go-types |
| generic.go:16:2:16:5 | root | package codeql-go-types |
| generic.go:20:2:20:12 | structField | package codeql-go-types |
| generic.go:21:2:21:9 | mapField | package codeql-go-types |
| generic.go:25:2:25:12 | structField | package codeql-go-types |
| generic.go:29:2:29:13 | pointerField | package codeql-go-types |
| main.go:18:7:18:15 | NameClash | package codeql-go-types |
| pkg1/embedding.go:19:23:19:26 | base | package codeql-go-types/pkg1 |
| pkg1/embedding.go:22:27:22:30 | base | package codeql-go-types/pkg1 |
| pkg1/embedding.go:25:24:25:31 | embedder | package codeql-go-types/pkg1 |
| pkg1/embedding.go:28:24:28:31 | embedder | package codeql-go-types/pkg1 |
| pkg1/embedding.go:36:2:36:5 | base | package codeql-go-types/pkg1 |
| pkg1/embedding.go:37:2:37:2 | f | package codeql-go-types/pkg1 |
| pkg1/promotedStructs.go:5:2:5:7 | SField | package codeql-go-types/pkg1 |
| pkg1/promotedStructs.go:14:2:14:7 | PField | package codeql-go-types/pkg1 |
| pkg1/promotedStructs.go:22:22:22:22 | S | package codeql-go-types/pkg1 |
| pkg1/promotedStructs.go:25:22:25:22 | P | package codeql-go-types/pkg1 |
| pkg1/tst.go:6:2:6:2 | f | package codeql-go-types/pkg1 |
| pkg1/tst.go:7:2:7:4 | Foo | package codeql-go-types/pkg1 |
| pkg1/tst.go:8:2:8:4 | Bar | package codeql-go-types/pkg1 |
| pkg1/tst.go:12:2:12:4 | Foo | package codeql-go-types/pkg1 |
| pkg1/tst.go:13:2:13:4 | Bar | package codeql-go-types/pkg1 |
| pkg1/tst.go:17:3:17:5 | Foo | package codeql-go-types/pkg1 |
| pkg1/tst.go:18:3:18:5 | Bar | package codeql-go-types/pkg1 |
| pkg1/tst.go:22:3:22:5 | Foo | package codeql-go-types/pkg1 |
| pkg1/tst.go:23:2:23:4 | Bar | package codeql-go-types/pkg1 |
| pkg1/tst.go:27:2:27:4 | val | package codeql-go-types/pkg1 |
| pkg1/tst.go:28:2:28:5 | flag | package codeql-go-types/pkg1 |
| pkg1/tst.go:32:2:32:5 | flag | package codeql-go-types/pkg1 |
| pkg1/tst.go:62:7:62:15 | NameClash | package codeql-go-types/pkg1 |
| pkg2/tst.go:4:2:4:2 | g | package codeql-go-types/pkg2 |
| pkg2/tst.go:8:2:8:2 | g | package codeql-go-types/pkg2 |
| pkg2/tst.go:17:2:17:8 | NCField | package codeql-go-types/pkg2 |
| struct_tags.go:4:2:4:7 | field1 | package codeql-go-types |
| struct_tags.go:5:2:5:7 | field2 | package codeql-go-types |
| struct_tags.go:9:2:9:7 | field1 | package codeql-go-types |
| struct_tags.go:10:2:10:7 | field2 | package codeql-go-types |
Loading
Loading