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

Fix offsetgen #781

Merged
merged 3 commits into from
Apr 24, 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
272 changes: 3 additions & 269 deletions internal/pkg/inject/offset_results.json
Original file line number Diff line number Diff line change
Expand Up @@ -787,30 +787,6 @@
"0.4.46",
"0.4.47"
]
},
{
"offset": 24,
"versions": [
"0.1.0",
"0.2.0",
"0.2.1",
"0.2.2",
"0.2.3",
"0.2.4",
"0.2.5",
"0.3.0",
"0.3.1",
"0.3.2",
"0.3.3",
"0.3.4",
"0.3.5",
"0.3.6",
"0.3.7",
"0.3.8",
"0.3.9",
"0.3.10",
"0.4.0"
]
}
]
}
Expand Down Expand Up @@ -892,13 +868,6 @@
{
"offset": 64,
"versions": [
"0.2.2",
"0.2.3",
"0.3.0",
"0.4.0",
"0.4.1",
"0.4.2",
"0.4.3",
"1.20.0",
"1.21.0",
"1.22.0",
Expand Down Expand Up @@ -1020,28 +989,6 @@
{
"offset": 24,
"versions": [
"1.0.0",
"1.0.1-GA",
"1.0.2",
"1.0.3",
"1.0.4",
"1.0.5",
"1.2.0",
"1.2.1",
"1.3.0",
"1.4.0",
"1.4.1",
"1.4.2",
"1.5.0",
"1.5.1",
"1.5.2",
"1.6.0",
"1.7.0",
"1.7.1",
"1.7.2",
"1.7.3",
"1.7.4",
"1.7.5",
"1.8.0",
"1.8.2",
"1.9.0",
Expand Down Expand Up @@ -1213,6 +1160,7 @@
{
"offset": 24,
"versions": [
"1.14.0",
"1.15.0",
"1.16.0",
"1.17.0",
Expand All @@ -1239,41 +1187,6 @@
{
"offset": 32,
"versions": [
"1.0.0",
"1.0.1-GA",
"1.0.2",
"1.0.3",
"1.0.4",
"1.3.0",
"1.4.0",
"1.4.1",
"1.4.2",
"1.5.0",
"1.5.1",
"1.5.2",
"1.6.0",
"1.7.0",
"1.7.1",
"1.7.2",
"1.7.3",
"1.7.4",
"1.7.5",
"1.8.0",
"1.8.2",
"1.9.0",
"1.9.1",
"1.9.2",
"1.10.0",
"1.10.1",
"1.11.0",
"1.11.1",
"1.11.2",
"1.11.3",
"1.12.0",
"1.12.1",
"1.12.2",
"1.13.0",
"1.14.0",
"1.25.0",
"1.25.1",
"1.26.0",
Expand Down Expand Up @@ -1398,43 +1311,6 @@
{
"offset": 0,
"versions": [
"1.0.0",
"1.0.1-GA",
"1.0.2",
"1.0.3",
"1.0.4",
"1.0.5",
"1.2.0",
"1.2.1",
"1.3.0",
"1.4.0",
"1.4.1",
"1.4.2",
"1.5.0",
"1.5.1",
"1.5.2",
"1.6.0",
"1.7.0",
"1.7.1",
"1.7.2",
"1.7.3",
"1.7.4",
"1.7.5",
"1.8.0",
"1.8.2",
"1.9.0",
"1.9.1",
"1.9.2",
"1.10.0",
"1.10.1",
"1.11.0",
"1.11.1",
"1.11.2",
"1.11.3",
"1.12.0",
"1.12.1",
"1.12.2",
"1.13.0",
"1.14.0",
"1.15.0",
"1.16.0",
Expand Down Expand Up @@ -1581,6 +1457,7 @@
{
"offset": 64,
"versions": [
"1.14.0",
"1.15.0",
"1.16.0",
"1.17.0",
Expand Down Expand Up @@ -1649,41 +1526,6 @@
{
"offset": 80,
"versions": [
"1.0.0",
"1.0.1-GA",
"1.0.2",
"1.0.3",
"1.0.4",
"1.3.0",
"1.4.0",
"1.4.1",
"1.4.2",
"1.5.0",
"1.5.1",
"1.5.2",
"1.6.0",
"1.7.0",
"1.7.1",
"1.7.2",
"1.7.3",
"1.7.4",
"1.7.5",
"1.8.0",
"1.8.2",
"1.9.0",
"1.9.1",
"1.9.2",
"1.10.0",
"1.10.1",
"1.11.0",
"1.11.1",
"1.11.2",
"1.11.3",
"1.12.0",
"1.12.1",
"1.12.2",
"1.13.0",
"1.14.0",
"1.37.0",
"1.37.1",
"1.38.0-dev",
Expand Down Expand Up @@ -1776,43 +1618,6 @@
{
"offset": 8,
"versions": [
"1.0.0",
"1.0.1-GA",
"1.0.2",
"1.0.3",
"1.0.4",
"1.0.5",
"1.2.0",
"1.2.1",
"1.3.0",
"1.4.0",
"1.4.1",
"1.4.2",
"1.5.0",
"1.5.1",
"1.5.2",
"1.6.0",
"1.7.0",
"1.7.1",
"1.7.2",
"1.7.3",
"1.7.4",
"1.7.5",
"1.8.0",
"1.8.2",
"1.9.0",
"1.9.1",
"1.9.2",
"1.10.0",
"1.10.1",
"1.11.0",
"1.11.1",
"1.11.2",
"1.11.3",
"1.12.0",
"1.12.1",
"1.12.2",
"1.13.0",
"1.14.0",
"1.15.0",
"1.16.0",
Expand Down Expand Up @@ -1959,43 +1764,6 @@
{
"offset": 0,
"versions": [
"1.0.0",
"1.0.1-GA",
"1.0.2",
"1.0.3",
"1.0.4",
"1.0.5",
"1.2.0",
"1.2.1",
"1.3.0",
"1.4.0",
"1.4.1",
"1.4.2",
"1.5.0",
"1.5.1",
"1.5.2",
"1.6.0",
"1.7.0",
"1.7.1",
"1.7.2",
"1.7.3",
"1.7.4",
"1.7.5",
"1.8.0",
"1.8.2",
"1.9.0",
"1.9.1",
"1.9.2",
"1.10.0",
"1.10.1",
"1.11.0",
"1.11.1",
"1.11.2",
"1.11.3",
"1.12.0",
"1.12.1",
"1.12.2",
"1.13.0",
"1.14.0",
"1.15.0",
"1.16.0",
Expand Down Expand Up @@ -2233,6 +2001,7 @@
{
"offset": 356,
"versions": [
"1.14.0",
"1.15.0",
"1.16.0",
"1.17.0",
Expand All @@ -2258,36 +2027,6 @@
{
"offset": 404,
"versions": [
"1.3.0",
"1.4.0",
"1.4.1",
"1.4.2",
"1.5.0",
"1.5.1",
"1.5.2",
"1.6.0",
"1.7.0",
"1.7.1",
"1.7.2",
"1.7.3",
"1.7.4",
"1.7.5",
"1.8.0",
"1.8.2",
"1.9.0",
"1.9.1",
"1.9.2",
"1.10.0",
"1.10.1",
"1.11.0",
"1.11.1",
"1.11.2",
"1.11.3",
"1.12.0",
"1.12.1",
"1.12.2",
"1.13.0",
"1.14.0",
"1.58.0",
"1.58.1",
"1.58.2",
Expand All @@ -2312,11 +2051,6 @@
{
"offset": 412,
"versions": [
"1.0.0",
"1.0.1-GA",
"1.0.2",
"1.0.3",
"1.0.4",
"1.52.0",
"1.52.1",
"1.52.3",
Expand Down
3 changes: 2 additions & 1 deletion internal/pkg/structfield/structfield.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
"encoding/json"
"fmt"
"sort"
"strings"
"sync"

"github.com/hashicorp/go-version"
Expand Down Expand Up @@ -248,7 +249,7 @@ func (o *Offsets) Get(ver *version.Version) (uint64, bool) {
v, ok := o.values[newVerKey(ver)]
o.mu.RUnlock()

if !ok && o.uo.valid {
if strings.HasPrefix(ver.String(), "0.0.0") && !ok && o.uo.valid {
// If we don't have the exact version, but we only have one offset, we
// fallback to use that offset. This can happen when a non official version is being used
// which contains commit hash in the version string.
Expand Down
Loading
Loading