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

x/build/cmd/release: go1.10.windows-{386,amd64} zip distributions contain "go.exe~" and "dist.exe~" #23894

Closed
DHowett opened this issue Feb 17, 2018 · 16 comments

Comments

@DHowett
Copy link

@DHowett DHowett commented Feb 17, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

1.10

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Windows, 386, amd64

What did you do?

Download the go1.10.windows-amd64.zip archive. Extract it or otherwise inspect its contents.
It seems to contain go/bin/go.exe~

% unzip -l go1.10.windows-amd64.zip | grep "~$"
 11180544  2018-02-16 09:14   go/bin/go.exe~
  3551744  2018-02-16 09:14   go/pkg/tool/windows_amd64/dist.exe~
@dgryski
Copy link
Contributor

@dgryski dgryski commented Feb 17, 2018

@andybons andybons self-assigned this Feb 18, 2018
@andybons andybons changed the title go1.10.windows-{386,amd64} zip distributions contain "go.exe~" and "dist.exe~" x/build/cmd/release: go1.10.windows-{386,amd64} zip distributions contain "go.exe~" and "dist.exe~" Feb 18, 2018
@gopherbot gopherbot added this to the Unreleased milestone Feb 18, 2018
@gopherbot gopherbot added the Builders label Feb 18, 2018
@larrylau
Copy link

@larrylau larrylau commented Mar 30, 2018

what go.exe~ and dist.exe~ can do?
go1.10.1 same.

@andybons
Copy link
Member

@andybons andybons commented Mar 30, 2018

This is a matter of simply not cleaning up everything when building the release via our automated process. This will be fixed.

@vbmade2000
Copy link

@vbmade2000 vbmade2000 commented Apr 26, 2018

@andybons Is this issue open for work ?

@andybons
Copy link
Member

@andybons andybons commented Apr 26, 2018

@vbmade2000 meaning is it available for you to work on it? Sure.

@vbmade2000
Copy link

@vbmade2000 vbmade2000 commented Apr 27, 2018

@andybons Cool. Thanks.

@andybons
Copy link
Member

@andybons andybons commented May 3, 2018

@alexbrainman any idea what’s going on?

@vbmade2000
Copy link

@vbmade2000 vbmade2000 commented May 3, 2018

@andybons Nope. Didn't get time to investigate it. I'll check today.

@alexbrainman
Copy link
Member

@alexbrainman alexbrainman commented May 3, 2018

@alexbrainman any idea what’s going on?

go.exe~ file is created when go.exe rebuilds itself.

When Windows process is running, its executable cannot be deleted. So how would go.exe replace its executable when it needs to rebuild itself? As we discovered long time ago, you cannot delete executable, but it is OK to rename executable. So that is what we do - when go.exe try to replace itself and fails, it renames go.exe into go.exe~, and then it can write new go.exe. That leaves go.exe~ behind, because cmd/go process still cannot remove go.exe~. go.exe~ can be removed later once its process exits, but I suspect we never bother to do that.

It would be the same story for dist.exe~.

You can search for On Windows, remove lingering ~ file from last attempt. in your GOROOT for details.

I suspect (I did not actually check) you should just modify release.go to have postBuildCleanFiles include both go.exe~ and dist.exe~ files.

I hope it helps.

Alex

@vbmade2000
Copy link

@vbmade2000 vbmade2000 commented May 3, 2018

I was able to reproduce the issue. There are files called go.exe~ and dist.exe~ in go1.10.2.windows-amd64.zip file.

I checked SHA256 value and found it same as given on download site.
The go.exe~ is a go executable showing version 1.10.2. File size is less than original go.exe file.
I tried to check msi file by extracting it but didn't get sensible output to come to some conclusion.

@vbmade2000
Copy link

@vbmade2000 vbmade2000 commented May 3, 2018

@alexbrainman Makes sense. I want to test your suggestion. Can you tell me how to do that on local system ?

@andybons
Copy link
Member

@andybons andybons commented May 3, 2018

@alexbrainman that helps immensely. Thank you :)

@vbmade2000
Copy link

@vbmade2000 vbmade2000 commented May 3, 2018

@andybons Can I create CL for that ?

@andybons andybons removed their assignment May 3, 2018
@andybons
Copy link
Member

@andybons andybons commented May 3, 2018

@vbmade2000 yep. go for it.

@gopherbot
Copy link

@gopherbot gopherbot commented May 4, 2018

Change https://golang.org/cl/111375 mentions this issue: x/build/cmd/release: clean go.exe~ and dist.exe~ after build finishes

@bradfitz bradfitz modified the milestones: Unreleased, Go1.11 May 4, 2018
@gopherbot
Copy link

@gopherbot gopherbot commented May 4, 2018

Change https://golang.org/cl/111518 mentions this issue: cmd/release: clean up .exe~ files on Windows

@golang golang locked and limited conversation to collaborators May 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
8 participants
You can’t perform that action at this time.