siemens / kas

Setup tool for bitbake based projects
MIT License
353 stars 144 forks source link

Introduce KAS_BUILD_DIR environment variable #46

Closed phatina closed 3 years ago

phatina commented 3 years ago

This variable can override default build path ${KAS_WORK_DIR}/build.

More complex build systems may require rather large build directory to be put elsewhere. Or just to have different sort of order with metadata and build artifacts.

E.g. our CI/CD in GitLab has rather limitied space where the runner clones and starts pipelines. We put Yocto build directory to a different path, where we have the space.

Please review potential fix for already closed #40.

jan-kiszka commented 3 years ago

Thanks for the patch, looks good on first sight, just please post to the mailing list according to https://github.com/siemens/kas/blob/master/CONTRIBUTING.md. And don't forget your signed-off.

phatina commented 3 years ago

Thanks for the review. Fixed.

jan-kiszka commented 3 years ago

Please push updates to the list (and primarily there).

phatina commented 3 years ago

Aha, so every updated patchset shall be send via git send-email there?

jan-kiszka commented 3 years ago

Yes, classic email-based patch workflow. Make sure to tag them accordingly ([PATCH v2] ...)

phatina commented 3 years ago

Applied to next. Closing.

vivien commented 3 years ago

Is it documented somewhere? And is this configurable from the .yml file? I'd like to experience having a separate build/foo TOPDIR for each kas-foo.yml files, to facilitate the build of multiple distro/machine combinations without build clashes.

jan-kiszka commented 3 years ago

https://kas.readthedocs.io/en/latest/command-line.html#environment-variables (seems we need to tune the layout a bit)

This is build-local setting, so there is no corresponding key in the yaml file.

vivien commented 3 years ago

I'm not sure to understand the build-local setting. Isn't this directory specified when running the (e.g.) OE env init script? Since kas wraps the call to the various init scripts, isn't this variable a good candidate to be configurable from the .yml file?

jan-kiszka commented 3 years ago

The place where kas puts the build outputs is specific to the local builder (or site, as OE would likely call it). It's nothing that changes the build output when set differently on a different machine. It's nothing that influences the reproducibility of the output. Therefore, KAS_BUILD_DIR is also nothing to share with other via the kas configuration files.

vivien commented 3 years ago

I would've disagreed since building multiple distros at once would likely require distinct build directories. Hence sharing this configuration (with a CI for example) is a valid scenario. But on the other hand, I think this scenario can be handled with multiconfig if I'm not mistaken.

jan-kiszka commented 3 years ago

Yes, we use multiconfig with kas as well.

If you see a use case not covered by this change, please open a new issue or start a new thread on the mailing list. Looks like we are overloading this one here a bit.