-
Notifications
You must be signed in to change notification settings - Fork 61
Refactor runtime crates into feature-guarded modules #131
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
Conversation
|
Ok the first thing I would do is to split this PR into several PRs, one per submodule. Also don't remove the old packages now, we can do that later. |
|
You also need to sign the DCO :) |
I signed all but the one I need help with. I can do that when I figure out how to fix it. |
So you prefer 1-PR-per-submodule to 1-commit-per-submodule as I currently have it? I can do that, but I'm curious why that's better? Once I back out the deletion of the existing packages and |
|
Ok, I just force-pushed changes that leave the old workspace dirs intact and don't add the Because tests are replicated in the parent workspace now, each will run twice for |
slinkydeveloper
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you try to run locally cargo doc --open --all-features to see if this breaks the doc build? You should also try cargo publish --dry-run to see if any publish check breaks (although I'm not sure you can do that without logging in)
| use std::collections::HashMap; | ||
| use std::str::FromStr; | ||
|
|
||
| macro_rules! unwrap_optional_header { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not for this PR, but maybe for future refactorings: a lot of these macros are copy paste, because the APIs are practically the same even if their names are different, so it would be nice to find a way to unify them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in #146
|
Another thing I'm not 100% sure of is how this is gonna play out with our existing CI config, with our matrix of different targets... For example, the actix feature is not supposed to build with wasm. I might be wrong, but it seems to me that the integrations are not tested anymore with this PR, without modifying the existing github actions config. |
Done. Fixed several broken links. I only tested the publish from the root and it seemed fine, abandoning only because of |
I added an As far as the wasm32 build goes, I added the [jim@localhost reqwest-wasm-example]$ npm run serve
> @ serve /home/jim/src/rust/sdk-rust/example-projects/reqwest-wasm-example
> webpack-dev-server
🧐 Checking for wasm-pack...
ℹ️ Installing wasm-pack
ℹ 「wds」: Project is running at http://localhost:8080/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /home/jim/src/rust/sdk-rust/example-projects/reqwest-wasm-example
✖ 「wdm」: Error: Rust compilation.
at ChildProcess.<anonymous> (/home/jim/src/rust/sdk-rust/example-projects/reqwest-wasm-example/node_modules/@wasm-tool/wasm-pack-plugin/plugin.js:210:16)
at ChildProcess.emit (events.js:376:20)
at maybeClose (internal/child_process.js:1055:16)
at Socket.<anonymous> (internal/child_process.js:441:11)
at Socket.emit (events.js:376:20)
at Pipe.<anonymous> (net.js:673:12) |
Mhhh that error is weird, perhaps the js deps needs to be updated |
Conditionally compile actix module when enabled Mostly straightforward, though I don't particularly love that dev-deps can't be optional: rust-lang/cargo#1596 Signed-off-by: Jim Crossley <[email protected]>
Conditionally compile reqwest module when enabled This resulted in a naming conflict between my desired feature name, "reqwest", and the optional dependency itself. So I adopted the convention of prefixing the features with "cloudevents-". Signed-off-by: Jim Crossley <[email protected]>
Conditionally compile rdkafka module when enabled Signed-off-by: Jim Crossley <[email protected]>
Conditionally compile warp module when enabled Signed-off-by: Jim Crossley <[email protected]>
Verified `cargo doc --all-features` works Signed-off-by: Jim Crossley <[email protected]>
For the wasm32 build, we replace --package <<redundant>> with --features cloudevents-reqwest Signed-off-by: Jim Crossley <[email protected]>
Didn't help. I get the same error on I think I've addressed all your concerns. Let me know if you need anything else! |
Now that we've refactored the protocol bindings from crates to feature-guarded modules (PR cloudevents#131), we can remove the workspaces for those crates. Signed-off-by: Jim Crossley <[email protected]>
Now that we've refactored the protocol bindings from crates to feature-guarded modules (PR #131), we can remove the workspaces for those crates. Signed-off-by: Jim Crossley <[email protected]>
To address #130