Skip to content

Conversation

@upils
Copy link
Contributor

@upils upils commented Mar 20, 2025

  • Have you signed the CLA?
  • Have you added an entry to the changelog (docs/reference/changelog.rst)?

@upils upils requested review from cmatsuoka and medubelko March 20, 2025 10:01
@upils
Copy link
Contributor Author

upils commented Mar 20, 2025

@medubelko I am not entirely sure this is the right page to document the additional env vars. They are at the crossroad of both overlay and partitions features so I also thought of creating a dedicated page.

Copy link
Contributor

@medubelko medubelko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot of repeated content with a similar scope here, so I think it would be better if we could combine the two sections together.

Otherwise, this seems like the right place to me. I'd appreciate other opinions, though, before we make further changes. @tigarmo?

@upils
Copy link
Contributor Author

upils commented Mar 21, 2025

There's a lot of repeated content with a similar scope here, so I think it would be better if we could combine the two sections together.

Otherwise, this seems like the right place to me. I'd appreciate other opinions, though, before we make further changes. @tigarmo?

Sadly yes. We need to strike the right balance between avoiding repetition and making it clear that: the variable naming convention is slightly different, the conditions to have them set are different and the directory they reference changes based on the part handled.

@upils upils requested review from tigarmo and removed request for cmatsuoka March 24, 2025 08:48
@tigarmo
Copy link
Contributor

tigarmo commented Mar 25, 2025

I think the location is fine

Partition/Overlay-specific output directory environment variables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If overlay is enabled too, additional environment variables will be created for use during step processing and execution of user-defined scriptlets.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit awkward to read, as a user. Whether partitions and/or overlays are enabled is a choice of the application, so it would be weird to read this sentence in Rockcraft's docs (because overlays are always enabled). I don't have a good suggestion on how to address this without revamping the whole thing, though. This is the kind of thing that I think we could solve with the "capability-based" approach I mentioned recently

(I understand that the problem is pre-existing)


If overlay is enabled too, additional environment variables will be created for use during step processing and execution of user-defined scriptlets.

These variable names will contain the (optional) namespace, partition name, and lifecycle step, formatted as ``CRAFT_[<namespace>_]<partition>_OVERLAY``. The values of these variables will be the directory that corresponds to that partition, step **and** part. For instance, if the defined partitions are ``default``, ``kernel``, and ``component/bar-baz``, and the provided configuration define two parts ``my-part`` and ``another-part``, the following environment variables will be created:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
These variable names will contain the (optional) namespace, partition name, and lifecycle step, formatted as ``CRAFT_[<namespace>_]<partition>_OVERLAY``. The values of these variables will be the directory that corresponds to that partition, step **and** part. For instance, if the defined partitions are ``default``, ``kernel``, and ``component/bar-baz``, and the provided configuration define two parts ``my-part`` and ``another-part``, the following environment variables will be created:
These variable names will contain the (optional) namespace, partition name, and lifecycle step, formatted as ``CRAFT_[<namespace>_]<partition>_OVERLAY``. The values of these variables will be the directory that corresponds to that partition, step **and** part. For instance, if the defined partitions are ``default``, ``kernel``, and ``component/bar-baz``, and the provided configuration defines two parts ``my-part`` and ``another-part``, the following environment variables will be created:

(this is a really long line)

Copy link
Contributor

@medubelko medubelko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. @upils If you have the chance to improve it further beyond @tigarmo's suggestions, that would be fantastic. But if not, I think it's a good addition nonetheless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants