-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: Windows -H windowsgui stopped working in Go 1.10? #24232
Comments
@devorel I cannot reproduce this. I did this:
and then I double clicked on %TMP%\a.exe. I don't see any window console. What did I do wrong? Thank you. Alex |
You are use with shrot process.
If u use with server in the Background you need hold your process .
I dont need window console for that..
בתאריך 4 במרץ 2018 04:54, "Alex Brainman" <[email protected]> כתב:
@devorel <https://github.com/devorel> I cannot reproduce this. I did this:
c:\>go version
go version go1.10 windows/amd64
c:\>go build -ldflags "-H windowsgui" -v -o %tmp%\a.exe
github.com/alexbrainman/gowingui
c:\>
and then I double clicked on %TMP%\a.exe. I don't see any window console.
What did I do wrong?
Thank you.
Alex
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24232 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQGRbMS6P-wfFPRlDnW-9wgBxvroTD-4ks5ta1digaJpZM4SbIa9>
.
|
@devorel I don't understand your explanation. Please, try again. Thank you Alex |
look
this flug "windowsgui" need to cancel the window console
2018-03-04 8:11 GMT+02:00 Alex Brainman <[email protected]>:
… @devorel <https://github.com/devorel> I don't understand your
explanation. Please, try again.
Thank you
Alex
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24232 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQGRbGKA3GfzioH9g21mWe1-kn91DFSiks5ta4WggaJpZM4SbIa9>
.
|
I don't get any console windows. Both at version 1.9 and 1.10. How did you build your executable? Did you see my command there #24232 (comment) ? Alex |
Hi https://golang.org/dl/ |
Looking at your screenshot, I can see you did something completely different. You used \ instead of / in your import path. Do not do that. Really use
command. Alex |
i tried but i have the problem yet.
with 1.94 i dont have any problem!!!!
2018-03-04 10:30 GMT+02:00 Alex Brainman <[email protected]>:
… go build -ldflags "-H windowsgui" -v -o %tmp%\a.exe
github.com/alexbrainman/gowingui
Looking at your screenshot, I can see you did something completely
different. You used \ instead of / in your import path. Do not do that.
Really use
go build -ldflags "-H windowsgui" -v -o %tmp%\a.exe github.com/alexbrainman/gowingui
command.
Alex
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24232 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQGRbLqz-bzIyaZ_AErSRQ0QuzQDNvALks5ta6YOgaJpZM4SbIa9>
.
|
I don't know how to reproduce your problem here. Sorry. Alex |
I don't also..
But i say .
You have a problem with the flags in the last version!
בתאריך 4 במרץ 2018 22:51, "Alex Brainman" <[email protected]> כתב:
… I don't know how to reproduce your problem here. Sorry.
Alex
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24232 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQGRbIbk9LJs04TFPaSFN-f8uwbcvV7Rks5tbFPrgaJpZM4SbIa9>
.
|
I've built a library that uses the @alexbrainman which windows are you testing on? |
Perhaps your users use wrong import path to build their program, like I described in #24233. That will make Go 1.10 build executable without IMAGE_SUBSYSTEM_WINDOWS_GUI flag set.
Windows 10. Alex |
NO, it's not!
i v1.94 it's work good!
i copied the command of alexbrainman <https://github.com/alexbrainman> ,and
i get the window console yet
2018-03-06 10:52 GMT+02:00 Alex Brainman <[email protected]>:
… @asticode <https://github.com/asticode>
some of my users are complaining it stopped working in GO 1.10 too.
Unfortunately I didn't have time to investigate further but this issue
seems to describe an actual problem therefore I'd like to help.
Perhaps your users use wrong import path to build their program, like I
described in #24233 <#24233>. That
will make Go 1.10 build executable without IMAGE_SUBSYSTEM_WINDOWS_GUI flag
set.
@alexbrainman <https://github.com/alexbrainman> which windows are you
testing on?
Windows 10.
Alex
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24232 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQGRbPHPY9fvZT9H0uVJ_WyZv2N-cmyaks5tbk5BgaJpZM4SbIa9>
.
|
I believe you, but I cannot reproduce it myself. Perhaps others can. Sorry. Alex |
try download
go1.10.windows-amd64.msi <https://dl.google.com/go/go1.10.windows-amd64.msi>
Installer Windows x86-64 106MB
https://golang.org/dl/
2018-03-06 11:09 GMT+02:00 Alex Brainman <[email protected]>:
… NO, it's not!
i v1.94 it's work good!
i copied the command of alexbrainman https://github.com/alexbrainman ,and
i get the window console yet
I believe you, but I cannot reproduce it myself. Perhaps others can. Sorry.
Alex
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#24232 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AQGRbAr4K-1Tk_9cZhEBpIXK-tun97g_ks5tblJQgaJpZM4SbIa9>
.
|
@alexbrainman, I have a similar problem on Go 1.10.1 (I could not downgrade to 1.9.3 to check if there was an error on this version) and I`ve found a way to reproduce it. Steps to reproduce:
P.S.: In my auto-builder project the second step looks like |
Yes, I can reproduce it here too now. I use these commands:
That creates %tmp%\a.exe that opens command window when it runs. Thank you @krasnovu Alex |
Change https://golang.org/cl/109235 mentions this issue: |
Just submitted the fix. Should we back port the fix to go1.10 and go1.9 ? Alex |
@alexbrainman We shouldn't backport to 1.9 which doesn't have this problem anyhow. A backport to 1.10 is OK with me if you think it is a good idea. |
I agree, go1.9 is not broken with this issue, so we do not need to backport to go1.9.
This issue did not affect me personally, so I do not know if it should be back ported or not. That is why I asked here. And it looks like no one cares about backporting this to go1.9. So I assume we don't want to backport this until we hear some complains. Thank you, Ian. Alex |
PSA: for me, changing the GOPATH to the correct capitalization form e.g. |
Change https://golang.org/cl/129059 mentions this issue: |
A flag setting like -gcflags=-e applies only to the packages named on the command line, not to their dependencies. The way we used to implement this was to remember the command line arguments, reinterpret them as pattern matches instead of package argument generators (globs), and apply them during package load. The reason for this complexity was to address a command-line like: go build -gcflags=-e fmt runtime The load of fmt will load dependencies, including runtime, and the load of runtime will reuse the result of the earlier load. Because we were computing the effective -gcflags for each package during the load, we had to have a way to tell, when encountering runtime during the load of fmt, that runtime had been named on the command line, even though we hadn't gotten that far. That would be easy if the only possible arguments were import paths, but we also need to handle go build -gcflags=-e fmt runt... go build -gcflags=-e fmt $GOROOT/src/runtime go build -gcflags=-e fmt $GOROOT/src/runt... and so on. The match predicates usually did their job well, but not always. In particular, thanks to symlinks and case-insensitive file systems and unusual ways to spell file paths, it's always been possible in various corner cases to give an argument that evalutes to the runtime package during loading but failed to match it when reused to determine "was this package named on the command line?" CL 109235 fixed one instance of this problem by making a directory pattern match case-insensitive on Windows, but that is incorrect in some other cases and doesn't address the root problem, namely that there will probably always be odd corner cases where pattern matching and pattern globbing are not exactly aligned. This CL eliminates the assumption that pattern matching and pattern globbing are always completely in agreement, by simply marking the packages named on the command line after the package load returns them. This means delaying the computation of tool flags until after the load too, for a few different ways packages are loaded. The different load entry points add some complexity, which is why the original approach seemed more attractive, but the original approach had complexity that we simply didn't recognize at the time. This CL then rolls back the CL 109235 pattern-matching change, but it keeps the test introduced in that CL. That test still passes. In addition to fixing ambiguity due to case-sensitive file systems, this new approach also very likely fixes various ambiguities that might arise from abuse of symbolic links. Fixes #24232. Fixes #24456. Fixes #24750. Fixes #25046. Fixes #25878. Change-Id: I0b09825785dfb5112fb11494cff8527ebf57966f Reviewed-on: https://go-review.googlesource.com/129059 Run-TryBot: Russ Cox <[email protected]> Reviewed-by: Alan Donovan <[email protected]>
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)? 1.10Does this issue reproduce with the latest release? yes ,just the last
What operating system and processor architecture are you using (
go env
)? windows 10 ,intel i7What did you do?
go build -ldflags "-H windowsgui" -v -o %gopath%/bin/test.exe my\proj\test.io
if i compile my program with version 1.9 , it's work good!
but if i compile my program in the last version 1.10 , i get black window console
What did you expect to see?
my window program without window console
What did you see instead?
my window program with window console
The text was updated successfully, but these errors were encountered: