Skip to content

Commit e94ff66

Browse files
authored
codegen: Use a docker container for generating keysyms
Previously, keysyms were just generated on the host operating system. This means that the keysyms that are generated varies from system to system, which is just bad form. This commit makes it so the keysyms are generated inside of a Docker container, which should make the process much more reproducible. Signed-off-by: John Nunley <[email protected]>
1 parent b705222 commit e94ff66

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

.github/workflows/CI.yml

+16
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ env:
3232
CARGO_TERM_COLOR: always
3333

3434
jobs:
35+
codegen:
36+
name: codegen
37+
runs-on: ubuntu-latest
38+
permissions:
39+
contents: write
40+
pull-requests: write
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: taiki-e/install-action@v2
44+
with:
45+
46+
- name: Run codegen
47+
run: just
48+
- name: Check for git changes
49+
run: if ! git diff --exit-code; then exit 1; fi
50+
3551
CI:
3652
runs-on: ubuntu-latest
3753
strategy:

Justfile

+8-2
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,11 @@
1717
# limitations under the Licenses.
1818

1919
keysyms:
20-
cargo run --manifest-path keysym-generator/Cargo.toml \
21-
src/automatically_generated.rs
20+
docker container run --rm \
21+
--name keysym_generator \
22+
--mount type=bind,source="$(pwd)",target=/xkeysym \
23+
rust:slim \
24+
sh -c "apt-get update -y && apt-get install x11proto-core-dev -y --no-install-recommends && \
25+
cargo run --manifest-path /xkeysym/keysym-generator/Cargo.toml \
26+
/xkeysym/src/automatically_generated.rs"
27+

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ In addition, this crate contains no unsafe code and is fully compatible with
1313

1414
The Minimum Safe Rust Version for this crate is **1.58.1**.
1515

16+
## Updating Headers
17+
18+
To update the automatically generated keyboard symbols in the
19+
`automatically_generated.rs` file, install [Just] and run `just`. The process
20+
creates a Debian Docker container in order to keep the files consistent, so make
21+
sure Docker is installed first.
22+
23+
[Just]: https://github.com/casey/just
24+
1625
## License
1726

1827
Licensed under either of

0 commit comments

Comments
 (0)