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

Make the bootstrapping process more robust: #66

Merged
merged 4 commits into from
Jan 4, 2017

Conversation

judah
Copy link
Collaborator

@judah judah commented Jan 2, 2017

  • Make a new package 'proto-lens-descriptors' for the descriptors
  • Name those modules "Proto." instead of "Bootstrap.Proto."
  • Add special logic so the descriptors modules don't use the reexported
    modules from proto-lens-protoc (otherwise we'd get a circular dependency)
  • Make the bootstrapping script use a special stack YAML file.

- Make a new package 'proto-lens-descriptors' for the descriptors
- Name those modules "Proto.*" instead of "Bootstrap.Proto.*"
- Add special logic so the descriptors modules don't use the reexported
  modules from proto-lens-protoc (otherwise we'd get a circular dependency)
- Make the bootstrapping script use a special stack YAML file.
Copy link
Collaborator

@blackgnezdo blackgnezdo left a comment

Choose a reason for hiding this comment

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

Does this get proto-lens closer to being completely buildable by cabal?

@@ -0,0 +1,30 @@
Copyright Author name here (c) 2017
Copy link
Collaborator

Choose a reason for hiding this comment

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

Update?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@@ -60,15 +61,21 @@ fileSyntaxType f = case f ^. syntax of
"" -> Proto2 -- The proto compiler doesn't set syntax for proto2 files.
s -> error $ "Unknown syntax type " ++ show s

-- Whether to import the "Reexport" modules or the originals;
-- e.g., Data.ProtoLens.Reexport.Data.Map vs Data.Map.
data UseReexport = UseReexport | UseOriginal
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe change this to [newtype around] ModuleName -> ImportDecl? UseOriginal would become importSimple.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Switched to ImportDecl -> ImportDecl. Since that type's pretty simple, I don't think it's worth adding a newtype.

@judah
Copy link
Collaborator Author

judah commented Jan 3, 2017

Does this get proto-lens closer to being completely buildable by cabal?
You mean for the Hackage releases to not require protoc? Maybe a little, I'm not sure. I think the hard part will be to work around some issues in how Cabal unpacks tarballs; see for example:
haskell/cabal#2362
haskell/cabal#2311

@@ -71,11 +72,11 @@ data UseReexport = UseReexport | UseOriginal
generateModule :: ModuleName
-> [ModuleName] -- ^ The imported modules
-> SyntaxType
-> UseReexport
-> (ImportDecl -> ImportDecl)
Copy link
Collaborator

Choose a reason for hiding this comment

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

A type synonym would still be nice for discoverability. You already found a name for it: ModifyImports.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@judah judah merged commit 695b40b into google:master Jan 4, 2017
@judah judah deleted the descriptor-bootstrap branch January 4, 2017 22:51
avdv pushed a commit to avdv/proto-lens that referenced this pull request Aug 9, 2023
- Make a new package 'proto-lens-descriptors' for the descriptors
- Name those modules "Proto.*" instead of "Bootstrap.Proto.*"
- Add special logic so the descriptors modules don't use the reexported
  modules from proto-lens-protoc (otherwise we'd get a circular dependency)
- Make the bootstrapping script use a special stack YAML file.
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.

2 participants