Skip to content

Add CI for Windows MSVC #697

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

Closed
wants to merge 1 commit into from
Closed

Conversation

AaronErhardt
Copy link
Contributor

This took me embarrassingly long to get it working...

At this point, it just compiles the gtk4 crate from this repository with the windows-msvc toolchain. Maybe tests could be added and also a cache to speed up compilation because compiling GTK from source takes roughly 15 minutes.

Signed-off-by: Aaron Erhardt <[email protected]>
@Hofer-Julian
Copy link
Collaborator

I am failing a bit to see why we would run this on pull requests

@AaronErhardt
Copy link
Contributor Author

It's true, it's very unlikely that the Rust code fails only on Windows so using it for pull requests isn't that useful. The idea was to find regressions for the windows installation quickly so a scheduled run every day or something like this would be an option, too.

@bilelmoussaoui
Copy link
Member

I am failing a bit to see why we would run this on pull requests

There were changes I did in the past that broke windows builds :-)

@Hofer-Julian
Copy link
Collaborator

Okay :)

- name: Prepare GTK build
run: |
cd /gtk
meson setup builddir --prefix=C:/gnome -Dbuild-tests=false -Dmedia-gstreamer=disabled
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also disable building the examples/demo

Suggested change
meson setup builddir --prefix=C:/gnome -Dbuild-tests=false -Dmedia-gstreamer=disabled
meson setup builddir --prefix=C:/gnome -Dbuild-tests=false -Dbuild-examples -Ddemos=false -Dmedia-gstreamer=disabled

@bilelmoussaoui
Copy link
Member

Not a blocker, but what would be needed to setup the caching? also we might want to build the examples / run the tests on windows as well

uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path gtk4/Cargo.toml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
args: --manifest-path gtk4/Cargo.toml
args: --workspace

After #698 has been merged and you've rebased this branch, I would expect this to work fine.

@AaronErhardt
Copy link
Contributor Author

I've updated the build command (on my testing branch) to meson setup builddir --prefix=C:/gnome -Dbuild-tests=false -Dbuild-examples=false -Ddemos=false -Dmedia-gstreamer=disabled and this reduced the build time by probably less than a minute.

More interestingly however, this caused the installation to fail: https://github.com/AaronErhardt/gtk4-rs/runs/4175328969?check_suite_focus=true

--- stderr ---
gtk4-update-icon-cache.exe: Failed to open file C:/gnome/share/icons/hicolor\.icon-theme.cache : No such file or directory


FAILED: install script 'D:\gtk\builddir\tools\gtk4-update-icon-cache.exe -q -t -f C:/gnome\share\icons\hicolor' exit code 1, stopped
Error: Process completed with exit code 1.

@Hofer-Julian
Copy link
Collaborator

Hofer-Julian commented Nov 11, 2021

@AaronErhardt Maybe cache C:/gnome/share/icons/hicolor as well?

@AaronErhardt
Copy link
Contributor Author

@Hofer-Julian I'm not caching yet because the build from scratch already fails. I'm wondering whether this should be reported upstream...

@Hofer-Julian
Copy link
Collaborator

@Hofer-Julian I'm not caching yet because the build from scratch already fails. I'm wondering whether this should be reported upstream...

Sounds good.

- name: Clone GTK
run: |
cd /
git clone https://gitlab.gnome.org/GNOME/gtk.git --depth 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this use tagged version instead of HEAD?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I pointed out earlier this workflow was mainly designed to find regressions in the windows installation instructions. Therefore I think using the latest version is fine and more convenient unless we can update the tag name automatically. Also this would allow us to more quickly find problems with the upstream code I think.

Or is there a good reason to use a tagged version?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Finding regressions sounds good. Let's hope that this build doesn't break too often otherwise it might become annoying.

What I am personally more interested though is testing gtk4-rs om Windows. Here we will want to use the same tagged gtk version that we use in the docker image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we get caching working it should be fine to build gtk in two different workflows.

@bilelmoussaoui
Copy link
Member

bilelmoussaoui commented Nov 14, 2021

should this use tagged version instead of HEAD?

Definitely, it should use the same version as the one used in the docker image; which is 4.5.0 for now :-)

@bilelmoussaoui
Copy link
Member

I've updated the build command (on my testing branch) to meson setup builddir --prefix=C:/gnome -Dbuild-tests=false -Dbuild-examples=false -Ddemos=false -Dmedia-gstreamer=disabled and this reduced the build time by probably less than a minute.

Can you try with different variants of the options to see which ends up causing the issue?

@AaronErhardt
Copy link
Contributor Author

Can you try with different variants of the options to see which ends up causing the issue?

I will continue my work on this next week. I'll be pretty busy over the next few days.

@bilelmoussaoui
Copy link
Member

@AaronErhardt what is the status of this one? if you don't plan to work on it anytime soon, i can push the changes on top of it and get a working windows CI.

@bilelmoussaoui
Copy link
Member

I've updated the build command (on my testing branch) to meson setup builddir --prefix=C:/gnome -Dbuild-tests=false -Dbuild-examples=false -Ddemos=false -Dmedia-gstreamer=disabled and this reduced the build time by probably less than a minute.

Can you try with different variants of the options to see which ends up causing the issue?

I tracked down the issue to building gtk with -Ddemos=false which ends up not installing the node editor & other demos app icons, and that means an empty $prefix/share/icons/hicolor although that shouldn't happen so I opened a corresponding meson issue at mesonbuild/meson#9786.

Closing this one in favour of #798

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

Successfully merging this pull request may close these issues.

5 participants