Skip to content

Commit

Permalink
build: convert buildsys into a binary
Browse files Browse the repository at this point in the history
Loading `buildsys` as a library means that we rebuild the world when
any of its dependencies change.

Calling it as a binary eliminates another source of unwanted rebuilds.

Signed-off-by: Ben Cressey <[email protected]>
  • Loading branch information
bcressey committed Dec 3, 2019
1 parent 832074c commit 87c36aa
Show file tree
Hide file tree
Showing 134 changed files with 2,349 additions and 4,042 deletions.
23 changes: 19 additions & 4 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fi
dependencies = ["setup"]
script = [
'''
for ws in workspaces packages images ; do
for ws in workspaces packages images tools/buildsys ; do
cargo fetch --locked --manifest-path ${ws}/Cargo.toml
done
chmod o+r -R ${CARGO_HOME}
Expand Down Expand Up @@ -107,11 +107,24 @@ ${BUILDSYS_TOOLS_DIR}/docker-go \
'''
]

[tasks.build-packages]
alias = "world-packages"
[tasks.build-tools]
dependencies = ["setup", "fetch"]
script = [
'''
cargo install \
${CARGO_MAKE_CARGO_ARGS} \
--path tools/buildsys \
--root tools \
--force \
--quiet
'''
]

[tasks.build-packages]
dependencies = ["build-tools"]
script = [
'''
export PATH="${BUILDSYS_TOOLS_DIR}/bin:${PATH}"
cargo build \
${CARGO_BUILD_ARGS} \
${CARGO_MAKE_CARGO_ARGS} \
Expand All @@ -124,6 +137,7 @@ cargo build \
dependencies = ["build-packages"]
script = [
'''
export PATH="${BUILDSYS_TOOLS_DIR}/bin:${PATH}"
cargo build \
${CARGO_BUILD_ARGS} \
${CARGO_MAKE_CARGO_ARGS} \
Expand Down Expand Up @@ -193,9 +207,10 @@ script = ['tools/gen-docs.sh']
[tasks.clean]
script = [
'''
for ws in workspaces packages images ; do
for ws in workspaces packages images tools/buildsys ; do
cargo clean --manifest-path ${ws}/Cargo.toml
done
rm -f ${BUILDSYS_TOOLS_DIR}/bin/buildsys
for ext in rpm tar lz4 img ; do
rm -f ${BUILDSYS_OUTPUT_DIR}/*.${ext}
done
Expand Down
Loading

0 comments on commit 87c36aa

Please sign in to comment.