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

Refactor vendor dir #13

Merged
merged 8 commits into from
Aug 17, 2023
Merged

Refactor vendor dir #13

merged 8 commits into from
Aug 17, 2023

Conversation

mara-schulke
Copy link
Contributor

Changes

This pr refactors the package store from:

proto
  /vendor/
    <a>/
      Proto.toml
      vendor/<c>/..
    <b>/
      Proto.toml
      vendor/<c>/..

To

proto
  /vendor/
    <a>/
      Proto.toml
      ..
    <b>/
      Proto.toml
      ..
    <c>/
      Proto.toml
      ..

And simplifies code generation implementation.

Upsides

This drastically simplifies the package store layout, and more importantly, enables people to compile it using any protobuf code gen tool, such as protoc without any change.

Furthermore it removes the type duplication problem that occured when nesting dependencies:

Before the change, you had two version of the c library types:

mod a {
  mod c { /* ... */ }
}

mod b {
  mod c { /* ... */ }
}

Which is now resolved, since tonic generates this structure:

mod a { /* ... */ }
mod b { /* ... */ }
mod c { /* ... */ }

Downsides

This change has the implication that all dependencies may only use one single version of c which is not ideal. We can and will solve this by introducing proper version resolution mechanism soon.

Copy link
Contributor

@cdbrkfxrpt cdbrkfxrpt left a comment

Choose a reason for hiding this comment

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

a few very minor nits aside, this lgtm

src/generator.rs Outdated Show resolved Hide resolved
src/generator.rs Outdated Show resolved Hide resolved
src/package.rs Outdated Show resolved Hide resolved
src/generator.rs Outdated Show resolved Hide resolved
src/generator.rs Outdated Show resolved Hide resolved
mara-schulke and others added 3 commits August 17, 2023 12:30
Co-authored-by: Oliver Wangler <[email protected]>
Co-authored-by: Oliver Wangler <[email protected]>
Co-authored-by: Florian Eich <[email protected]>
@mara-schulke mara-schulke merged commit 94ecfbc into main Aug 17, 2023
5 checks passed
@mara-schulke mara-schulke deleted the mara/vendor-dir branch August 17, 2023 11:35
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.

Refactor the vendor folder so it can be compiled with out of the box tooling
3 participants