Skip to content

ci: build on ubuntu with GCC#6

Open
trym-b wants to merge 1 commit intoAdrienTD:masterfrom
trym-b:ci/build-with-github-actions
Open

ci: build on ubuntu with GCC#6
trym-b wants to merge 1 commit intoAdrienTD:masterfrom
trym-b:ci/build-with-github-actions

Conversation

@trym-b
Copy link
Contributor

@trym-b trym-b commented Nov 20, 2025

Motivation

To properly support ubuntu 24.04, building with make is not sufficient. Just managing the dependencies is difficult. Since this repository is already using cmake and vcpkg for building on windows, this commit is simply extending this for ubuntu-24.04.

To build locally, you simply need to run
python continuous-integration/build.py when you have all of the dependencies installed. These you can install by running continuous-integration/ubuntu-24.04/setup.sh.

Alternatively you can just do the same as the Github Actions workflow run and do the same as it does.

The usage of ninja as generator and gcc as compiler is completely arbitrary. However the setup is configured so that adding support for a different compiler such as clang could be done with minimal effort.

Since we now use CMakePresets.json to provide vcpkg to CMake, this forces a bump to CMake version 3.19.

Rejected alternatives

The system dependencies that we rely on could be installed with nix + devenv, but I decided that this might be a bit too controversial/overkill for the initial ubuntu build.

Using AppVeyor to build targeting different platforms + compilers could be an option, however this is difficult for anyone that is not the repository owner to contribute, as the AppVeyor settings are not something that are visible to others.

By using Github Actions makes it possible for others that fork this repository to have working builds from the very start.

Future work

This commit only ensures that the build actually succeeds, if the resulting artifacts can actually be run is a different task altogether.

There are a lot of compiler warnings like

warning: invalid use of incomplete type 'struct CommonGameState'

That is printed to stdout when building, but these would need to be addressed in a future commit.

# Motivation

To properly support ubuntu 24.04, building with `make` is not
sufficient. Just managing the dependencies is difficult. Since this
repository is already using `cmake` and `vcpkg` for building on windows,
this commit is simply extending this for ubuntu-24.04.

To build locally, you simply need to run
`python continuous-integration/build.py` when you have all of the
dependencies installed. These you can install by running
`continuous-integration/ubuntu-24.04/setup.sh`.

Alternatively you can just do the same as the Github Actions workflow
run and do the same as it does.

The usage of `ninja` as generator and `gcc` as compiler is completely
arbitrary. However the setup is configured so that adding support for a
different compiler such as `clang` could be done with minimal effort.

Since we now use `CMakePresets.json` to provide `vcpkg` to `CMake`, this
forces a bump to `CMake` version 3.19.

# Rejected alternatives

The system dependencies that we rely on could be installed with `nix` +
`devenv`, but I decided that this might be a bit too
controversial/overkill for the initial ubuntu build.

Using `AppVeyor` to build targeting different platforms + compilers
could be an option, however this is difficult for anyone that is not the
repository owner to contribute, as the `AppVeyor` settings are not
something that are visible to others.

By using `Github Actions` makes it possible for others that fork this
repository to have working builds from the very start.

# Future work

This commit only ensures that the build actually succeeds, if the
resulting artifacts can actually be run is a different task altogether.

There are a lot of compiler warnings like
```
warning: invalid use of incomplete type 'struct CommonGameState'
```

That is printed to stdout when building, but these would need to be
addressed in a future commit.
@trym-b
Copy link
Contributor Author

trym-b commented Nov 20, 2025

As mentioned before, feel free to reject this pull request if it is not to your liking :)

Also, the AppVeyor run failed with this error message:

vcpkg install bzip2:x64-windows discord-rpc:x64-windows enet:x64-windows glew:x64-windows mpg123:x64-windows nlohmann-json:x64-windows openal-soft:x64-windows sdl2:x64-windows stb:x64-windows lua:x64-windows sol2:x64-windows
error: In manifest mode, `vcpkg install` does not support individual package arguments.
To install additional packages, edit vcpkg.json and then run `vcpkg install` without any package arguments.
See https://learn.microsoft.com/vcpkg/users/manifests?WT.mc_id=vcpkg_inproduct_cli for more information.
Using manifest file at C:\projects\wkbre2\vcpkg.json.

As I do not have access to AppVeyor settings, I am not quite sure what is actually being run. But from the command, it seems like you are running vcpkg install ..., instead of using a vcpkg.json, which seems to be how classic mode works: https://learn.microsoft.com/en-us/vcpkg/consume/classic-mode?tabs=msbuild%2Cbuild-MSBuild

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.

1 participant