spkenv / spk

A Package Manager for high velocity software environments, built on spfs.
https://spkenv.dev
Apache License 2.0
35 stars 5 forks source link

At make-source step, there are no SPK environment variables #25

Closed lgritz closed 3 years ago

lgritz commented 3 years ago

If you try to use

sources:
    - script
        - env
        - ...

to customize how the source area is copied to an spk layer, you quickly find (via that env) that there are no SPK_* or other environment variables set, no breadcrumbs that let you write interesting scripts that know what they are doing. In particular, I cannot figure out how one can detect what was the pwd when spk build was run, that is, the place where you are supposed to be copying from.

I think it would be good if at the "sources" stage, we had available all of the same SPK env variables that are present at the "build" stage. At the very least, the project name, the version, and the launch directory are a bare minimum. But the whole works would be better, including other build variables/options, versions of dependencies, etc.

lgritz commented 3 years ago

HELP WANTED on this one. I know that not all SPK env variables can be ready (some values change for each variant, obviously). But there is some minimum set -- the name and version of the package being built, the path to the original source area from which things should be copied, etc. -- that could be known and would be very helpful to writing sources script.