diff --git a/.ci/images/build/Dockerfile b/.ci/images/build/Dockerfile index 0db7159e..6f5da339 100644 --- a/.ci/images/build/Dockerfile +++ b/.ci/images/build/Dockerfile @@ -18,14 +18,17 @@ ENV PATH="/usr/local/go/bin:${PATH}" RUN curl -s -L -o /tmp/go-1.23.0.tar.gz https://go.dev/dl/go1.23.0.linux-${TARGETARCH}.tar.gz RUN tar -C /usr/local -xzf /tmp/go-1.23.0.tar.gz -# Install Protocol Buffers compiler by hand, since Ubuntu 14.04 does not have a recent enough version. +# Install a number of packages/tools by hand, because the versions in Ubuntu 14.04 are too old or not available at all. COPY .ci/install-protoc.sh / RUN chmod +x /install-protoc.sh && /install-protoc.sh -# Install awscli by hand, for similar reasons to the Protocol Buffers compiler. COPY .ci/install-awscli.sh / RUN chmod +x /install-awscli.sh && /install-awscli.sh +RUN curl -s -L -o /tmp/jq https://github.com/jqlang/jq/releases/download/jq-1.7.1/jq-linux-${TARGETARCH} && \ + mv /tmp/jq /usr/local/bin/jq && \ + chmod +x /usr/local/bin/jq + # Install Rust and common Cargo tooling that we depend on. RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain ${RUST_VERSION} ENV PATH="/root/.cargo/bin:${PATH}" diff --git a/Makefile b/Makefile index 18619742..d49ffb3c 100644 --- a/Makefile +++ b/Makefile @@ -185,6 +185,9 @@ check-rust-build-tools: ifeq ($(shell command -v cargo >/dev/null || echo not-found), not-found) $(error "Please install Rust: https://www.rust-lang.org/tools/install") endif +ifeq ($(shell command -v jq >/dev/null || echo not-found), not-found) + $(error "Please install jq: https://jqlang.org/download/") +endif ##@ Running @@ -380,9 +383,12 @@ check-licenses: ## Check that the third-party license file is up to date .PHONY: check-features check-features: check-rust-build-tools cargo-install-cargo-hack -check-features: ## Check that ADP builds with all possible combinations of feature flags +check-features: ## Checks that all packages with feature flags can be built with different flag combinations @echo "[*] Checking feature flag compatibility matrix..." - @cargo hack check --feature-powerset --tests --quiet + @find . -name Cargo.toml | grep -v '^./Cargo.toml' | \ + xargs -I {} -- cargo read-manifest --manifest-path {} | \ + jq -r "select(.features | del(.default) | length > 0) | .name" | \ + xargs -I {} -- cargo hack --feature-powerset --package {} check --tests --quiet ##@ Testing