Hey Abderrahim,

On 20/12/2024 20:36, Abderrahim Kitouni wrote:
To be able to do this, BuildStream needs to be able to set an
environment variable in the element sandbox corresponding to the
digest of an element's artifact designated as "the toolchain". We need
to be able to choose the name of the environment variable: in the case
of RECC, this would be RECC_REMOTE_PLATFORM_chrootRootDigest. The
usual way we would do this is to have this value in a buildstream
variable (like the current element-name or max-jobs) and let the user
use it to set the appropriate environment variable. However, this
can't be done in this case as the CAS digest of the toolchain can only
be resolved at staging time.

For the actual implementation, I think we can have a new dependency
configuration for setting this. BuildElement would implement it, and
it can be used by all the build elements. There are some issues to
consider for the implementation, but nothing too hard. For instance,
currently the only way to get the virtual Directory of an Element's
artifact is to stage it (which requires a sandbox). Another one is
that setting the environment variables happens at configure_sandbox()
time, which is currently before staging.

I got confused on reading this, maybe you can help me understand...

As an author of BuildStream elements, do I need to manually label these "build elements" to say they're part of the "toolchain"? If so, how do I know what is the "toolchain" and what is not?

Is it something that is the same for an entire build, or is it something that changes per element?

Is the "toolchain" in a build process just the set of build dependencies for a given element?

Personally when I think of the word "toolchain" I think of compilers, like GCC and Rustc and so on, which might be why I'm confused here.

Thanks!
Sam

--
Sam Thursfield (he/him), Codethink Ltd.

Reply via email to