Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add serde_urlencoded to db-example Cargo.toml #128

Merged
merged 5 commits into from Sep 18, 2021
Merged

Add serde_urlencoded to db-example Cargo.toml #128

merged 5 commits into from Sep 18, 2021

Conversation

jaztec
Copy link
Contributor

@jaztec jaztec commented Sep 18, 2021

No real changes, just added serde_urlencoded to the db-example sub-project

I license past and future contributions under the dual MIT/Apache-2.0 license, allowing licensees to chose either at their option.

@HeroicKatora
Copy link
Owner

I wonder what's the point here as nothing depends on it directly? To influence version resolution of actix-http and awc (two transitive dependencies)? Since no Cargo.lock file is committed this will be completely redundant for everyone. And in case these two crates migrate to a newer version the example depends on an unecessary library.

@jaztec
Copy link
Contributor Author

jaztec commented Sep 18, 2021

That is true. However when I tried to cargo build this library from the root directory I got slapped on the wrist by rocket (I use 1.55.0 stable and rocket requires nightly as depicted in the docs) and this error on serde_urlencoded which is a dependency but not listed in Cargo.toml.

Listing it fixed it for me. But you are right about there has not been an apparent lock file generated. Maybe I need to get into the rust ecosystem a bit more first 😅

@jaztec
Copy link
Contributor Author

jaztec commented Sep 18, 2021

Before I retract the pull request, I guess the problem exists in generic module judging by the error message:

warning: `oxide-auth-actix` (lib) generated 1 warning
   Compiling db-example v0.1.0 (/home/jasper/Projects/jaztec/oxide-auth/oxide-auth-db/examples/db-example)
error[E0433]: failed to resolve: use of undeclared crate or module `serde_urlencoded`
  --> oxide-auth-db/examples/db-example/src/../../../../examples/support/generic.rs:80:9
   |
80 |         serde_urlencoded::to_string(extra).unwrap(),
   |         ^^^^^^^^^^^^^^^^ use of undeclared crate or module `serde_urlencoded`

The listing inside the Cargo.toml fixes this.

But again, like I said. I'm just starting out with rust and am probably looking at the problem the wrong way.

@jaztec jaztec closed this Sep 18, 2021
@jaztec jaztec reopened this Sep 18, 2021
@jaztec
Copy link
Contributor Author

jaztec commented Sep 18, 2021

Reopened just for the sake of thinking it being directly required anyway 😄

@HeroicKatora
Copy link
Owner

Huh, I was running on the assumption that CI would have complained about that one but you're right. Okay, I'm going to push an update to the CI scripts as well then :)

This also updates the standalone-example's Cargo file to ensure it won't
be accidentally published.
@jaztec
Copy link
Contributor Author

jaztec commented Sep 18, 2021

Well now you broke everything 😆.

@HeroicKatora
Copy link
Owner

I feared so. I'm about to try and unbreak it.

@jaztec
Copy link
Contributor Author

jaztec commented Sep 18, 2021

I'm on it as well, I think cirrus just needs an additional container for Redis https://github.com/jaztec/oxide-auth/blob/master/oxide-auth-db/src/primitives/db_registrar.rs#L190

@jaztec
Copy link
Contributor Author

jaztec commented Sep 18, 2021

The tests succeed for me locally but I'm running Redis locally as well

@HeroicKatora
Copy link
Owner

I think it would be easier to just skip the test on CI than to add an extra dependency there. At least that's easy to configure. Maybe you can add the CI configuration with in a separate PR? I really like to keep everything else lightweight as possible.

@jaztec
Copy link
Contributor Author

jaztec commented Sep 18, 2021

I guess the host mapping is wrong, which makes sense. But changing that would mean local tests failing when you don't have a mapping in your hosts file.

Just made a push with (hopefully) a cirrus skip test. Not sure I've got the syntax right though

@jaztec
Copy link
Contributor Author

jaztec commented Sep 18, 2021

Apparently not

@HeroicKatora
Copy link
Owner

Let's try a literal environment flag in tests then ^^

@jaztec
Copy link
Contributor Author

jaztec commented Sep 18, 2021

It seems your rust foo is doing the trick

@HeroicKatora HeroicKatora merged commit 412dbcb into HeroicKatora:master Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants