Make ${{ PREFIX }} and other "build-time" vars available in script section?
I am wondering if it would be useful to add some variables only in the script section.
Because it would make it less annoying to deal with Windows vs. Unix env vars.
E.g. this:
- if: unix
then:
- cargo install --locked --root $PREFIX --path . --no-track
else:
- cargo install --locked --root %PREFIX% --path . --no-track
Could be written as:
script: cargo install --locked --root ${{ PREFIX }} --path . --no-track
However, some variables introduce a "dependency" on the parsing (for example, PREFIX usually needs the package name to be available, because the directory looks something like /bld/<package-name>-<timestamp>/placeholder).
Actually, it might also be nice to have ${{ PYTHON }} availalbe (which depends on ${{ PREFIX }}.
Maybe we should render this part with another Jinja context ...
The reason why it's nice is that it works cross-platform regardless of the shell. Switching to deno_task_shell would also work, but not sure if that's a better solution.
Apologies, the issue I tagged above may be a new issue. This was the closest similar issue I could find.
No this is fine and is the correct issue indeed! :)
We also have a PR for it: https://github.com/prefix-dev/rattler-build/pull/894
Initial version of this is merged!