diamondburned / dissent

Tiny native Discord app
https://flathub.org/apps/details/so.libdb.dissent
GNU General Public License v3.0
1.25k stars 40 forks source link

Build for windows #118

Closed hinteor closed 7 months ago

hinteor commented 1 year ago

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

diamondburned commented 1 year ago

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

ghost commented 1 year ago

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

you could try running it on a VM

diamondburned commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

jernejs commented 1 year ago

Oops, fixed, download the archive again.

jernejs commented 1 year ago

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

ghost commented 1 year ago

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 commented 1 year ago

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

diamondburned commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

The build issue is fixed in go master.

jernejs commented 1 year ago

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

jernejs commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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

Gio also has Gio.File.replace.

TecnikOfficial commented 1 year ago

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 commented 1 year ago

"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 commented 1 year ago

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

diamondburned commented 7 months ago

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

HerXayah commented 7 months ago

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

diamondburned commented 7 months ago

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