rust: Use make's jobserver when building packages
authorJeffery To <jeffery.to@gmail.com>
Sat, 23 Sep 2023 12:24:37 +0000 (20:24 +0800)
committerJeffery To <jeffery.to@gmail.com>
Thu, 12 Oct 2023 06:02:35 +0000 (14:02 +0800)
commit236da17e6a324ccfdb24f6ce96a36026bb9e5de4
tree8f61e273b6a5612f48f5446cc29ea7a209672a1d
parent185f27789c09dc6e47720b3cc33eb0c1f8b0f79c
rust: Use make's jobserver when building packages

This allows cargo to use make's jobserver when building packages, by
marking the cargo command as recursive (with the + prefix[1]) and
setting MAKEFLAGS.

This also:

* Give cargo/x.py the build directory instead of having to change the
  current directory (and opening subshells)

* Set PKG_BUILD_PARALLEL/HOST_BUILD_PARALLEL for Rust packages to enable
  the use of make's jobserver

[1]: https://www.gnu.org/software/make/manual/html_node/POSIX-Jobserver.html

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
(cherry picked from commit 0dfc1b508d5e5b361978ef9783cb63775176c305)
[omit changes to arp-whisper and procs]
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
admin/bottom/Makefile
lang/maturin/Makefile
lang/rust/Makefile
lang/rust/rust-host-build.mk
lang/rust/rust-package.mk
net/aardvark-dns/Makefile
net/netavark/Makefile
utils/ripgrep/Makefile