Skip to content

Commit

Permalink
rusty: Support downloading rusty deps in separate build step
Browse files Browse the repository at this point in the history
Cargo supports the cargo fetch command to fetch dependencies via the
network before compiling with cargo build. Let's put it into a separate
Makefile target so that packaging systems can separate steps that
require network access from just building.

Signed-off-by: David Vernet <void@manifault.com>
  • Loading branch information
Byte-Lab committed Oct 12, 2023
1 parent 7fc3184 commit 8180b1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/sched_ext/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,13 @@ scx_flatcg: scx_flatcg.c scx_flatcg.skel.h $(SCX_COMMON_DEPS)
scx_userland: scx_userland.c scx_userland.skel.h scx_userland.h $(SCX_COMMON_DEPS)
$(call ccsched,$<,$@)

scx_rusty_deps: $(SCX_COMMON_DEPS)
cargo fetch --manifest-path=scx_rusty/Cargo.toml
scx_rusty: export RUSTFLAGS = -C link-args=-lzstd -C link-args=-lz -C link-args=-lelf -L $(BPFOBJ_DIR)
scx_rusty: export SCX_RUSTY_CLANG = $(CLANG)
scx_rusty: export SCX_RUSTY_BPF_CFLAGS = $(BPF_CFLAGS)
scx_rusty: $(INCLUDE_DIR)/vmlinux.h $(SCX_COMMON_DEPS)
cargo build --manifest-path=scx_rusty/Cargo.toml $(CARGOFLAGS)
scx_rusty: $(INCLUDE_DIR)/vmlinux.h scx_rusty_deps
cargo build --manifest-path=$@/Cargo.toml --offline $(CARGOFLAGS)
$(Q)cp $(OUTPUT_DIR)/release/$@ $(BINDIR)/$@

install: all
Expand Down

0 comments on commit 8180b1b

Please sign in to comment.