rust: Don't use --frozen during build.

If sources are vendored, we get the same effect of using frozen
with a lock file, and the Cargo.lock is generated based
on the vendored sources.

This also removes the need to ship a Cargo.lock.

Fixed out of source builds with vendored sources.
pull/4490/head
Jason Ish 6 years ago
parent c6f168eb98
commit 57b683233d

@ -145,8 +145,6 @@ jobs:
name: dist name: dist
- run: tar zxvf ./dist/suricata-*.tar.gz --strip-components=1 - run: tar zxvf ./dist/suricata-*.tar.gz --strip-components=1
- run: ./configure - run: ./configure
- name: Check that Rust is using --frozen
run: grep -q '^FROZEN' rust/Makefile
- run: make -j2 - run: make -j2
- run: make install - run: make install
- run: make install-conf - run: make install-conf

@ -1,5 +1,4 @@
EXTRA_DIST = Cargo.lock \ EXTRA_DIST = src \
src \
.cargo/config.in \ .cargo/config.in \
gen-c-headers.py gen-c-headers.py
@ -7,10 +6,6 @@ if HAVE_CARGO_VENDOR
EXTRA_DIST += vendor EXTRA_DIST += vendor
endif endif
if HAVE_RUST_VENDOR
FROZEN = --frozen
endif
if !DEBUG if !DEBUG
RELEASE = --release RELEASE = --release
endif endif
@ -33,16 +28,16 @@ if HAVE_PYTHON
endif endif
if HAVE_CYGPATH if HAVE_CYGPATH
rustpath=`cygpath -a -t mixed $(abs_top_builddir)` rustpath=`cygpath -a -t mixed $(abs_top_builddir)`
cd $(top_srcdir)/rust && @rustup_home@ \ @rustup_home@ \
CARGO_HOME="$(CARGO_HOME)" \ CARGO_HOME="$(CARGO_HOME)" \
CARGO_TARGET_DIR="$$rustpath/rust/target" \ CARGO_TARGET_DIR="$$rustpath/rust/target" \
$(CARGO) build $(RELEASE) $(FROZEN) \ $(CARGO) build $(RELEASE) \
--features "$(RUST_FEATURES)" $(RUST_TARGET) --features "$(RUST_FEATURES)" $(RUST_TARGET)
else else
cd $(top_srcdir)/rust && @rustup_home@ \ @rustup_home@ \
CARGO_HOME="$(CARGO_HOME)" \ CARGO_HOME="$(CARGO_HOME)" \
CARGO_TARGET_DIR="$(abs_top_builddir)/rust/target" \ CARGO_TARGET_DIR="$(abs_top_builddir)/rust/target" \
$(CARGO) build $(RELEASE) $(FROZEN) \ $(CARGO) build $(RELEASE) \
--features "$(RUST_FEATURES)" $(RUST_TARGET) --features "$(RUST_FEATURES)" $(RUST_TARGET)
endif endif
@ -53,12 +48,9 @@ distclean-local: clean-local
rm -rf vendor gen Cargo.lock rm -rf vendor gen Cargo.lock
check: check:
CARGO_HOME="$(CARGO_HOME)" @rustup_home@ CARGO_HOME="$(CARGO_HOME)" @rustup_home@ \
$(CARGO) test --features "$(RUST_FEATURES)" CARGO_TARGET_DIR="$(abs_top_builddir)/rust/target" \
$(CARGO) test $(RELEASE) --features "$(RUST_FEATURES)"
Cargo.lock: Cargo.toml
CARGO_HOME="$(CARGO_HOME)" @rustup_home@ $(CARGO) \
generate-lockfile
if HAVE_CARGO_VENDOR if HAVE_CARGO_VENDOR
vendor: vendor:

Loading…
Cancel
Save