prefix_paths double-slashes absolute env-var paths
Summary
Environment variables in dependency path: fields do not work when the
variable expands to an absolute path. Bender prepends the consuming
Bender.yml's parent directory to the template string (e.g. ${ABS})
before substituting the env var, so the substitution happens inside an
already-prefixed path and produces a malformed result like
<parent>//<absolute-expansion>.
The prefix step should be skipped (or applied after expansion) when the
expansion produces an absolute path. As is, env vars in path: are
effectively unusable for absolute paths — direct absolute literals and
relative env vars both work, only absolute env-var expansions break.
Bender version
0.31.0 and master (0a98f9e).
Setup
/tmp/x/
├── a/Bender.yml
└── b/Bender.yml
a/Bender.yml:
b/Bender.yml:
package: { name: b }
dependencies:
a: { path: "${ABS}" }
Repro
cd /tmp/x/b && ABS=/tmp/x/a bender update
Expected
a resolves to /tmp/x/a.
Actual
error[E32]: Path /tmp/x/b//tmp/x/a for dependency a does not exist.
Note the // between b/ and /tmp/x/a — bender concatenated the parent dir
onto the template, then expanded ${ABS} inside the combined string.
prefix_pathsdouble-slashes absolute env-var pathsSummary
Environment variables in dependency
path:fields do not work when thevariable expands to an absolute path. Bender prepends the consuming
Bender.yml's parent directory to the template string (e.g.${ABS})before substituting the env var, so the substitution happens inside an
already-prefixed path and produces a malformed result like
<parent>//<absolute-expansion>.The prefix step should be skipped (or applied after expansion) when the
expansion produces an absolute path. As is, env vars in
path:areeffectively unusable for absolute paths — direct absolute literals and
relative env vars both work, only absolute env-var expansions break.
Bender version
0.31.0andmaster(0a98f9e).Setup
a/Bender.yml:b/Bender.yml:Repro
Expected
aresolves to/tmp/x/a.Actual
Note the
//betweenb/and/tmp/x/a— bender concatenated the parent dironto the template, then expanded
${ABS}inside the combined string.