package/pkg-cargo: fix building packages with OVERRIDE_SRCDIR
PATCH 1/1 package/pkg-cargo: fix building packages with OVERRIDE_SRCDIR
Only add --offline and --locked if a cargo package isn't being built with OVERRIDE_SRCDIR enabled as the vendoring stage doesn't take place in this case.
We don't particularly care about offline builds during development and also not about the Cargo.lock file being outdated (which happens when adding/updating/removing dependencies during development).
The cargo install call also has --offline and --locked parameters, but these don't seem to cause any problems, for now at least.
Signed-off-by Marcus Hoffmann <[email protected]>
--- package/pkg-cargo.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
package/pkg-cargo.mk +4 -4
@@ -240,10 +240,10 @@ define $(2)_BUILD_CMDS $$(PKG_CARGO_ENV) \ $$($(2)_CARGO_ENV) \ cargo build \ - --offline \ + $$(if $$($$(PKG)_OVERRIDE_SRCDIR),,--offline) \ $$(if $$(BR2_ENABLE_DEBUG),,--release) \ --manifest-path Cargo.toml \ - --locked \ + $$(if $$($$(PKG)_OVERRIDE_SRCDIR),,--locked) \ $$($(2)_CARGO_BUILD_OPTS) endef else # ifeq ($(4),target)
@@ -254,10 +254,10 @@ define $(2)_BUILD_CMDS $$(HOST_PKG_CARGO_ENV) \ $$($(2)_CARGO_ENV) \ cargo build \ - --offline \ + $$(if $$($$(PKG)_OVERRIDE_SRCDIR),,--offline) \ --release \ --manifest-path Cargo.toml \ - --locked \ + $$(if $$($$(PKG)_OVERRIDE_SRCDIR),,--locked) \ $$($(2)_CARGO_BUILD_OPTS) endef endif # ifeq ($(4),target)
Signature · 6 lines
2.53.0 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot