Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Update dependencies to ensure a more recent version of tokio is used #63

Merged
merged 2 commits into from
Nov 22, 2021

Conversation

flavio
Copy link
Contributor

@flavio flavio commented Nov 22, 2021

This is required to address RUSTSEC-2021-0124.

Note well: the unit tests are currently broken, regardless of this patch.

This is required to address RUSTSEC-2021-0124:
https://rustsec.org/advisories/RUSTSEC-2021-0124.html

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
Copy link
Member

@kflansburg kflansburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I'm surprised that our nightly audit did not catch this.

Which unit tests are not working for you?

@@ -35,8 +35,8 @@ async-trait = "0.1"
anyhow = "1.0"
tokio = { version = "1.0", features = ["fs", "macros", "signal"] }
tokio-stream = { version = "0.1", features = ['sync'] }
kube = { version = "0.60", default-features = false }
kube-runtime = { version = "0.60", default-features = false }
kube = { version = "0.64", features = ['client'] }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since default-features is enabled here, won't this force client and native-tls?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this results in the Windows test failures we are seeing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I've submitted a commit that fixes that (hopefully)

@flavio
Copy link
Contributor Author

flavio commented Nov 22, 2021

Which unit tests are not working for you?

I get these failures also on the main branch:

running 1 test
test manifest::test::test ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 4.01s

     Running tests/ui.rs (target/debug/deps/ui-c5c54af9f3a3259b)

running 1 test

running 4 tests
test [ui] ui/state/require_transition_to.rs ... FAILED
test [ui] ui/state/require_same_object_state.rs ... FAILED
test [ui] ui/state/next_must_be_state.rs ... FAILED
test [ui] ui/state/cannot_construct_transition_next.rs ... FAILED

failures:

failures:
    [ui] ui/state/cannot_construct_transition_next.rs
    [ui] ui/state/next_must_be_state.rs
    [ui] ui/state/require_same_object_state.rs
    [ui] ui/state/require_transition_to.rs

test result: FAILED. 0 passed; 4 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.18s

test compile_test ... FAILED

failures:

---- compile_test stdout ----
diff of stderr:

diff of stderr:

-error[E0277]: the trait bound `TestState: TransitionTo<_>` is not satisfied
-  --> $DIR/require_transition_to.rs:38:9
+error[E0464]: multiple matching crates for `async_trait`
+  --> $DIR/require_transition_to.rs:3:1
    |
-LL |         Transition::next(self, TestState)
-   |         ^^^^^^^^^^^^^^^^ the trait `TransitionTo<_>` is not implemented for `TestState`
+LL | extern crate async_trait;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-note: required by `Transition::<S>::next`
-  --> $SRC_DIR/src/state.rs:43:5
-   |
-LL | /     pub fn next<I: State<S>, O: State<S>>(_i: Box<I>, o: O) -> Transition<S>
-LL | |     where
-LL | |         I: TransitionTo<O>,
-   | |___________________________^
+   = note: candidates:
+           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so
+           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0464`.
 
-error[E0277]: the trait bound `OtherState: krator::State<PodState>` is not satisfied
-  --> $DIR/require_same_object_state.rs:50:32
+error[E0464]: multiple matching crates for `async_trait`
+  --> $DIR/require_same_object_state.rs:3:1
    |
-LL |         Transition::next(self, OtherState)
-   |         ----------------       ^^^^^^^^^^ the trait `krator::State<PodState>` is not implemented for `OtherState`
-   |         |
-   |         required by a bound introduced by this call
+LL | extern crate async_trait;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-   = help: the following implementations were found:
-             <OtherState as krator::State<OtherPodState>>
-note: required by `Transition::<S>::next`
-  --> $SRC_DIR/src/state.rs:43:5
-   |
-LL | /     pub fn next<I: State<S>, O: State<S>>(_i: Box<I>, o: O) -> Transition<S>
-LL | |     where
-LL | |         I: TransitionTo<O>,
-   | |___________________________^
+   = note: candidates:
+           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so
+           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0464`.
 

The actual stderr differed from the expected stderr.
Actual stderr saved to /tmp/state/require_transition_to.stage-id.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args state/require_transition_to.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "rustc" "tests/ui/state/require_transition_to.rs" "-L" "/tmp" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/tmp/state/require_transition_to.stage-id" "-A" "unused" "-Z" "ui-testing" "-L" "/home/flavio/hacking/kubernetes/krator/target/debug/deps" "-L" "/home/flavio/hacking/kubernetes/krator/target/debug" "-L" "/home/flavio/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/flavio/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib" "--edition=2018" "-L" "/tmp/state/require_transition_to.stage-id.aux"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
{"message":"multiple matching crates for `async_trait`","code":{"code":"E0464","explanation":"The compiler found multiple library files with the requested crate name.\n\nThis error can occur in several different cases -- for example, when using\n`extern crate` or passing `--extern` options without crate paths. It can also be\ncaused by caching issues with the build directory, in which case `cargo clean`\nmay help.\n"},"level":"error","spans":[{"file_name":"tests/ui/state/require_transition_to.rs","byte_start":84,"byte_end":109,"line_start":3,"line_end":3,"column_start":1,"column_end":26,"is_primary":true,"text":[{"text":"extern crate async_trait;","highlight_start":1,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"candidates:\ncrate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so\ncrate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0464]: multiple matching crates for `async_trait`\n  --> tests/ui/state/require_transition_to.rs:3:1\n   |\nLL | extern crate async_trait;\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: candidates:\n           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so\n           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so\n\n"}
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
{"message":"For more information about this error, try `rustc --explain E0464`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0464`.\n"}

------------------------------------------


The actual stderr differed from the expected stderr.
Actual stderr saved to /tmp/state/require_same_object_state.stage-id.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args state/require_same_object_state.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "rustc" "tests/ui/state/require_same_object_state.rs" "-L" "/tmp" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/tmp/state/require_same_object_state.stage-id" "-A" "unused" "-Z" "ui-testing" "-L" "/home/flavio/hacking/kubernetes/krator/target/debug/deps" "-L" "/home/flavio/hacking/kubernetes/krator/target/debug" "-L" "/home/flavio/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/flavio/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib" "--edition=2018" "-L" "/tmp/state/require_same_object_state.stage-id.aux"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
{"message":"multiple matching crates for `async_trait`","code":{"code":"E0464","explanation":"The compiler found multiple library files with the requested crate name.\n\nThis error can occur in several different cases -- for example, when using\n`extern crate` or passing `--extern` options without crate paths. It can also be\ncaused by caching issues with the build directory, in which case `cargo clean`\nmay help.\n"},"level":"error","spans":[{"file_name":"tests/ui/state/require_same_object_state.rs","byte_start":74,"byte_end":99,"line_start":3,"line_end":3,"column_start":1,"column_end":26,"is_primary":true,"text":[{"text":"extern crate async_trait;","highlight_start":1,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"candidates:\ncrate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so\ncrate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0464]: multiple matching crates for `async_trait`\n  --> tests/ui/state/require_same_object_state.rs:3:1\n   |\nLL | extern crate async_trait;\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: candidates:\n           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so\n           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so\n\n"}
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
{"message":"For more information about this error, try `rustc --explain E0464`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0464`.\n"}

------------------------------------------

diff of stderr:

-error[E0277]: the trait bound `NotState: krator::State<PodState>` is not satisfied
-  --> $DIR/next_must_be_state.rs:39:32
+error[E0464]: multiple matching crates for `async_trait`
+  --> $DIR/next_must_be_state.rs:3:1
    |
-LL |         Transition::next(self, NotState)
-   |         ----------------       ^^^^^^^^ the trait `krator::State<PodState>` is not implemented for `NotState`
-   |         |
-   |         required by a bound introduced by this call
+LL | extern crate async_trait;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
    |
-note: required by `Transition::<S>::next`
-  --> $SRC_DIR/src/state.rs:43:5
-   |
-LL | /     pub fn next<I: State<S>, O: State<S>>(_i: Box<I>, o: O) -> Transition<S>
-LL | |     where
-LL | |         I: TransitionTo<O>,
-   | |___________________________^
+   = note: candidates:
+           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so
+           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0277`.
+For more information about this error, try `rustc --explain E0464`.
 

The actual stderr differed from the expected stderr.
Actual stderr saved to /tmp/state/next_must_be_state.stage-id.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args state/next_must_be_state.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "rustc" "tests/ui/state/next_must_be_state.rs" "-L" "/tmp" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/tmp/state/next_must_be_state.stage-id" "-A" "unused" "-Z" "ui-testing" "-L" "/home/flavio/hacking/kubernetes/krator/target/debug/deps" "-L" "/home/flavio/hacking/kubernetes/krator/target/debug" "-L" "/home/flavio/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/flavio/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib" "--edition=2018" "-L" "/tmp/state/next_must_be_state.stage-id.aux"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
{"message":"multiple matching crates for `async_trait`","code":{"code":"E0464","explanation":"The compiler found multiple library files with the requested crate name.\n\nThis error can occur in several different cases -- for example, when using\n`extern crate` or passing `--extern` options without crate paths. It can also be\ncaused by caching issues with the build directory, in which case `cargo clean`\nmay help.\n"},"level":"error","spans":[{"file_name":"tests/ui/state/next_must_be_state.rs","byte_start":70,"byte_end":95,"line_start":3,"line_end":3,"column_start":1,"column_end":26,"is_primary":true,"text":[{"text":"extern crate async_trait;","highlight_start":1,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"candidates:\ncrate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so\ncrate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0464]: multiple matching crates for `async_trait`\n  --> tests/ui/state/next_must_be_state.rs:3:1\n   |\nLL | extern crate async_trait;\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: candidates:\n           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so\n           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so\n\n"}
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
{"message":"For more information about this error, try `rustc --explain E0464`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0464`.\n"}

------------------------------------------

diff of stderr:

-error[E0451]: field `state` of struct `StateHolder` is private
-  --> $DIR/cannot_construct_transition_next.rs:26:9
+error[E0464]: multiple matching crates for `async_trait`
+  --> $DIR/cannot_construct_transition_next.rs:3:1
    |
-LL |         state: Box::new(Stub),
-   |         ^^^^^^^^^^^^^^^^^^^^^ private field
+LL | extern crate async_trait;
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: candidates:
+           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so
+           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0451`.
+For more information about this error, try `rustc --explain E0464`.
 

The actual stderr differed from the expected stderr.
Actual stderr saved to /tmp/state/cannot_construct_transition_next.stage-id.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args state/cannot_construct_transition_next.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "rustc" "tests/ui/state/cannot_construct_transition_next.rs" "-L" "/tmp" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-C" "prefer-dynamic" "-o" "/tmp/state/cannot_construct_transition_next.stage-id" "-A" "unused" "-Z" "ui-testing" "-L" "/home/flavio/hacking/kubernetes/krator/target/debug/deps" "-L" "/home/flavio/hacking/kubernetes/krator/target/debug" "-L" "/home/flavio/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-L" "/home/flavio/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib" "--edition=2018" "-L" "/tmp/state/cannot_construct_transition_next.stage-id.aux"
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
{"message":"multiple matching crates for `async_trait`","code":{"code":"E0464","explanation":"The compiler found multiple library files with the requested crate name.\n\nThis error can occur in several different cases -- for example, when using\n`extern crate` or passing `--extern` options without crate paths. It can also be\ncaused by caching issues with the build directory, in which case `cargo clean`\nmay help.\n"},"level":"error","spans":[{"file_name":"tests/ui/state/cannot_construct_transition_next.rs","byte_start":70,"byte_end":95,"line_start":3,"line_end":3,"column_start":1,"column_end":26,"is_primary":true,"text":[{"text":"extern crate async_trait;","highlight_start":1,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"candidates:\ncrate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so\ncrate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0464]: multiple matching crates for `async_trait`\n  --> tests/ui/state/cannot_construct_transition_next.rs:3:1\n   |\nLL | extern crate async_trait;\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: candidates:\n           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-bb76eb0106e5175e.so\n           crate `async_trait`: /home/flavio/hacking/kubernetes/krator/target/debug/deps/libasync_trait-d7fb65c29a022f39.so\n\n"}
{"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
{"message":"For more information about this error, try `rustc --explain E0464`.","code":null,"level":"failure-note","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0464`.\n"}

------------------------------------------

thread 'compile_test' panicked at 'Some tests failed', /home/flavio/.cargo/git/checkouts/compiletest-rs-346efcee5beef3c0/1fed013/src/lib.rs:105:22
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    compile_test

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.25s

I'm using rust nightly on linux, I just installed it via rustup

Leave default features disabled, just enable what we care about.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
@kflansburg
Copy link
Member

We can ignore the UI tests. rustc keeps changing the output, I will fix that in a separate PR

@flavio
Copy link
Contributor Author

flavio commented Nov 22, 2021

BTW, once you're fine with the changes I'll squash everything into a single commit

Copy link
Member

@kflansburg kflansburg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kflansburg kflansburg merged commit 32d0b89 into krator-rs:main Nov 22, 2021
@flavio flavio deleted the fix-tokio-rustsec-2021-0124 branch November 23, 2021 08:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants