Skip to content

Commit d4df364

Browse files
authored
Elaborate more on Justfile vs Makefile vs GHA (#1719)
Since I'd like to standardize this more. Signed-off-by: Colin Walters <[email protected]>
1 parent 02fb561 commit d4df364

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
#
33
# Core principles:
44
# - Everything done here should be easy to replicate locally. Most tasks
5-
# should invoke `just <something>`.
5+
# should invoke `just <something>`. Read the Justfile for more explanation
6+
# of this.
67
# - Most additions to this should be extending existing tasks; e.g.
78
# there's places for unit and integration tests already.
89
name: CI

Justfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
# other tools like `bcvk` which might launch local virtual machines.
44
#
55
# See also `Makefile` and `xtask.rs`. Commands which end in `-local`
6-
# skip containerization or virtualization.
6+
# skip containerization or virtualization (and typically just proxy `make`).
7+
#
8+
# Rules written here are *often* used by the Github Action flows,
9+
# and should support being configurable where that makes sense (e.g.
10+
# the `build` rule supports being provided a base image).
711

812
# --------------------------------------------------------------------
913

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
# Understanding Makefile vs Justfile:
22
#
3-
# This file MUST NOT:
3+
# This file should primarily *only* involve
4+
# invoking tools which *do not* have side effects outside
5+
# of the current working directory. In particular, this file MUST NOT:
46
# - Spawn podman or virtualization tools
57
# - Invoke `sudo`
68
#
79
# Stated positively, the code invoked from here is only expected to
810
# operate as part of "a build" that results in a bootc binary
911
# plus data files. The two key operations are `make`
10-
# and `make install`.
12+
# and `make install`. As this is Rust, the generated binaries are in
13+
# the current directory under `target/` by default. Some rules may place
14+
# other generated files there.
15+
#
1116
# We expect code run from here is (or can be) inside a container with low
1217
# privileges - running as a nonzero UID even.
1318
#
1419
# Understanding Makefile vs xtask.rs: Basically use xtask.rs if what
1520
# you're doing would turn into a mess of bash code, whether inline here
1621
# or externally in e.g. ./ci/somebashmess.sh etc.
22+
#
23+
# In particular, the Justfile contains rules for things like integration
24+
# tests which might spawn VMs, etc.
1725

1826
prefix ?= /usr
1927

0 commit comments

Comments
 (0)