Commit Graph

20 Commits

Author SHA1 Message Date
bicarus 8f1069628e Update bug_report.md 2026-06-08 00:50:33 -07:00
ASleepyCat 60efd643d1 Add ccache support for faster incremental builds (#301)
## Description of change
Adds `ccache` support for local compiling and Github Actions
environments. This significantly speeds up incremental builds, but cold
starts will take a little longer to compile.

The build script now has an `-i` flag to ignore the build cache if
needed. You can also manually delete the `.ccache` folder to force a
fresh build too.

For the GA workflow, it uses the
[`ccache-action`](https://github.com/hendrikmuhs/ccache-action) action
to manage and store the cached build objects. This cache should be
accessible to all branches.

I also removed the `--no-cache` flag when building the
`spicetools/spice` image since Docker will automatically invalidate
`COPY` layers if it detects the copied files have changed.

### Compile times
Compiled with a 7800X3D, 32GB 6000MT/s RAM.
| `main` | `ccache` (fresh) | `ccache` (cached) | `ccache` (ignore
cache) |
|--------|--------|--------|--------|
| 2m46.047s | 3m8.886s | 0m32.638s | 2m45.148s |

## Testing
Tested incremental builds by using another branch that's rebased on top
of this.
2025-04-19 20:43:10 -07:00
bicarus-dev 07c78caf01 build: add git commit hash to produced artifact (#297)
## Link to GitHub Issue, if one exists
n/a

## Description of change
Previously, the artifact produced by the CI action was `spice2x.zip`.

With this change, it will be `spice2x-ci-1234567.zip` where 1234567 is
the first 7 chars of the commit hash.

Note that for PRs, github produces a merge commit before queueing the
action, so the commit hash won't match up with the HEAD of a fork. The
goal is to just generate unique-ish filenames so this is not a huge
deal.

## Compiling
## Testing

Action has been run in the fork.
2025-04-07 15:56:46 -07:00
ASleepyCat d1a20e58b6 Add CI and improve build system (#293)
## Link to GitHub Issue, if one exists
Fixes #292

## Description of change
This PR adds CI with Github Actions. Runs on every push and pull
request. If a new commit is pushed, any previous runs are cancelled for
that branch.

In total, these optimisations (on a 7800X3D with 32GB 6000MT/s RAM and
an NVMe Gen4 SSD):
* Reduces `spicetools/deps` image size by around 200 MB, and build time
by almost 50%
* Reduces compilation time by around 9%

Changes:
* Pull archlinux image from GHCR so that we don't run into pull limits
from docker.io
* Use `base-devel` archlinux image
* Reduces image build time from 141 seconds to 109 seconds on my machine
  * Clean up unneeded packages
* Small reduction in `spicetools/deps` image size (4.35 GB vs 4.14 GB)
* Use precompiled `yay` binary
* Reduces image build time from 163 seconds to 141 seconds on my machine
* Use `nproc` to get the number of cores instead of parsing
`/proc/cpuinfo` with `awk`
* Use `ninja` to compile
  * Speeds up compile times a little, around 13 seconds on my machine
* Don't run `docker run` in interactive TTY in `build_docker.sh`
  * Github Actions disallows interactive TTYs
  * Still allowed for the batch script
* `time` the compilation process
* Enable BuildKit in the bash script
  * Required for build contexts
* Don't use `USER` instruction
  * Breaks Github Actions, doesn't seem to affect build?
* More info:
https://docs.github.com/en/actions/sharing-automations/creating-actions/dockerfile-support-for-github-actions#user
  * `USER` also seems to cause issues on a mounted ReFS image
* Add executable bits to bash scripts

Future ideas:
* Combine `external/Dockerfile` and `./Dockerfile` into one to
deduplicate images and save disk space
* Fix the weird `/src/src` directory structure in the Dockerfile and
build scripts
* Investigate CMake and ninja optimisations?

## Compiling
Check CI status on my fork.

## Testing
Tested with docker on Windows. Also play tested a bit to make sure the
Github Actions artifact works.
2025-04-06 00:29:02 -07:00
sp2xdev ab5c343c7d Delete .github/ISSUE_TEMPLATE/patch-submission.md 2025-03-11 01:44:05 -07:00
sp2xdev 33d98d8217 Update bug_report.md 2024-12-26 22:48:04 -08:00
sp2xdev be37865b74 Update issue templates 2024-08-04 00:25:48 -07:00
sp2xdev 680e7a7bda Update issue templates 2024-07-15 19:02:45 -07:00
sp2xdev 6e8c87921b Update issue templates 2024-04-30 03:00:03 -07:00
sp2xdev 8c8e2de4f6 Update issue templates 2024-03-24 15:32:20 -07:00
sp2xdev cb6252b15f Update issue templates 2024-03-24 15:30:09 -07:00
sp2xdev f48c30df8b Update issue templates 2024-01-16 19:54:30 -08:00
sp2xdev 5465f1b364 Update issue templates 2023-12-31 18:30:48 -08:00
sp2xdev e5875c6d73 Update issue templates 2023-12-31 18:17:38 -08:00
sp2xdev 5dc53e24e7 Update issue templates 2023-12-28 00:55:02 -08:00
sp2xdev d3e9575b75 Update issue templates 2023-12-28 00:52:47 -08:00
sp2xdev a22eec22dc Update issue templates 2023-12-28 00:50:10 -08:00
sp2xdev dad518a6bf Update issue templates 2023-12-23 14:21:10 -08:00
sp2xdev db5f8abac1 Update issue templates 2023-12-23 14:13:59 -08:00
sp2xdev a933ea551c Update issue templates 2023-12-23 14:13:24 -08:00