anurag008w commited on
Commit
9ec7be4
Β·
1 Parent(s): e691527

fix(jupyter): explicitly unset JUPYTERLAB_DIR to prevent inherited override

Browse files

Three places in start.sh carried comments stating JUPYTERLAB_DIR 'must
stay unset' / 'intentionally unset' / 'do NOT override', but none of
them actually called unset. A value inherited from a parent environment
(old bashrc, exported env var, or runtime injection) would therefore
survive and override JupyterLab's prebuilt application assets dir,
breaking the UI with 'application assets not found' (the regression
fixed in 467fd00, which only removed the export).

Add an explicit 'unset JUPYTERLAB_DIR' at each of the three sites:
- top-level env block (line ~648)
- start_jupyter_once() env block (line ~1829)
- the third env block (line ~1925)

unset on an already-unset var is a no-op, so this is safe.

Files changed (1) hide show
  1. start.sh +5 -0
start.sh CHANGED
@@ -643,6 +643,9 @@ export JUPYTER_RUNTIME_DIR="${JUPYTER_RUNTIME_DIR:-$HC_WRITABLE_BASE/.local/shar
643
  # NOTE: JUPYTERLAB_DIR must stay unset β€” it is JupyterLab's prebuilt application
644
  # assets dir (shipped with the pip package), not a settings dir. Overriding it
645
  # (as d085e58 did) breaks the UI with "application assets not found".
 
 
 
646
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
647
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
648
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"
@@ -1823,6 +1826,7 @@ start_jupyter_once() {
1823
  export JUPYTER_DATA_DIR="${JUPYTER_DATA_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter}"
1824
  export JUPYTER_RUNTIME_DIR="${JUPYTER_RUNTIME_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/runtime}"
1825
  # JUPYTERLAB_DIR intentionally unset β€” see top-level env block.
 
1826
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
1827
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
1828
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"
@@ -1918,6 +1922,7 @@ export JUPYTER_CONFIG_DIR="${JUPYTER_CONFIG_DIR:-$HC_WRITABLE_BASE/.jupyter}"
1918
  export JUPYTER_DATA_DIR="${JUPYTER_DATA_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter}"
1919
  export JUPYTER_RUNTIME_DIR="${JUPYTER_RUNTIME_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/runtime}"
1920
  # Do NOT override JUPYTERLAB_DIR β€” see top-level env block for the reason.
 
1921
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
1922
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
1923
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"
 
643
  # NOTE: JUPYTERLAB_DIR must stay unset β€” it is JupyterLab's prebuilt application
644
  # assets dir (shipped with the pip package), not a settings dir. Overriding it
645
  # (as d085e58 did) breaks the UI with "application assets not found".
646
+ # Explicitly unset so an inherited value (old bashrc, runtime injection) can't
647
+ # break asset loading.
648
+ unset JUPYTERLAB_DIR
649
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
650
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
651
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"
 
1826
  export JUPYTER_DATA_DIR="${JUPYTER_DATA_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter}"
1827
  export JUPYTER_RUNTIME_DIR="${JUPYTER_RUNTIME_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/runtime}"
1828
  # JUPYTERLAB_DIR intentionally unset β€” see top-level env block.
1829
+ unset JUPYTERLAB_DIR
1830
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
1831
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
1832
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"
 
1922
  export JUPYTER_DATA_DIR="${JUPYTER_DATA_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter}"
1923
  export JUPYTER_RUNTIME_DIR="${JUPYTER_RUNTIME_DIR:-$HC_WRITABLE_BASE/.local/share/jupyter/runtime}"
1924
  # Do NOT override JUPYTERLAB_DIR β€” see top-level env block for the reason.
1925
+ unset JUPYTERLAB_DIR
1926
  export JUPYTERLAB_SETTINGS_DIR="${JUPYTERLAB_SETTINGS_DIR:-$JUPYTER_CONFIG_DIR/lab/user-settings}"
1927
  export JUPYTERLAB_WORKSPACES_DIR="${JUPYTERLAB_WORKSPACES_DIR:-$JUPYTER_CONFIG_DIR/lab/workspaces}"
1928
  export JUPYTER_PREFER_ENV_PATH="${JUPYTER_PREFER_ENV_PATH:-0}"