Open ekasetiawans opened 5 years ago
related to #125 @GeertJohan is hover feature/escape-spaces ready to be merged?
No, it was a try to fix the issue, but didn't work. I don't have a windows machine so it's hard to test this. Help is welcome.
I have try https://github.com/go-flutter-desktop/hover/compare/feature/escape-spaces and compile it but it's not resolve the problem
A workarround has been added to Hover (thanks @Drakirus!). Use --cache-path
with a simple path (that does not contain spaces). e.g.:
hover run --cache-path=C:\cache
Will keep this issue open as the underlying issue is not yet fixed. Hover should work out-of-the-box, also with spaces in the path (most often on Windows due to usernames)
Thank you, I will try
Does hover work now ?
hover.exe run --cache-path=D:\cache
hover: Downloading engine for platform windows-x64 at version 54ad777fd2...
hover: Download completed in 3.93s[2K
hover: Downloading artifacts at version 54ad777fd2...
hover: Download completed in 1.88s[2K
hover: ⚠ The go-flutter project tries to stay compatible with the beta channel of Flutter.
hover: ⚠ It's advised to use the beta channel. ($ flutter channel beta)
go: finding github.com/go-gl/glfw latest
# github.com/go-flutter-desktop/go-flutter/embedder
D:\cache\hover\engine\windows/flutter_engine.dll: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
hover: Updating go-flutter to latest version failed: exit status 2
** size
23M 23681536 'D:\cache\hover\engine\windows\flutter_engine.dll'
** md5
31115ef1437aa3bfc12bdc2f5232f652 *D:\\cache\\hover\\engine\\windows\\flutter_engine.dll
** gcc version
gcc version 9.1.0 (Rev3, Built by MSYS2 project)
** go version
go version go1.12.7 windows/386
@di3663 your issue isn't related to the spaces in the path. Your issue is now described in #195
@di3663 your issue isn't related to the spaces in the path. Your issue is now described in #195
Ok. Thanks. Yesterday I wanted to check whether ime is supported better these days. Chinese input methods are not supported well in all opengl projects on windows, not even gtk. We can input of course. And win32 may still a more common platform.
AFAICT engineCachePath
is stored to CGO_LDFLAGS
https://github.com/go-flutter-desktop/hover/blob/master/cmd/build.go#L470-L478
and passed to cgo
, where the flags are parsed.
https://github.com/golang/go/blob/c5d7f2f1cbaca8938a31a022058b1a3300817e33/src/cmd/cgo/main.go#L289
Used parser function supports escaping of special characters
https://groups.google.com/forum/#!topic/golang-nuts/aNDB4FrmEiA https://github.com/golang/go/blob/c5d7f2f1cbaca8938a31a022058b1a3300817e33/src/cmd/cgo/gcc.go#L104-L120
But it seems that even when the path with spaces is correctly parsed by cgo
, it breaks further down when it's passed to
the C compiler. So the best solution would probably be to fix cgo
. There have been several issues filled already
along similar lines but without apparent resolution:
https://github.com/golang/go/issues/7906 https://github.com/golang/go/issues/11868 https://github.com/golang/go/issues/16455
Nevertheless it may be that engineCachePath
does not need to be included in CGO_LDFLAGS
, since (at least on my computer, Win10, mingw-w64) it does not contain any libraries that C compiler needs. So when I changed
https://github.com/go-flutter-desktop/hover/blob/master/cmd/build.go#L478
cgoLdflags += fmt.Sprintf(" -L%s -L%s", engineCachePath, outputDirPath)
into
cgoLdflags += fmt.Sprintf(" -L%s", outputDirPath)
and removed space check in https://github.com/go-flutter-desktop/hover/blob/master/internal/enginecache/cache.go#L208-L214 my test project compiled and run without issues.
I can't speak for other OSes or configurations though.
My windows username contain whitespace, how to resolve?