You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm cloning ldmx-sw into the "subfolder" directory, while a denv workspace already exists in a parent directory above it.
Running just init would claim that the workspace is already initialized
ewallin@ludde:~/Programming/parent/subfolder/ldmx-sw$ just init
Workspace already initialized.
denv_workspace="/home/ewallin/Programming/parent"
denv_name="ldmx"
denv_image="ldmx/dev:latest"
[...]
This is because it finds a workspace higher up in the file hierarchy:
ewallin@ludde:~/Programming/parent/subfolder/ldmx-sw$ denv check --workspace
[...]
Found denv_workspace="/home/ewallin/Programming/parent"
But just configure only looks for the denv config file in ${LDMX_BASE}, and thus fails:
ewallin@ludde:~/Programming/parent/subfolder/ldmx-sw$ just configure build
denv cmake -B build -S . -DADDITIONAL_WARNINGS=ON -DENABLE_CLANG_TIDY=ON build
/home/ewallin/.local/bin/denv: 488: .: cannot open /home/ewallin/Programming/parent/subfolder/.denv/config: No such file
error: Recipe `configure-base` failed on line 65 with exit code 2
The text was updated successfully, but these errors were encountered:
In the short term, you can get around this by forcing denv to override the parent denv with the LDMX_BASE denv.
cd parent/subfolder
denv init ldmx/dev:latest
# respond "y" if asked about overriding (introduced in denv v1.1)
In the long term, we should decide if this is a workflow that should be supported. Having denvs within one another can easily lead to confusion since cd .. can change which denv is chosen to run. If we do want to support this workflow, then we would want to pass the prompts that denv issues to the user so they are at least acknowledging that they have nested denvs.
Edit: Update with example
tom@appa:~/code/denv$ mkdir nested-eg
tom@appa:~/code/denv$ cd nested-eg/
tom@appa:~/code/denv/nested-eg$ denv init alpine:3.19
tom@appa:~/code/denv/nested-eg$ mkdir subdir
tom@appa:~/code/denv/nested-eg$ cd subdir/
tom@appa:~/code/denv/nested-eg/subdir$ denv init alpine:3.20
This workspace already has a denv (in /home/tom/code/denv/nested-eg). Would you like to override it? [Y/n] y
3.20: Pulling from library/alpine
da9db072f522: Pull complete
Digest: sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a
Status: Downloaded newer image for alpine:3.20
docker.io/library/alpine:3.20
tom@appa:~/code/denv/nested-eg/subdir$ denv cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.20.3
PRETTY_NAME="Alpine Linux v3.20"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
tom@appa:~/code/denv/nested-eg/subdir$ cd ..
tom@appa:~/code/denv/nested-eg$ denv cat /etc/os-release
NAME="Alpine Linux"
ID=alpine
VERSION_ID=3.19.3
PRETTY_NAME="Alpine Linux v3.19"
HOME_URL="https://alpinelinux.org/"
BUG_REPORT_URL="https://gitlab.alpinelinux.org/alpine/aports/-/issues"
tom@appa:~/code/denv/nested-eg$ denv version
denv v1.1.1
Vocabulary Sidenote:
Here and in the denv documentation, I use "overwrite" when denv would replace a denv configuration and "override" when denv is simply creating a new, nested configuration. Since denv stops at the first .denv/config found when traversing the parent directory tree, creating a new configuration while in a subdirectory of a current configuration effectively "overrides" that parent configuration for that subdirectory (and any of its subdirectories). I avoid saying "overwrite" since the parent configuration is still there and can still be accessed by going into that directory.
Describe the bug
just init
does not initialize a new denv workspace properly, if a workspace already exists further up the file hierarchy.To Reproduce
The file structure looks something like this:
I'm cloning ldmx-sw into the "subfolder" directory, while a denv workspace already exists in a parent directory above it.
Running
just init
would claim that the workspace is already initializedThis is because it finds a workspace higher up in the file hierarchy:
But
just configure
only looks for the denv config file in${LDMX_BASE}
, and thus fails:The text was updated successfully, but these errors were encountered: