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
- run: tar zxvf ./dist/suricata-*.tar.gz --strip-components=1
- run: ./configure
- name: Check that Rust is using --frozen
run: grep -q '^FROZEN' rust/Makefile
- run: make -j2
- run: make install
- run: make install-conf

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

Loading…
Cancel
Save