Skip to content

Commit c8cac90

Browse files
draft updates to compatibility notes (#54)
* draft updates to compatibility notes * fix typo
1 parent a0d17a5 commit c8cac90

File tree

1 file changed

+88
-1
lines changed

1 file changed

+88
-1
lines changed

src/developing/compatibility.md

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ build config | image version
136136
---|---
137137
default | >= v4.0.0
138138

139-
### >= 4.3.1
139+
### >= 4.3.1, < v4.4.13
140140
One release after getting development to function with ldmx/dev:v5,
141141
I (Tom) accidentally introduced a change that breaks compatibility with ldmx/dev:4.2.2
142142
which uses an older version of ROOT.
@@ -158,3 +158,90 @@ build config | image version
158158
---|---
159159
default | >= v5.0.0
160160
include lorentz vector | >= v4.0.0
161+
162+
### >= v4.4.13
163+
Some changes were made to how the environment in the development container is configured so
164+
that the denv workspace can be moved into ldmx-sw [ldmx-sw #1472](https://github.com/LDMX-Software/ldmx-sw/issues/1472).
165+
This leads to a set of confusing warnings and errors that are difficult for a non-expert to understand.
166+
167+
The main source of this is that `denv` relies on copying a shell configuration file called `.profile` into your workspace and then reading that configuration file when launching the container.
168+
This `.profile` allows you to [customize your container environment](https://tomeichlersmith.github.io/denv/tune.html#rc-files), but it also is _never_ overwritten by `denv` in order to avoid undoing any changes you want to make.
169+
170+
If you don't care about customizing your local container environment (e.g. you've never looked at the `.profile` before), then you can just remove it and have `denv` make a new copy whenever you switch images.
171+
```
172+
rm .denv/skel-init .bashrc .bash_logout .profile
173+
denv config image <pull-or-different-tag>
174+
```
175+
176+
If you do care about keeping your local customizations,
177+
I've written some notes on changes that I suspect you need to make to `.profile` depending on
178+
the error message you are seeing.
179+
180+
You can find the `.profile` that `denv` is using within your denv workspace by running `denv printenv HOME`
181+
which will print the directory in which the `.profile` will be.
182+
183+
~~~admonish note title="Neither `LDMX_BASE` nor `LDMX_SW_INSTALL` is defined." collapsible=true
184+
This comes from having a `.profile` file from an image >= v5.1.1 being used with an older image <= v5.1.0
185+
that expects a different `.profile`.
186+
187+
Inside the `.profile`, make sure to define `LDMX_SW_INSTALL` _before_ the `. /etc/ldmx-env-init.sh` line.
188+
189+
If ldmx-sw is the denv workspace, then you should define
190+
```
191+
export LDMX_SW_INSTALL=${HOME}/install
192+
```
193+
or if the parent directory of ldmx-sw is the denv workspace, then
194+
```
195+
export LDMX_SW_INSTALL=${HOME}/ldmx-sw/install
196+
```
197+
or you can set it to some other path that you are installing ldmx-sw to.
198+
~~~
199+
200+
~~~admonish note title="fire: command not found" collapsible=true
201+
This arises from a lot of different combinations of `.profile` files and image versions,
202+
but it simplifies once you know a little of the background.
203+
Most of the time it comes up because you have an old (<= v5.1.0) `.profile` being used
204+
with a new (>= v5.1.1) image.
205+
206+
The shell within the container looks through the directories in a `:`-separated list
207+
stored in the `PATH` environment variable, so this error crops up if the `PATH` variable
208+
is not configured properly.
209+
210+
You can use `denv printenv PATH` to see where the shell is looking for executables.
211+
You want to leave the `/usr/...` ones as written (those are the ones for stuff in the image),
212+
but the other one refers to a directory that is supposed to be on your system and point to
213+
where ldmx-sw is installed.
214+
215+
For example, you may need to remove the `LDMX_BASE` lines from within the `.profile` file in your denv
216+
workspace. Notice that before I edited `.profile` with `vim`, there is an extra "ldmx-sw" in the path to its
217+
install.
218+
```
219+
tom@appa:~/code/ldmx/ldmx-sw$ denv printenv PATH
220+
/home/tom/code/ldmx/ldmx-sw/ldmx-sw/install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/src/GENIE/Generator/bin:/usr/local/src/GENIE/Reweight/bin
221+
tom@appa:~/code/ldmx/ldmx-sw$ tail .profile
222+
223+
# set PATH so it includes user's private bin if it exists
224+
if [ -d "$HOME/.local/bin" ] ; then
225+
PATH="$HOME/.local/bin:$PATH"
226+
fi
227+
# make sure LDMX_BASE is defined for ldmx-env-init.sh
228+
if [ -z "${LDMX_BASE+x}" ]; then
229+
export LDMX_BASE="${HOME}"
230+
fi
231+
. /etc/ldmx-env-init.sh
232+
tom@appa:~/code/ldmx/ldmx-sw$ vim .profile
233+
tom@appa:~/code/ldmx/ldmx-sw$ tail .profile
234+
# set PATH so it includes user's private bin if it exists
235+
if [ -d "$HOME/bin" ] ; then
236+
PATH="$HOME/bin:$PATH"
237+
fi
238+
239+
# set PATH so it includes user's private bin if it exists
240+
if [ -d "$HOME/.local/bin" ] ; then
241+
PATH="$HOME/.local/bin:$PATH"
242+
fi
243+
. /etc/ldmx-env-init.sh
244+
tom@appa:~/code/ldmx/ldmx-sw$ denv printenv PATH
245+
/home/tom/code/ldmx/ldmx-sw/install/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/src/GENIE/Generator/bin:/usr/local/src/GENIE/Reweight/bin
246+
```
247+
~~~

0 commit comments

Comments
 (0)