-
Notifications
You must be signed in to change notification settings - Fork 60
Add go init profile and go-extension #631
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
c790123 to
59a27c0
Compare
f771a15 to
7478c81
Compare
5dafbc1 to
136e881
Compare
136e881 to
d2c2bc9
Compare
|
@rebornplusplus could be nice for you to have a look at this PR, as it might be one of the future use cases for the user research activities |
This reverts commit 7030c28.
|
Hi @tigarmo, can you have a look at this PR?. Thank you! |
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.
thanks!
rockcraft/commands/init.py
Outdated
| container registries out there. | ||
| platforms: # the platforms this rock should be built on and run on | ||
| amd64: | ||
| arm64: |
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.
out of curiosity how were these platforms chosen?
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 put all of them in the charmcraft PR for go, and I was suggested to remove armhf and riscv64, as they are not supported by the juju snap.
rockcraft/extensions/go.py
Outdated
| ] | ||
| return user_stage | ||
|
|
||
| def _get_nested(self, obj: dict, path: str) -> dict: |
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.
two comments here:
- I believe dots are valid in part names, so this is fragile. How about changing it to a list of names instead? E.g. the signature could be
def _get_nested(self, obj, *parts: str) - This says it returns
dictbutbuild-snapsis a list. Seems like this should returnAny
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.
Updated to be a list instead of a string so dots could be used in part names.
I changed to not get build-snaps directly, as it can be a list as you mentioned, and instead get the object. Otherwise I would need to complicate the _get_nested function to check for the type (and as it is a very simple helper, I preferred not to handle all cases unless more needs arise).
apply suggested fix to docs Co-authored-by: Tiago Nobrega <tiago.nobrega@canonical.com>
Co-authored-by: Tiago Nobrega <tiago.nobrega@canonical.com>
Co-authored-by: Tiago Nobrega <tiago.nobrega@canonical.com>
rockcraft/extensions/go.py
Outdated
| @override | ||
| def get_supported_bases() -> Tuple[str, ...]: | ||
| """Return supported bases.""" | ||
| return "bare", "ubuntu@22.04", "ubuntu:22.04", "ubuntu@24.04" |
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.
Should we remove 22.04 here?
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.
Removed
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.
nice! thanks
|
Commented all bases except amd64 as discussed. |
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.
LGTM, with some minor naming suggestions
Co-authored-by: Alex Lowe <alex.lowe@canonical.com>
This PR implements the spec ISD153, "12-Factor Go Support" for rockcraft.
For that, a new init profile called "go-framework" and a new go extension, called "go-framework" are needed. These additions are similar to the flask and django init profiles and extensions, with several differences. Some of the main differences are:
Also, new platforms are added to django, flask extension, so they are the same as in Go.