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

Build for windows #118

Closed
hinteor opened this issue Mar 13, 2023 · 24 comments
Closed

Build for windows #118

hinteor opened this issue Mar 13, 2023 · 24 comments

Comments

@hinteor
Copy link

hinteor commented Mar 13, 2023

could you write instructions or a script for building for windows? or it would be even better if an official build was available.

@diamondburned
Copy link
Owner

I don't use Windows. I unfortunately cannot provide this.

@ghost
Copy link

ghost commented May 11, 2023

I don't use Windows. I unfortunately cannot provide this.

you could try running it on a VM

@diamondburned
Copy link
Owner

I don't think I can feasibly run a VM on something like GitHub Actions. That wouldn't be a good idea. I also don't think Windows have any decent automatic pipeline infrastructure for it (at least ones that can easily integrate with the current one), and if it does, I've never dealt with it before.

@ghost
Copy link

ghost commented May 11, 2023

I mean building it. Maybe every once in a while you could build it and release it for us, no need for scripts or automated stuff

@jernejs
Copy link

jernejs commented May 14, 2023

I just built gtkcord4 on Windows. I used msys2, and the build worked without problems until the link step, where it failed due to too long command line go's linker tries to pass to gcc (this seems like a bug in go). Anyway, I got around that problem by running the link command manually, so if anybody wants to test, here's my Windows build.

@ghost
Copy link

ghost commented May 14, 2023

I just built gtkcord4 on Windows. I used msys2, and the build worked without problems until the link step, where it failed due to too long command line go's linker tries to pass to gcc (this seems like a bug in go). Anyway, I got around that problem by running the link command manually, so if anybody wants to test, here's my Windows build.

I had a couple dll errors: libwinpthread-1.dll, libdeflate.dll

@ghost
Copy link

ghost commented May 14, 2023

Apparently this is a MSYS2-related issue, I'll try installing it and see what happens

@jernejs
Copy link

jernejs commented May 14, 2023

Oops, fixed, download the archive again.

@jernejs
Copy link

jernejs commented May 14, 2023

BTW, I reported the link issue to go. Until that's solved, there's no easy (automated) way to build gtkcord4 on Windows.

@ghost
Copy link

ghost commented May 14, 2023

Oops, fixed, download the archive again.

hm... it showed some error messages but ended up working.

some of them were:

'C:\Users\-\Desktop\gtkcord4-win64-20230514\lib\gtk-4.0\4.0.0\media\libmedia-gstreamer.dll': The specified module could not be found.
Failed to load module: C:\Users\-\Desktop\gtkcord4-win64-20230514\lib\gtk-4.0\4.0.0\media\libmedia-gstreamer.dll
2023/05/14 11:48:51 failed to read user.css: open C:\Users\-\AppData\Roaming\gtkcord4\user.css: The system cannot find the file specified.
2023/05/14 11:48:51 note: account not found from driver: key not found
2023/05/14 11:49:23 Critical: GLib-GObject: ../glib-2.76.2/gobject/gsignal.c:3224: value for 'GtkDirectionType' parameter 0 for signal "move-focus" is of type 'gint'

The messages section was also too small, I had to push it to 1740 width to cover its entire portion of the screen. But that's not the biggest issue: right now, gtkcord is consuming 4 gigabytes of ram
image
An increase from the previous 1.4GB.

@ghost
Copy link

ghost commented May 14, 2023

I've restarted it, and it is now using ~250MB

@diamondburned
Copy link
Owner

until the link step, where it failed due to too long command line go's linker tries to pass to gcc (this seems like a bug in go).

This is probably a duplicate of several issues:

I've restarted it, and it is now using ~250MB

It's probably trying to load all the images which causes memory spikes. I'm not too confident on gtkcord4 having no memory leaks.

@ghost
Copy link

ghost commented May 15, 2023

It's probably trying to load all the images which causes memory spikes. I'm not too confident on gtkcord4 having no memory leaks.

I believe it was some other issue. On the first start, it was already on >1GB before me even opening a conversation. Then it went up to around 4GB, after which I restarted the program and it showed normal memory behaviour from there onwards. Must've been a bug or something.

@jernejs
Copy link

jernejs commented May 16, 2023

The build issue is fixed in go master.

@jernejs
Copy link

jernejs commented May 28, 2023

Here's today's Windows build: https://eternallybored.org/misc/gtkcord/gtkcord4-win64-20230528.7z

@jernejs
Copy link

jernejs commented May 28, 2023

BTW, I'm not sure if this is a problem due to Windows or something else, but the console log from gtkcord4 is full of

2023/05/28 15:28:18 cache error: cannot rename temp file: rename W:\Users\ender\AppData\Local\gtkcord4\img2\.tmp.1660282627 W:\Users\ender\AppData\Local\gtkcord4\img2\n0d7tEb-Q1TNXQqNQ2tAZ4Y3xYw=: The process cannot access the file because it is being used by another process. (falling back to HTTP)
2023/05/28 15:28:18 cache error: cannot rename temp file: rename W:\Users\ender\AppData\Local\gtkcord4\img2\.tmp.760297099 W:\Users\ender\AppData\Local\gtkcord4\img2\4cRTxHSmCswwV02ogMxrd4pFccQ=: The process cannot access the file because it is being used by another process. (falling back to HTTP)
2023/05/28 15:28:18 cache error: cannot rename temp file: rename W:\Users\ender\AppData\Local\gtkcord4\img2\.tmp.4171005109 W:\Users\ender\AppData\Local\gtkcord4\img2\sA7qkOoVr4_AjnmPnMUmTRBAOkY=: The process cannot access the file because it is being used by another process. (falling back to HTTP)
2023/05/28 15:28:18 cache error: cannot rename temp file: rename W:\Users\ender\AppData\Local\gtkcord4\img2\.tmp.2037472842 W:\Users\ender\AppData\Local\gtkcord4\img2\Mr56gd2Xu9Sdz23t9SbxyruUwYw=: The process cannot access the file because it is being used by another process. (falling back to HTTP)
2023/05/28 15:28:18 cache error: cannot rename temp file: rename W:\Users\ender\AppData\Local\gtkcord4\img2\.tmp.3161802890 W:\Users\ender\AppData\Local\gtkcord4\img2\5bUYOUEzGIjwwyeyQSh7zpVtE0M=: The process cannot access the file because it is being used by another process. (falling back to HTTP)
2023/05/28 15:28:18 cache error: cannot rename temp file: rename W:\Users\ender\AppData\Local\gtkcord4\img2\.tmp.2500714394 W:\Users\ender\AppData\Local\gtkcord4\img2\9rfbTFi_EIU16gSypUmPNLGsSHw=: The process cannot access the file because it is being used by another process. (falling back to HTTP)
2023/05/28 15:28:18 cache error: cannot rename temp file: rename W:\Users\ender\AppData\Local\gtkcord4\img2\.tmp.1576016268 W:\Users\ender\AppData\Local\gtkcord4\img2\NFkI4fVwtB2P8b2gdTFcSNWp4bk=: The process cannot access the file because it is being used by another process. (falling back to HTTP)
2023/05/28 15:28:18 cache error: cannot rename temp file: rename W:\Users\ender\AppData\Local\gtkcord4\img2\.tmp.1606576087 W:\Users\ender\AppData\Local\gtkcord4\img2\BQeZDtd-47ww2ixGre0alXbrhyE=: The process cannot access the file because it is being used by another process. (falling back to HTTP)
2023/05/28 15:28:18 cache error: cannot rename temp file: rename W:\Users\ender\AppData\Local\gtkcord4\img2\.tmp.1480286203 W:\Users\ender\AppData\Local\gtkcord4\img2\IhFbzCTw9FMizgH5sHGTX4NucGc=: The process cannot access the file because it is being used by another process. (falling back to HTTP)
2023/05/28 15:28:18 cache error: cannot rename temp file: rename W:\Users\ender\AppData\Local\gtkcord4\img2\.tmp.4172067531 W:\Users\ender\AppData\Local\gtkcord4\img2\Gh3KGfpv0UN_64ohfEsSl_ZIydM=: The process cannot access the file because it is being used by another process. (falling back to HTTP)

Looking at the img2 directory, it's full of .tmp.numbers files, and it's similar in the videos directory; the thumbnails directory has some zero-sized .tmp.numbers.jpeg files, and sounds directory has a single message.opus file.

@diamondburned
Copy link
Owner

diamondburned commented May 28, 2023

Looking at the img2 directory, it's full of .tmp.numbers files, and it's similar in the videos directory; the thumbnails directory has some zero-sized .tmp.numbers.jpeg files, and sounds directory has a single message.opus file.

This is probably because gotkit (one of the libraries that gtkcord4 uses) does atomic file writes by calling os.Rename, but os.Rename works differently on Windows than it does Unix.

From GoDoc:

Even within the same directory, on non-Unix platforms Rename is not an atomic operation

I think a good solution would be to see if gio has a function for this and use that instead of doing it the Unix way.

@diamondburned
Copy link
Owner

diamondburned commented May 28, 2023

https://github.com/google/renameio might be useful here. Also see golang/go#22397.

Gio also has Gio.File.replace.

@techgamers2
Copy link

Here's today's Windows build: https://eternallybored.org/misc/gtkcord/gtkcord4-win64-20230528.7z

tysm man for making it for windows but the original program author should add (for linux only ) in about section .. coz many use windows

@diamondburned
Copy link
Owner

"For Linux only" would imply the program only works on Linux, meaning it does not compile to Windows. Unless you prefer me doing that over not having a Windows binary.

@diamondburned
Copy link
Owner

Leaving this here for future reference: https://github.com/msys2/setup-msys2

@diamondburned
Copy link
Owner

An official Windows builder is now available via the current Build and Publish workflow as of 15d692a.

@PrincessAkira
Copy link

Didnt want to do an own error report for it, but i believe there is something wrong with the workflow
image

@diamondburned
Copy link
Owner

Whoops! It's actually fixed now! I implemented this yesterday and went straight to bed, so yeah.

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

No branches or pull requests

5 participants