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
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bcmills
Copy link
Contributor

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

@gopherbot gopherbot added this to the Unreleased milestone May 12, 2020
@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label May 12, 2020
@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 12, 2020
@bradfitz
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Builders x/build issues (builders, bots, dashboards) NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants