-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add Windows optimized workflow #79
Conversation
That dependency check is intended to stop me from adding dependencies on mingw-specific dlls, like libgcc_s_seh-1.dll. I only want dependencies that are part of a normal Windows installation, so flips.exe is standalone and doesn't need to be shipped with a pile of DLLs. Those specific dependencies look like you're using a ucrt-targetting mingw. The dependency checker expects msvcrt, since that one's available on older Windows editions, all the way down to XP. According to https://learn.microsoft.com/en-us/cpp/windows/universal-crt-deployment?view=msvc-170 and https://support.microsoft.com/en-us/topic/update-for-universal-c-runtime-in-windows-c0514201-7fe6-95a3-b0a5-287930f3560c, UCRT is installed on a fully updated Windows 7, and even Vista. I'll count them as being part of a normal Windows installation; I'm fine with adding them to the whitelist. (Simply add a Another issue is that that's not properly optimized, you forgot setting the FLAGS variable. You'll need to copy that line from the Linux build script. And if I download an artifact from your build, I get a zip containing another zip; that's just silly, isn't it? I could fix the above myself, but I haven't used Windows seriously for ... ten years probably, so you most likely know Windows better than me at this point. I'll need you to double check that I'm not proposing anything silly. |
It is, but this is due to how GH does things. The proposal to assume that the api-ms-win stuff is part of a default windows installation sounds fine to me. |
The Flips binaries are only about 100-150KB each. I don't think trying to shrink that any further is worth the extra click. May be worth filing a bug report against github, though. Could be helpful for other projects. |
Checked the docs, I was wrong. # The level of compression for Zlib to be applied to the artifact archive.
# The value can range from 0 to 9.
# For large files that are not easily compressed, a value of 0 is recommended for significantly faster uploads.
# Optional. Default is '6'
compression-level: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the more reason to not double-zip it.
Sure, looks good to me. Except it looks like it's failing on your end https://github.com/Miepee/Flips/actions/runs/9302178564/job/25601860598, any idea why? Is the dependency checker doing something it shouldn't?
echo "This script creates a heavily optimized Windows binary. For debugging you're better off using the Makefile directly." | ||
|
||
# Set Windows (with gcc) specific optimization flags. These may need to be revisited when the project is build using MVSC. | ||
FLAGS='-Wall -O3 -flto -fuse-linker-plugin -fomit-frame-pointer -fmerge-all-constants -fvisibility=hidden' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wonder if -fvisibility=hidden does anything on Windows, it's a pretty Unix-y flag.
But it doesn't error out, so let's keep it.
because i had |
nvm that was not it |
Those flags aren't supposed to fail in Clang, but I haven't tried, and GCC and Clang have a bunch of odd differences. No, that's not why it's failing. It's failing because the last command in the script is that dependency checker, which returns failure. It's supposed to, but apparently bash exits with the exit code of the last command in the script. Weird, I didn't know that. Add a line saying |
Windows builds now Decided to use |
Sure, looks good to me. Note how this exe is 102KB, now that the optimization flags are in place; the last one was 149KB (though they zip to the same size). |
CI currently has some invalid dependencies, which are these:
I don't know if these are fine to have or not, and what would need to be done to not include them. Currently I just ignore them and only make them fail if a certain env var is set.
You can find the job on my fork here