Skip to content
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

x/build/cmd/gomote: "--i-will-not-break-the-host" flag breaks argument order #39020

Open
bcmills opened this issue May 12, 2020 · 1 comment
Open

Comments

@bcmills
Copy link
Member

@bcmills bcmills commented May 12, 2020

gomote ssh currently requires an extra flag, --i-will-not-break-the-host, when connecting to a non-hermetic builder.

Unlike all of the other gomote flags, this one must be positioned ahead of the subcommand instead of behind it. That needlessly breaks scripts that wrap gomote for more ergonomic use (#29037).

Honestly, this flag is pretty obnoxious anyway — I think it should probably be replaced with a warning at login rather than an explicit flag. But if we keep the flag, it should at least be fixed so that it parses in the usual order for subcommand flags.

~/go$ mote ssh --i-will-not-break-the-host
+ SUBCMD=ssh
+ shift
+ '[' -z ssh ']'
+ '[' ssh == create ']'
+ '[' -z '' ']'
+ '[' -e /usr/local/google/home/bcmills/.gomote ']'
+ GOMOTE=user-bcmills-dragonfly-amd64-5_8-0
+ '[' -z user-bcmills-dragonfly-amd64-5_8-0 ']'
+ gomote ssh user-bcmills-dragonfly-amd64-5_8-0 --i-will-not-break-the-host
ssh usage: gomote ssh <instance>
  -i-will-not-break-the-host
        required for older host configs with reused filesystems; using this says that you are aware that your changes to the machine's root filesystem affect future builds. This is a no-op for the newer, safe host configs.

CC @andybons @bradfitz

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented May 12, 2020

It's hardly the only subcommand with its own FlagSet. Most have their own subcommand-specific flags.

I'd rather you just change gomote to make it more ergonomic rather than everybody carry their own little wrappers.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants