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

Use matrix notation in build.yml to reduce clutter and update Ubuntu image #75

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

unvermuthet
Copy link
Contributor

@unvermuthet unvermuthet commented Feb 16, 2025

Instead of having a code block for every possible build combination this PR uses the proper matrix notation to reduce the length of the file and improve readability. I made sure to not change the actual configuration of builds that are being produced. Though I'm not sure why its setup to run all the double builds since those aren't linked to in the .gdextension file.

# ...

          - platform: linux
            float-precision: single
            arch: x86_64
            target-type: template_debug
            os: ubuntu-20.04

          - platform: windows
            float-precision: single
            arch: x86_32
            target-type: template_debug
            os: windows-latest

          - platform: windows
            float-precision: single
            arch: x86_64
            target-type: template_debug
            os: windows-latest

# ... way more

becomes

        target:
          [
            { platform: linux, arch: x86_64, os: ubuntu-24.04 },
            { platform: windows, arch: x86_64, os: windows-latest },
            { platform: windows, arch: x86_32, os: windows-latest },
            { platform: macos, arch: universal, os: macos-latest },
            { platform: ios, arch: arm64, os: macos-latest },
            { platform: android, arch: arm64, os: ubuntu-24.04 },
            { platform: android, arch: arm32, os: ubuntu-24.04 },
            { platform: android, arch: x86_64, os: ubuntu-24.04 },
            { platform: android, arch: x86_32, os: ubuntu-24.04 },
            { platform: web, arch: wasm32, os: ubuntu-24.04 },
          ]

I also updated the version of the Ubuntu runner image since its getting deprecated. actions/runner-images#11101

Copy link
Contributor

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

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

This is great! I had actually tried to do something like that myself, but didn't come across the "object in array" trick. I think this is a great way to reduce the complexity of the workflow.

I skimmed across the resulting builds, and I think it's the same as before.
Arguably we should just build all combinations with both debug and release, but that should be for another PR to decide. I think it's correct for this PR to be agnostic to it.

@unvermuthet
Copy link
Contributor Author

Is the Ubuntu image update alright? There is still time till deprecation but I've been getting warnings on my action runs.

@Ivorforce
Copy link
Contributor

Is the Ubuntu image update alright? There is still time till deprecation but I've been getting warnings on my action runs.

In some situations it would be wiser to just make a tiny additional PR for that, but I think it's fine to address it here since you're touching the file anyway.

@unvermuthet
Copy link
Contributor Author

Thank you for explaining the squashing

@unvermuthet
Copy link
Contributor Author

I forgot to update the old Ubuntu image on the merge job. Changed that too for completeness.

There are a lot of cache missed warnings on the action run for this PR. It that normal?

@Ivorforce
Copy link
Contributor

Ivorforce commented Feb 16, 2025

There are a lot of cache missed warnings on the action run for this PR. It that normal?

I think there's no need to worry :) Cache misses can occur from a number of factors, such as changing runner images or simply not having run a job in a while.
It may also indicate that the combinations for the runners have changed (i.e. cache keys), but I don't think that should be the case.

@unvermuthet
Copy link
Contributor Author

unvermuthet commented Feb 19, 2025

Everyone at the GDExtension meeting was in favour of having this merged.

The Ubuntu update was the core of the discussion. dsnopek brought up a potential issue concerning backwards compatibility. Since the cpp library isn't staticly linked, loading a GDExtension compiled with 24.04 might not work on 20.04.

There is a good reason to stay on an older version. If you build with a newer version and attempt to load it on an older verion of Ubuntu, it may fail because it requires a newer version of the C library.

We agreed to change the Ubuntu version to the oldest, undeprecated LTS which is 22.04. This version will be deprecated in April of 2027. Changing to static linking can be done in another PR.

@unvermuthet
Copy link
Contributor Author

The file I changed also has a bug here. That command doesn't actually manage to delete the files. You can check the builds, they are still there.

Remove-Item bin/* -Include *.exp,*.lib,*.pdb -Force

It should be bin/windows/*. I should open a new PR for that right?

@Ivorforce
Copy link
Contributor

It should be bin/windows/*. I should open a new PR for that right?

Yeah, that should be a separate PR.

@unvermuthet
Copy link
Contributor Author

Does this need more testing? There is another improvement I could make by reordering the entries in the matrix to have them show up more similarly on the Action page. Seeing single first is just not so useful.

But I don't want to cause the need for retesting if we're good on getting this merged.

Before After

@Ivorforce
Copy link
Contributor

Ivorforce commented Feb 21, 2025

Feel free to edit; I think reordering makes sense, and nobody's tested this anyway yet I think. On re-push your workflow may actually run automatically too because you now have the Contributor badge.

@paddy-exe
Copy link
Collaborator

Yeah you can go ahead and edit it 👍🏻

Copy link
Contributor

@Ivorforce Ivorforce left a comment

Choose a reason for hiding this comment

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

Still looks good to me!

Copy link
Collaborator

@paddy-exe paddy-exe left a comment

Choose a reason for hiding this comment

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

Looks good👍🏻 thank you

@paddy-exe
Copy link
Collaborator

Would you mind squashing everything into one commit? 😅 just noticed that

@paddy-exe paddy-exe merged commit 8e13217 into godotengine:main Feb 21, 2025
23 checks passed
@paddy-exe
Copy link
Collaborator

Thank you very much! Merged👍🏻

@unvermuthet
Copy link
Contributor Author

Thanks!

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.

3 participants