]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
rust: Don't use --frozen during build.
authorJason Ish <jason.ish@oisf.net>
Thu, 16 Jan 2020 15:30:28 +0000 (09:30 -0600)
committerJason Ish <jason.ish@oisf.net>
Fri, 17 Jan 2020 22:02:03 +0000 (16:02 -0600)
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.

.github/workflows/builds.yml
rust/Makefile.am

index a1cfecc8ba8670211fb51c97bea1a0d65bf70f7a..7dac3fcf0db45b289e162756b0d597c9bbb563ce 100644 (file)
@@ -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
index 2467f9c8b002faaef3bd96c1687e8f1ef5870a4e..aaa589e1a7d3756315ec4e20497551eb43bd0f21 100644 (file)
@@ -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: