From: Jason Ish Date: Thu, 16 Jan 2020 15:30:28 +0000 (-0600) Subject: rust: Don't use --frozen during build. X-Git-Tag: suricata-5.0.2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57b683233dbaf2da9bec43f740c4cf69f5df9f44;p=thirdparty%2Fsuricata.git 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. --- diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index a1cfecc8ba..7dac3fcf0d 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -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 diff --git a/rust/Makefile.am b/rust/Makefile.am index 2467f9c8b0..aaa589e1a7 100644 --- a/rust/Makefile.am +++ b/rust/Makefile.am @@ -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: