Skip to content

os: use GetTempPath2 on Windows if available #57980

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
wants to merge 1 commit into from

Conversation

nwnt
Copy link
Contributor

@nwnt nwnt commented Jan 25, 2023

This generates GetTempPath2. Go now tries to determine if the windows it runs on has GetTempPath2 by finding it only once at the loading time. If GetTempPath2 exists, it sets the flag so that any calls to tempDir will use it. If it doesn't exist, Go then uses GetTempPath.

GetTempPath2 was generated into internal/syscall/windows since syscall is locked down.

Fixes #56899

@google-cla
Copy link

google-cla bot commented Jan 25, 2023

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@nwnt nwnt force-pushed the os-tempdir-windows-gettemppath2 branch from 214628f to eb3dacf Compare January 25, 2023 05:33
@gopherbot
Copy link
Contributor

This PR (HEAD: eb3dacf) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/463219 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Quim Muntal:

Patch Set 1: Run-TryBot+1

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/463219.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/463219.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 1: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/463219.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Bryan Mills:

Patch Set 1: Code-Review+1

(3 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/463219.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Damien Neil:

Patch Set 1:

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/463219.
After addressing review feedback, remember to publish your drafts!

@nwnt nwnt force-pushed the os-tempdir-windows-gettemppath2 branch from eb3dacf to 34a8a96 Compare January 26, 2023 06:26
@gopherbot
Copy link
Contributor

This PR (HEAD: 34a8a96) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/463219 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@nwnt nwnt force-pushed the os-tempdir-windows-gettemppath2 branch from 34a8a96 to 152a736 Compare January 26, 2023 06:52
@gopherbot
Copy link
Contributor

This PR (HEAD: 152a736) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/463219 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@nwnt nwnt force-pushed the os-tempdir-windows-gettemppath2 branch from 152a736 to 97b83bc Compare January 26, 2023 06:55
@nwnt nwnt changed the title os: TempDir uses GetTempPath2 on Windows if available os: use GetTempPath2 on Windows if available Jan 26, 2023
@gopherbot
Copy link
Contributor

This PR (HEAD: 97b83bc) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/463219 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@bcmills
Copy link
Contributor

bcmills commented Jan 26, 2023

If the Gerrit comments have been addressed, please mark them as resolved in Gerrit (and don't forget to publish the replies).

This generates GetTempPath2. Go now tries to determine if the windows
it runs on has GetTempPath2 by finding it only once at the loading time.
If GetTempPath2 exists, it sets the flag so that any calls to tempDir
will use it. If it doesn't exist, Go then uses GetTempPath.
GetTempPath2 was generated into internal/syscall/windows since
syscall is locked down.

Fixes golang#56899
@nwnt nwnt force-pushed the os-tempdir-windows-gettemppath2 branch from 97b83bc to b779389 Compare January 27, 2023 05:51
@gopherbot
Copy link
Contributor

This PR (HEAD: b779389) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/463219 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Thanonchai W:

Patch Set 5:

(8 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/463219.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Quim Muntal:

Patch Set 5: Code-Review+2 Run-TryBot+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/463219.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 5:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/463219.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Gopher Robot:

Patch Set 5: TryBot-Result+1

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/463219.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Dmitri Shuralyov:

Patch Set 5: Code-Review+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/463219.
After addressing review feedback, remember to publish your drafts!

gopherbot pushed a commit that referenced this pull request Jan 28, 2023
This generates GetTempPath2. Go now tries to determine if the windows it runs on has GetTempPath2 by finding it only once at the loading time. If GetTempPath2 exists, it sets the flag so that any calls to tempDir will use it. If it doesn't exist, Go then uses GetTempPath.

GetTempPath2 was generated into internal/syscall/windows since syscall is locked down.

Fixes #56899

Change-Id: Iff08502aebc787fde802ee9496c070c982fbdc08
GitHub-Last-Rev: b779389
GitHub-Pull-Request: #57980
Reviewed-on: https://go-review.googlesource.com/c/go/+/463219
Run-TryBot: Quim Muntal <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
Reviewed-by: Quim Muntal <[email protected]>
Reviewed-by: Dmitri Shuralyov <[email protected]>
@gopherbot
Copy link
Contributor

This PR is being closed because golang.org/cl/463219 has been merged.

@gopherbot gopherbot closed this Jan 28, 2023
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.

os: TempDir should use GetTempPath2 when available on Windows
3 participants