[librsvg: 1/2] build: Don't run cargo for the library and rsvg-convert in parallel




commit d09f82078939d6ee1f1a08fd7dff1f102602815f
Author: Jürg Billeter <j bitron ch>
Date:   Sun Aug 7 12:46:54 2022 +0200

    build: Don't run cargo for the library and rsvg-convert in parallel
    
    Add an order-only prerequisite to ensure `cargo build` for
    `librsvg_c_api.la` does not run concurrently with `cargo build` for
    `rsvg-convert`.
    
    Parallel runs of cargo may result in shared intermediaries (e.g. `.rlib`
    and `.so` files) to be generated and written twice. Besides unnecessary
    work, this can occasionally result in odd build failures due to race
    conditions as not all files are overwritten atomically.
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/726>

 Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/Makefile.am b/Makefile.am
index 0d85655b8..58c2a5c9f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -215,7 +215,7 @@ RSVG_CONVERT_BIN=$(CARGO_TARGET_DIR)/$(RUST_TARGET_SUBDIR)/rsvg-convert$(EXEEXT)
 
 RSVG_CONVERT_SRC = src/bin/rsvg-convert.rs
 
-$(RSVG_CONVERT_BIN): $(RSVG_CONVERT_SRC)
+$(RSVG_CONVERT_BIN): $(RSVG_CONVERT_SRC) | librsvg_c_api.la
        +cd $(top_srcdir) &&                                                    \
        PKG_CONFIG_ALLOW_CROSS=1                                                \
        PKG_CONFIG='$(PKG_CONFIG)'                                              \


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]