-
Notifications
You must be signed in to change notification settings - Fork 18
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
Allow setting the filename used in the protoc command #437
Allow setting the filename used in the protoc command #437
Conversation
Thanks for kicking off the CI Haven't had a reason to fiddle with ABCL, hopefully this is fun to fix |
Ignore the ABCL test, it's been failing. |
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.
Just a few nits...
asdf.lisp
Outdated
(defun get-search-paths (protobuf-source-file) | ||
"For a given protobuf-source-file, generate the search paths that should be used. | ||
To do this, it generates a search path from the component, as well as the | ||
PROTO-SEACH-PATH specified in the asd component. |
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.
PROTO-SEARCH-PATH
or probably better as :proto-search-path
?
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.
Done, thanks
asdf.lisp
Outdated
@@ -108,6 +108,24 @@ to PARENT-PATH." | |||
(resolve-relative-pathname path parent-path)) | |||
search-path)))) | |||
|
|||
(defun get-search-paths (protobuf-source-file) | |||
"For a given protobuf-source-file, generate the search paths that should be used. |
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.
I think to pass internal Google linting rules the parameter name needs to be all caps, but I'm not sure about this. @Slids will know for sure.
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.
Indeed, this will fail presubmits
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.
resolved, thanks.
Are the linting rules public anywhere? Aware of the style guide but not sure if that's the same thing
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 that I know of. Maybe we can get @Slids to open source it. :-)
google/protobuf/descriptor.proto
Outdated
@@ -645,6 +827,17 @@ message EnumOptions { | |||
|
|||
reserved 5; // javanano_as_lite | |||
|
|||
// Enable the legacy handling of JSON field name conflicts. This lowercases | |||
// and strips underscored from the fields before comparison in proto3 only. |
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.
underscored, haha. Silly Google. Jon, better get on this! :)
tests/deep-import-test.lisp
Outdated
:signal-condition-on-fail t)) | ||
|
||
(deftest test-all-imports-are-included (deep-import-suite) | ||
"Ensure file imports of the parent structure are properly read and stored with it's file descriptor." |
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.
it's -> its
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.
fixed, thanks
asdf.lisp
Outdated
@@ -108,6 +108,24 @@ to PARENT-PATH." | |||
(resolve-relative-pathname path parent-path)) | |||
search-path)))) | |||
|
|||
(defun get-search-paths (protobuf-source-file) | |||
"For a given protobuf-source-file, generate the search paths that should be used. |
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.
Indeed, this will fail presubmits
cl-protobufs.asd
Outdated
:pathname "" | ||
:depends-on ("models" "misc") | ||
:components | ||
((:protobuf-source-file "descriptor" |
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.
you update the well known proto files, please do that in a seperate pull.
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.
Done. Thanks
Pretty sure I addressed all review notes, thanks for sending those. Sorry for the delay, a lot going on this and next week |
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.
Ready for CI and internal review
internally we got these errors |
Sorry it took so long, and thanks! |
This should resolve #431.
This PR makes it so setting
PROTO-SOURCE-FILE
specifically uses that value as the file name passed intoprotoc
. With this change, lisp files generated from proto files will use thePROTO-SOURCE-FILE
as thefile_name
template var that ultimately gets sent as a key to the*file-descriptors*
variable.For example, if you define a component in your asd file like
(:proto-source-file "foo/bar/baz")
, the resulting lisp file will contain these lines:The upstream HEAD yields this form:
This is problematic because if another file contains
import "foo/bar/baz.proto";
, the asdf integration will fail (at validate-imports) since upstream HEAD adds#P"baz.proto"
to*file-descriptors*
.Testing on SBCL 2.3.9 with Arch Linux (kernel version 6.9.3-arch1-1) passes.
additional changes
show output from
protoc
in case there's an error.the well-known types have been updated to reflect the current upstream protobuf repo.
import
statement ongoogle/protobuf/type.proto
to only targetsource_context.proto
.