Skip to content

Decide: remove no-op or legacy flags and features (--environment, --daemon, ResolveV2 v1, TOML/XML pull, hidden commands) #3121

Open

Description

@mikeland73

Each item below can delete code, but each also changes user-visible behaviour. A maintainer needs to decide before anyone implements them.

  • --environment flag.
  • devbox setup nix --daemon (see devbox setup nix reinstalls even when nix is present, and --daemon is unused #3111).
    • nix.EnsureNixInstalled(ctx, w, withDaemonFunc) never calls withDaemonFunc, and runInstallNixCmd ignores the flag as well.
    • That makes nixDaemonFlagVal, with its "running as root" warning, dead.
    • Options: delete the flag, or wire it into nix.Installer. Either way, drop the parameter and nixDaemonFlagVal.
  • ResolveV2 feature flag.
    • It is on by default, so the v1 path in internal/lock/resolve.go and buildLockSystemInfos only runs with DEVBOX_FEATURE_RESOLVE_V2=0.
    • Removing it saves ~60 lines plus tests, but drops the user's escape hatch.
    • boxcli/search.go still uses v1 Resolve for pkg@ver search, so it needs to move to v2 or keep that client method.
    • If v1 stays, tidy it up:
      • remove the obsolete loop-variable copies;
      • use a plain Mutex instead of the RWMutex;
      • drop the duplicated len(outputs) check.
  • TOML/XML support in cuecfg.
    • No TOML or XML file is read or written anywhere.
    • The only effect is that IsSupportedExtension routes .toml and .xml pull URLs to a loader that only parses JSON, so they fail anyway.
    • Proposal: delete toml.go and xml.go and InitFile, and unexport ParseFileWithExtension, Marshal and Unmarshal. Consider renaming the package, since it contains no CUE code.
    • Such URLs would then be rejected up front instead of failing to parse.
  • Hidden dev-only commands. generate debug and the root all command (listAllCommands) have no tests, docs or scripts. Delete them unless maintainers use them by hand.

Explicitly keep ScriptExitOnError. It is on by default, but it is the only way for users to opt out.


From specs/code-improvements.md (#3060), items A11, A27, B1, B3–B5, E8 and E9.

Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions