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

Bump go to minimum of 1.21 #2767

Merged
merged 3 commits into from
Mar 21, 2024
Merged

Bump go to minimum of 1.21 #2767

merged 3 commits into from
Mar 21, 2024

Conversation

dtrudg
Copy link
Member

@dtrudg dtrudg commented Mar 21, 2024

Description of the Pull Request (PR):

Update the minimum version of Go to 1.21 so we can bring in dependencies that declare the same.

Doing this as a separate PR as it requires a fix in code using unsafe. for a deprecation to fix a linter failure:

chore: fix unsafe.StringHeader lint

If we are running with a PID namespace, we have a shim process by default. We have code that sets the name of this process to sinit by:

  • Overwriting the value of argv[0]
  • Using PR_SET_NAME

Both are necessary as PR_SET_NAME only affects the value from PR_GET_NAME.

In this code, unsafe.StringHeader is now deprecated. Rewrite using the pattern that takes an unsafe.Slice from an unsafe.StringData to get the raw bytes for the string os.Args[0].

See:

golang/go#53003 (comment)

Before submitting a PR, make sure you have done the following:

dtrudg added 2 commits March 21, 2024 12:17
If we are running with a PID namespace, we have a shim process by
default. We have code that sets the name of this process to `sinit` by:

 * Overwriting the value of argv[0]
 * Using PR_SET_NAME

Both are necessary as PR_SET_NAME only affects the value from
PR_GET_NAME.

In this code, unsafe.StringHeader is now deprecated. Rewrite using the
pattern that takes an unsafe.Slice from an unsafe.StringData to get the
raw bytes for the string os.Args[0].

See:

golang/go#53003 (comment)
@dtrudg dtrudg self-assigned this Mar 21, 2024
@dtrudg dtrudg marked this pull request as ready for review March 21, 2024 13:34
Copy link
Member

@tri-adam tri-adam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one question, thanks!

@dtrudg dtrudg merged commit c690b49 into sylabs:main Mar 21, 2024
1 check passed
@dtrudg dtrudg deleted the bump-go-1.21 branch March 21, 2024 17:24
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 this pull request may close these issues.

2 participants