-
Notifications
You must be signed in to change notification settings - Fork 56
RSDK-8303-3: use api version in makefile #696
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
RSDK-8303-3: use api version in makefile #696
Conversation
@@ -23,7 +23,8 @@ typecheck: | |||
_buf: clean | |||
rm -rf src/viam/gen | |||
chmod +x plugin/main.py | |||
buf generate buf.build/viamrobotics/api | |||
$(eval API_VERSION := $(shell grep 'API_VERSION' src/viam/version_metadata.py | awk -F '"' '{print $$2}')) |
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 there's one too many $
in here? The command as written fails for me locally, but changing to print $2
works.
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.
Oh that's interesting. It ran well for me. I just tried making that change and running it. It fails when I only have 1 $
.
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.
From what I understand, we need two $
since only using one means make
thinks that it's a makefile variable. make
should be passing $$2
as $2
to awk
. If this is true, I wonder why it's not working for you, and how it works with only one $
. Could it be a difference in versions?
When I use only one $
, it becomes: api:vAPI_VERSION = "0.1.327"
instead of api:v0.1.327
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.
Interesting... Well I've been running just on the command line, if it works for you from the makefile
then it's probably fine, thanks for following up :)
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.
Oh, I've been testing by running make buf
on the command line.
If you copy/paste grep 'API_VERSION' src/viam/version_metadata.py | awk -F '"' '{print $$2}'
into the terminal, then it will fail. For that, if that's what you did, you do need only 1.
Ensures that when a user runs
make buf
that they're generating the right API version.