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

cmd/link: generate manifest in EXE files #17835

Open
quentinmit opened this Issue Nov 7, 2016 · 9 comments

Comments

Projects
None yet
8 participants
@quentinmit
Contributor

quentinmit commented Nov 7, 2016

On Windows 10 and later, apps can opt into long path support by embedding an XML manifest:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx

We should automatically embed this manifest when linking EXE files. For prior art, see this third-party tool for generating a .syso file containing a manifest:

josephspurrier/goversioninfo@f8c5d36#diff-88fef3681df95cd75f2ac89251404081

@quentinmit quentinmit added this to the Go1.9Early milestone Nov 7, 2016

@minux

This comment has been minimized.

Member

minux commented Nov 8, 2016

@quentinmit

This comment has been minimized.

Contributor

quentinmit commented Nov 8, 2016

I'm proposing the former for a start, since it doesn't require any UI changes.

Presumably any fix should continue to allow a user-specified .syso file to override the manifest.

@minux

This comment has been minimized.

Member

minux commented Nov 8, 2016

@alexbrainman

This comment has been minimized.

Member

alexbrainman commented Nov 8, 2016

We should automatically embed this manifest when linking EXE files. For prior art, see this third-party tool for generating a .syso file containing a manifest:

It is probably not important, but do you plan to generate .syso file with the manifest and link it with the executable, or modify linker to append manifest as executable is built?

Alex

@bradfitz bradfitz modified the milestones: Go1.10Early, Go1.9Early May 3, 2017

@bradfitz bradfitz modified the milestones: Go1.10Early, Go1.10 Jun 14, 2017

@rsc

This comment has been minimized.

Contributor

rsc commented Nov 22, 2017

What would the benefit be if we made this change? Now that we use long path syntax transparently in the Go APIs I don't see what adding the XML manifest would add (other than XML).

@rsc rsc modified the milestones: Go1.10, Go1.11 Nov 22, 2017

@fkollmann

This comment has been minimized.

fkollmann commented Mar 8, 2018

The main benefit is that the syscall.GetVersion() number would return the correct Windows version.

Applications not manifested for Windows 8.1 or Windows 10 will return the Windows 8 OS version value (6.2).

see https://msdn.microsoft.com/en-us/library/windows/desktop/ms724439

@fkollmann

This comment has been minimized.

fkollmann commented Mar 9, 2018

Example:

winver, _ := syscall.GetVersion()

fmt.Printf("Windows version: %v.%v.%v", byte(winver), byte(winver>>8), uint16(winver>>18))

With manifest: Windows version: 10.0.4074
Without manifest: Windows version: 6.2.2300

@fkollmann

This comment has been minimized.

fkollmann commented Mar 9, 2018

@quentinmit thanks for the hint on goversioninfo. This is how we currently approach it: https://github.com/konsorten/ktn-build-info/blob/master/ver/go.go

@bradfitz bradfitz modified the milestones: Go1.11, Go1.12 May 18, 2018

@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Jun 1, 2018

@andlabs

This comment has been minimized.

Contributor

andlabs commented Sep 2, 2018

Note that the gcc that comes with MSYS2 under default configurations forces a manifest to be included; see Alexpux/MSYS2-packages#454 In a cgo build, it gets included in the output _cgo_.o file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment