Skip to content

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

Conversation

purplenicole730
Copy link
Member

@purplenicole730 purplenicole730 commented Jul 30, 2024

Ensures that when a user runs make buf that they're generating the right API version.

@purplenicole730 purplenicole730 marked this pull request as ready for review July 30, 2024 16:16
@purplenicole730 purplenicole730 requested a review from a team as a code owner July 30, 2024 16:16
@purplenicole730 purplenicole730 requested review from stuqdog, lia-viam and njooma and removed request for lia-viam July 30, 2024 16:16
@@ -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}'))
Copy link
Member

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.

Copy link
Member Author

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 $.

Copy link
Member Author

@purplenicole730 purplenicole730 Aug 1, 2024

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

Copy link
Member

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 :)

Copy link
Member Author

@purplenicole730 purplenicole730 Aug 1, 2024

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.

@purplenicole730 purplenicole730 merged commit fd128c7 into viamrobotics:main Aug 1, 2024
13 checks passed
@purplenicole730 purplenicole730 deleted the RSDK-8303-use-api-version-in-makefile branch August 1, 2024 15:28
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