7575 with :
7676 submodules : recursive
7777 - name : Install nightly-2026-02-08 toolchain and rustfmt
78- run : rustup install nightly-2026-02-08 && rustup default nightly-2026-02-08 && rustup component add rustfmt
78+ run : rustup set profile minimal && rustup install nightly-2026-02-08 && rustup default nightly-2026-02-08 && rustup component add rustfmt
7979 - name : Cache [rust]
8080 uses : Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # 2.8.1
8181 with :
@@ -107,7 +107,7 @@ jobs:
107107 with :
108108 submodules : recursive
109109 - name : Install ${{ matrix.rust_version }} toolchain and clippy
110- run : rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} && rustup component add clippy
110+ run : rustup set profile minimal && rustup install ${{ matrix.rust_version }} && rustup default ${{ matrix.rust_version }} && rustup component add clippy
111111 - name : Cache [rust]
112112 uses : Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # 2.8.1
113113 with :
@@ -122,10 +122,12 @@ jobs:
122122 export AWS_LC_FIPS_SYS_NO_ASM=1
123123 fi
124124 if [[ -z "$CLIPPY_PACKAGES" ]]; then
125- cargo clippy --workspace --all-targets --all-features -- -D warnings
125+ cargo clippy --workspace --all-targets --all-features -- -D warnings $([ ${{ matrix.rust_version }} = 1.84.1 ] || echo -Aclippy::manual_is_multiple_of)
126+
126127 else
127128 # shellcheck disable=SC2086
128- cargo clippy $CLIPPY_PACKAGES --all-targets --all-features -- -D warnings
129+ cargo clippy $CLIPPY_PACKAGES --all-targets --all-features -- -D warnings $([ ${{ matrix.rust_version }} = 1.84.1 ] || echo -Aclippy::manual_is_multiple_of)
130+
129131 fi
130132
131133 licensecheck :
@@ -142,71 +144,45 @@ jobs:
142144 # Exclude symbolizer-ffi from the checks (mostly imported code)
143145 run : ' ! find . \( -name "*.rs" -o -name "*.c" -o -name "*.sh" \) -not -path "./symbolizer-ffi/*" -not -path "./datadog-ipc/plugins/*" -not -path "./datadog-ipc/tarpc/*" -print0 | xargs -0 licensecheck -c ".*" | grep -v "Apache License 2.0"'
144146
145- # todo: fix upstream warnings; from the readme:
146- # The most common cause of missing licenses seems to be workspaces that
147- # don't include forward their license files. Go to the repo for the
148- # workspace and copy the relevant files from there.
149- # A package license may receive a confidence warning stating that
150- # cargo-bundle-licenses is "unsure" or "semi" confident. This means that
151- # when the found license was compared to a template license it was found to
152- # have diverged in more than a few words. You should verify that the licence
153- # text is in fact correct in these cases.
154147 license-3rdparty :
155148 needs : setup
156149 if : needs.setup.outputs.crates-count != '0'
157150 runs-on : ubuntu-latest
158- name : " Valid LICENSE-3rdparty.yml "
151+ name : " Valid LICENSE-3rdparty.csv "
159152 steps :
160153 - name : Checkout sources
161154 uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # 4.2.2
162- - run : stat LICENSE-3rdparty.yml
163- - name : Cache
155+ # Keep version in sync with: scripts/update_license_3rdparty.sh (TOOL_VERSION) and scripts/Dockerfile.license (ARG TOOL_VERSION)
156+ - name : Cache dd-rust-license-tool
164157 uses : actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # 4.2.2
165158 with :
166159 path : |
167160 ~/.cargo/registry/
168161 ~/.cargo/git/db/
169- ~/.cargo/bin/
162+ ~/.cargo/bin/dd-rust-license-tool
170163 ~/.cargo/.crates.toml
171- # cache key contains current version of cargo-bundle-licenses
172- # when upstream version is updated we can bump the cache key version,
173- # to cache the latest version of the tool
174- key : " v1-4.0.0"
175- # cargo-bundle-licenses v2.0 doesn't understand path differences due to
176- # sparse vs git index, so force git.
177- - run : mkdir -p .cargo && printf "[registries.crates-io]\nprotocol = \"git\"\n" > .cargo/config.toml
178- - run : cargo install --version "4.0.0" cargo-bundle-licenses
179- - name : " Generate new LICENSE-3rdparty.yml and check against the previous"
180- env :
181- CARGO_HOME : " /tmp/dd-cargo"
164+ ~/.cargo/.crates2.json
165+ key : dd-rust-license-tool-1.0.6-v2
166+ - run : cargo install --list | grep -qF "dd-rust-license-tool v1.0.6" || cargo install dd-rust-license-tool --version "1.0.6" --locked
167+ - name : Generate new LICENSE-3rdparty.csv and check against the previous
182168 run : |
183- # Run cargo bundle-licenses without directly checking against a previous snapshot
184- cargo bundle-licenses \
185- --format yaml \
186- --output /tmp/CI.yaml
187-
188- # Normalize the paths in both files to ignore registry differences
189- sed -E 's/(registry\/src\/)[^\/]+/\1normalized_path/g' /tmp/CI.yaml > /tmp/CI_normalized.yaml
190- sed -E 's/(registry\/src\/)[^\/]+/\1normalized_path/g' LICENSE-3rdparty.yml > /tmp/LICENSE-3rdparty_normalized.yml
191-
192- # Now perform the diff on the normalized files
193- if ! diff /tmp/CI_normalized.yaml /tmp/LICENSE-3rdparty_normalized.yml; then
194- echo "Differences detected (see above). You probably need to manually update the license files. To do so:"
195- echo "cargo install cargo-bundle-licenses"
196- echo "./scripts/update_license_3rdparty.sh"
197- echo "...and push a commit with the result. Also, bonus points if someone automates this, wink wink nudge nudge."
169+ if ! dd-rust-license-tool dump > /tmp/CI.csv 2> /tmp/CI.error; then
170+ echo "ERROR: dd-rust-license-tool dump failed! See error output below:"
171+ cat /tmp/CI.error
172+ exit 1
173+ fi
174+ if ! diff /tmp/CI.csv LICENSE-3rdparty.csv; then
175+ echo "Differences detected in LICENSE-3rdparty.csv."
176+ echo "Please run './scripts/update_license_3rdparty.sh' to update the file and commit the changes."
198177 exit 1
199178 fi
200-
201179 echo "No differences found."
202-
203-
204- - name : export the generated license file on failure
180+ - name : Export generated license file on failure
205181 if : failure()
206- uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # 4 .6.1
182+ uses : actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 .6.1
207183 with :
208- name : LICENSE-3rdparty.yml
209- path : /tmp/CI.yaml
184+ name : LICENSE-3rdparty.csv
185+ path : /tmp/CI.csv
210186 overwrite : true
211187
212188 codeowners-validator :
0 commit comments