Commit d542d03 1 parent 5c4a12c commit d542d03 Copy full SHA for d542d03
File tree 7 files changed +83
-7
lines changed
7 files changed +83
-7
lines changed Original file line number Diff line number Diff line change @@ -275,7 +275,6 @@ jobs:
275
275
- run : sudo -E bash scripts/environment/bootstrap-ubuntu-20.04.sh
276
276
- run : bash scripts/environment/prepare.sh
277
277
- run : echo "::add-matcher::.github/matchers/rust.json"
278
- - run : cargo install cargo-hack
279
278
- run : make check-component-features
280
279
281
280
check-msrv :
Original file line number Diff line number Diff line change @@ -424,7 +424,7 @@ check-all: check-scripts
424
424
425
425
.PHONY : check-component-features
426
426
check-component-features : # # Check that all component features are setup properly
427
- ${MAYBE_ENVIRONMENT_EXEC} cargo hack check --workspace --keep-going --each-feature --exclude- features " sources-utils-http sources-utils-http-encoding sources-utils-http-prelude sources-utils-http-query sources-utils-tcp-keepalive sources-utils-tcp-socket sources-utils-tls sources-utils-udp sources-utils-unix sinks-utils-udp " --all-targets
427
+ ${MAYBE_ENVIRONMENT_EXEC} ./scripts/ check-component- features
428
428
429
429
.PHONY : check-clippy
430
430
check-clippy : # # Check code with Clippy
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -o errexit
3
+ set -o nounset
4
+ set -o pipefail
5
+
6
+ # Extract all feature names from Cargo.toml
7
+ features=$(
8
+ sed -e '
9
+ 1,/^\[features\]$/d;
10
+ /^\[/,$d;
11
+ /=/!d;
12
+ s/ *=.*$//;
13
+
14
+ # Skip over certain features
15
+ /-utils-/d;
16
+ /^default$/d;
17
+ /^all-integration-tests$/d;
18
+ ' < Cargo.toml | sort
19
+ )
20
+
21
+ # Prime the pump to build most of the artifacts
22
+ cargo check --workspace --all-targets --no-default-features
23
+ cargo check --workspace --all-targets --no-default-features --features default
24
+ cargo check --workspace --all-targets --no-default-features --features all-integration-tests
25
+
26
+ # The feature builds already run in parallel below, don't overload
27
+ export CARGO_BUILD_JOBS=1
28
+
29
+ exec parallel --verbose --retries 2 scripts/check-one-feature {} ::: $features
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -o errexit
3
+ set -o nounset
4
+ set -o pipefail
5
+
6
+ if [ $# -lt 1 ]
7
+ then
8
+ echo " usage: $0 FEATURE [OPTIONS]"
9
+ exit 1
10
+ fi
11
+
12
+ feature=$1
13
+ shift
14
+
15
+ if [ ! -d target ]
16
+ then
17
+ echo $0 : ' Run `cargo check` first to prime the `target` directory.'
18
+ exit 1
19
+ fi
20
+
21
+ target=$PWD /target-feature-$feature
22
+ log=$target /.logfile
23
+ trap ' rm --force --recursive $target' EXIT
24
+
25
+ cp --archive --link target $target
26
+ rm --force $target /debug/.cargo-lock
27
+
28
+ echo " ===== Feature: $feature ====="
29
+ if cargo check --workspace --all-targets \
30
+ --no-default-features \
31
+ --features $feature \
32
+ --target-dir $target \
33
+ " $@ " > $log 2>&1
34
+ then
35
+ # If the run was successful, just output the `Finished` line
36
+ # to prevent cluttering the logs.
37
+ exit=0
38
+ fgrep --word-regexp Finished $log
39
+ else
40
+ exit=$?
41
+ cat $log
42
+ fi
43
+
44
+ exit $exit
45
+
46
+ # It would be nice to relink newer files back into `target` so
47
+ # subsequent runs can pick them up, but that ends up confusing `cargo`
48
+ # later in the process.
Original file line number Diff line number Diff line change @@ -42,12 +42,12 @@ impl TryFrom<Option<&HttpSourceAuthConfig>> for HttpSourceAuth {
42
42
43
43
#[ derive( Debug , Clone ) ]
44
44
pub struct HttpSourceAuth {
45
- #[ allow( unused) ] // triggered by cargo-hack
45
+ #[ allow( unused) ] // triggered by check-component-features
46
46
pub ( self ) token : Option < String > ,
47
47
}
48
48
49
49
impl HttpSourceAuth {
50
- #[ allow( unused) ] // triggered by cargo-hack
50
+ #[ allow( unused) ] // triggered by check-component-features
51
51
pub fn is_valid ( & self , header : & Option < String > ) -> Result < ( ) , ErrorMessage > {
52
52
use warp:: http:: StatusCode ;
53
53
Original file line number Diff line number Diff line change @@ -15,15 +15,15 @@ pub struct ErrorMessage {
15
15
feature = "sources-datadog_agent"
16
16
) ) ]
17
17
impl ErrorMessage {
18
- #[ allow( unused) ] // triggered by cargo-hack
18
+ #[ allow( unused) ] // triggered by check-component-features
19
19
pub fn new ( code : http:: StatusCode , message : String ) -> Self {
20
20
ErrorMessage {
21
21
code : code. as_u16 ( ) ,
22
22
message,
23
23
}
24
24
}
25
25
26
- #[ allow( unused) ] // triggered by cargo-hack
26
+ #[ allow( unused) ] // triggered by check-component-features
27
27
pub fn status_code ( & self ) -> http:: StatusCode {
28
28
http:: StatusCode :: from_u16 ( self . code ) . unwrap_or ( http:: StatusCode :: INTERNAL_SERVER_ERROR )
29
29
}
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ const fn default_shutdown_timeout_secs() -> u64 {
39
39
impl VectorConfig {
40
40
#[ cfg( test) ]
41
41
#[ allow( unused) ] // this test function is not always used in test, breaking
42
- // our cargo-hack run
42
+ // our check-component-features run
43
43
pub fn set_tls ( & mut self , config : Option < TlsEnableableConfig > ) {
44
44
self . tls = config;
45
45
}
You can’t perform that action at this time.
0 commit comments