-
Notifications
You must be signed in to change notification settings - Fork 223
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
Completion generation with meson
requires valid subgid/subuid
#1246
Comments
I think we can do something like this. λ src main» git diff cmd/completion.go
diff --git a/src/cmd/completion.go b/src/cmd/completion.go
index 26ed378..c71135b 100644
--- a/src/cmd/completion.go
+++ b/src/cmd/completion.go
@@ -32,6 +32,7 @@ var completionCmd = &cobra.Command{
ValidArgs: []string{"bash", "fish", "zsh"},
Args: cobra.ExactValidArgs(1),
RunE: completion,
+ PersistentPreRunE: func(cmd *cobra.Command, args []string) error { return nil },
}
func init() { It would ignore some of the setup done with regard to the configuration and logging, but do we need that for the completion sub command? |
I'm building toolbox with meson in a Python virtualenv and getting this error. Is it related to this bug? Is there a workaround? I'm not familiar with subuid/subgid.
Contents of the log file:
|
That error is not relevant for this bug. You are missing headers on your system. |
As @Foxboron said, you are missing some header files and such. Shadow 4.9 introduced a new shared library called |
@debarshiray I didn't! I'll test it in a day or two :) |
@debarshiray Thanks. I opened a separate bug report: #1247 |
Having a separate convenience function reduces the indentation levels by at least one, and sometimes two, and makes it easy to have more detailed debug logs. This will make the subsequent commit easier to read. containers#1246
Ever since commit bafbbe8, the shell completions are generated while building Toolbx using the 'completion' command. This involves running toolbox(1) itself, and hence validating the subordinate user and group ID ranges. Unfortunately, some build environments don't have subordinate ID ranges set up. Therefore, it's better to avoid validating them when generating the shell completions, especially, since they are generated by Cobra itself and subordinate ID ranges are not involved at all. Note that subordinate ID ranges may be needed when the generated shell completions are actually used in interactive command line environments. The shell completions invoke the hidden '__complete' command to get the results that are presented to the user, and, if needed, the subordinate ID ranges will continue to be used by podman(1) as part of that. containers#1246
Ever since commit bafbbe8, the shell completions are generated while building Toolbx using the 'completion' command. This involves running toolbox(1) itself, and hence validating the subordinate user and group ID ranges. Unfortunately, some build environments don't have subordinate ID ranges set up. Therefore, it's better to avoid validating them when generating the shell completions, especially, since they are generated by Cobra itself and subordinate ID ranges are not involved at all. Note that subordinate ID ranges may be needed when the generated shell completions are actually used in interactive command line environments. The shell completions invoke the hidden '__complete' command to get the results that are presented to the user, and, if needed, the subordinate ID ranges will continue to be used by podman(1) as part of that. Some changes by Debarshi Ray. containers#1246
Ever since commit bafbbe8, the shell completions are generated while building Toolbx using the 'completion' command. This involves running toolbox(1) itself, and hence validating the subordinate user and group ID ranges. Unfortunately, some build environments, like openSUSE's, don't have subordinate ID ranges set up. Therefore, it's better to not validate the subordinate IDs ranges when generating the shell completions, since they are generated by Cobra itself and subordinate ID ranges are not involved at all. Note that subordinate ID ranges may be needed when the generated shell completions are actually used in interactive command line environments. The shell completions invoke the hidden '__complete' command to get the results that are presented to the user, and, if needed, the subordinate ID ranges will continue to be used by podman(1) as part of that. Some changes by Debarshi Ray. containers#1246
This is meant to roughly replicate the build environments used by downstream distributors to build toolbox(1). These can be restricted in odd ways compared to a fully featured environment where toolbox(1) is actually going to be used. It's important to ensure that toolbox(1) can be built by downstream distributors without any unnecessary hassle. containers/podman#17657 containers#1246
This is meant to roughly replicate the build environments used by downstream distributors to build toolbox(1). These can be restricted in odd ways compared to a fully featured environment where toolbox(1) is actually going to be used. It's important to ensure that toolbox(1) can be built by downstream distributors without any unnecessary hassle. containers/podman#17657 containers#1246
Ever since commit bafbbe8, the shell completions are generated while building Toolbx using the 'completion' command. This involves running toolbox(1) itself, and hence validating the subordinate user and group ID ranges. Unfortunately, some build environments, like openSUSE's, don't have subordinate ID ranges set up. Therefore, it's better to not validate the subordinate IDs ranges when generating the shell completions, since they are generated by Cobra itself and subordinate ID ranges are not involved at all. Note that subordinate ID ranges may be needed when the generated shell completions are actually used in interactive command line environments. The shell completions invoke the hidden '__complete' command to get the results that are presented to the user, and, if needed, the subordinate ID ranges will continue to be used by podman(1) as part of that. Some changes by Debarshi Ray. containers#1246 containers#1249
This is meant to roughly replicate the build environments used by downstream distributors to build toolbox(1). These can be restricted in odd ways compared to a fully featured environment where toolbox(1) is actually going to be used. It's important to ensure that toolbox(1) can be built by downstream distributors without any unnecessary hassle. containers/podman#17657 containers#1246
The problem that you reported here is different from the one I experienced for Fedora. Turns out that folks at openSUSE are also having the same problem as you. Anyway, I attempted a fix at #1252 and added a test so that hopefully this doesn't regress. |
Ever since commit bafbbe8, the shell completions are generated while building Toolbx using the 'completion' command. This involves running toolbox(1) itself, and hence validating the subordinate user and group ID ranges. Unfortunately, some build environments, like openSUSE's, don't have subordinate ID ranges set up. Therefore, it's better to not validate the subordinate ID ranges when generating the shell completions, since they are generated by Cobra itself and subordinate ID ranges are not involved at all. Note that subordinate ID ranges may be needed when the generated shell completions are actually used in interactive command line environments. The shell completions invoke the hidden '__complete' command to get the results that are presented to the user, and, if needed, the subordinate ID ranges will continue to be used by podman(1) as part of that. Some changes by Debarshi Ray. containers#1246 containers#1249
This is meant to roughly replicate the build environments used by downstream distributors to build toolbox(1). These can be restricted in odd ways compared to a fully featured environment where toolbox(1) is actually going to be used. eg., the inability to use podman(1) in the case of Fedora or not having subordinate user and group ID ranges in the case of openSUSE. It's important to ensure that toolbox(1) can be built by downstream distributors without any unnecessary hassle. containers/podman#17657 containers#1246
Having a separate convenience function reduces the indentation levels by at least one, and sometimes two, and makes it easy to have more detailed debug logs. This will make the subsequent commit easier to read. containers#1246
Ever since commit bafbbe8, the shell completions are generated while building Toolbx using the 'completion' command. This involves running toolbox(1) itself, and hence validating the subordinate user and group ID ranges. Unfortunately, some build environments, like openSUSE's, don't have subordinate ID ranges set up. Therefore, it's better to not validate the subordinate ID ranges when generating the shell completions, since they are generated by Cobra itself and subordinate ID ranges are not involved at all. Note that subordinate ID ranges may be needed when the generated shell completions are actually used in interactive command line environments. The shell completions invoke the hidden '__complete' command to get the results that are presented to the user, and, if needed, the subordinate ID ranges will continue to be used by podman(1) as part of that. Some changes by Debarshi Ray. containers#1246 containers#1249
This is meant to roughly replicate the build environments used by downstream distributors to build toolbox(1). These can be restricted in odd ways compared to a fully featured environment where toolbox(1) is actually going to be used. eg., the inability to use podman(1) in the case of Fedora or not having subordinate user and group ID ranges in the case of openSUSE. It's important to ensure that toolbox(1) can be built by downstream distributors without any unnecessary hassle. containers/podman#17657 containers#1246
I am closing this because I believe this is fixed by #1252 now. Please re-open if you have reason to believe otherwise. :) |
@debarshiray Everything works after applying all the three relevant commits. |
Yay! Thanks for the feedback. |
Describe the bug
During building meson will try to create completions and this fails as the user doesn't have a set subuid/subgid in the build environment.
Steps how to reproduce the behaviour
Build toolbox without a subuid/subgid for the user.
Expected behaviour
Building toolbox in a restrictive build environment should work.
Actual behaviour
Building toolbox in a restrictive build environment doesn't work.
Screenshots
If applicable, add screenshots to help explain your problem.
Output of
toolbox --version
(v0.0.90+)Latest toolbox release.
The text was updated successfully, but these errors were encountered: