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

refresh alias overwrites init_hook #2103

Open
glennpratt opened this issue May 30, 2024 · 0 comments
Open

refresh alias overwrites init_hook #2103

glennpratt opened this issue May 30, 2024 · 0 comments
Labels
bug Something isn't working triage Issue needs triage

Comments

@glennpratt
Copy link

glennpratt commented May 30, 2024

What happened?

➜  devbox shell
Starting a devbox shell...
You can activate the virtual environment by running '. $VENV_DIR/bin/activate' (for fish shell, replace '.' with 'source')
➜  which python
/Users/gpratt/Code/my-project/bin/python
➜  refresh
➜  which python
/Users/gpratt/Code/my-project/.devbox/nix/profile/default/bin/python

I suppose I can just not use it, but other users will be prompted to use it, then things break for reasons they may not realize.

Steps to reproduce

  1. Create an init_hook which updates PATH
  2. Call refresh
  3. See PATH changes from init_hook are lost.

Command

shell

devbox.json

{
  "packages": {
    "age":             "latest",
    "argocd":          "2.8",
    "autossh":         "latest",
    "cilium-cli":      "latest",
    "coreutils":       "latest",
    "curl":            "latest",
    "git":             "latest",
    "gnumake":         "latest",
    "jq":              "latest",
    "kubectl":         "1.28",
    "kubernetes-helm": "latest",
    "linode-cli":      "latest",
    "mkcert":          "latest",
    "netcat-openbsd": {
      "version":            "latest",
      "excluded_platforms": ["aarch64-darwin", "x86_64-darwin"]
    },
    "pulumi":                                "latest",
    "pulumiPackages.pulumi-language-python": "latest",
    "python":                                "3.11",
    "s3cmd":                                 "latest",
    "shellcheck":                            "latest",
    "sonobuoy":                              "latest",
    "stdenv.cc.cc.lib":                      "",
    "tilt":                                  "latest",
    "uv":                                    "latest",
    "yq-go":                                 "latest",
    "ruff":                                  "0.4.5"
  },
  "shell": {
    "init_hook": [
      "[ -n \"${PROJ_INIT_SKIP:-}\" ] && return",
      ". \"$DEVBOX_PROJECT_ROOT/devbox-init.sh\""
    ]
  }
}

Devbox version

0.10.7

Nix version

nix (Nix) 2.18.2

What system does this bug occur on?

macOS (Apple Silicon)

Debug logs

No response

@glennpratt glennpratt added bug Something isn't working triage Issue needs triage labels May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs triage
Development

No branches or pull requests

1 participant