-
Notifications
You must be signed in to change notification settings - Fork 12
Add Runtime-Environment #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,12 @@ Typical components include libraries and executables. | |
| A |configuration| holds attributes | ||
| that are specific to a particular configuration of a |component|. | ||
|
|
||
| :object:`Environment-Variable`\ :hidden:`(Object)` | ||
| -------------------------------------------------- | ||
|
|
||
| An |envvar| holds attributes | ||
| that describe an environment variable alteration. | ||
|
|
||
| Attributes | ||
| '''''''''' | ||
|
|
||
|
|
@@ -43,6 +49,34 @@ Attribute names are case insensitive, | |
| although it is recommended that ``.cps`` files | ||
| use the capitalization as shown. | ||
|
|
||
| :attribute:`Action` | ||
| ------------------- | ||
|
|
||
| :Type: |string| (restricted) | ||
| :Applies To: |envvar| | ||
| :Required: No | ||
|
|
||
| This specifies how an environment variable's specified values | ||
| are combined with any existing values of the environment variable. | ||
| Note that "existing values" may also refer to values | ||
| specified for the same environment variable by other components. | ||
|
|
||
| - :string:`prepend` | ||
|
|
||
| The specified `Values`_ are inserted before | ||
| the environment variable's existing value(s), if any. | ||
| This is the default behavior. | ||
|
|
||
| - :string:`append` | ||
|
|
||
| The specified `Values`_ are inserted after | ||
| the environment variable's existing value(s), if any. | ||
|
|
||
| - :string:`replace` | ||
|
|
||
| The specified `Values`_ replace | ||
| the environment variable's existing value(s), if any. | ||
|
|
||
| :attribute:`C-Runtime-Vendor` | ||
| ----------------------------- | ||
|
|
||
|
|
@@ -264,6 +298,26 @@ even for Z > Y | |
| (with the understanding that, in such cases, the tool | ||
| may miss non-critical information that the CPS provided). | ||
|
|
||
| :attribute:`Deduplicate` | ||
| ------------------------ | ||
|
|
||
| :Type: |bool| :separator:`or` |string| (restricted) | ||
| :Applies To: |envvar| | ||
| :Required: No | ||
|
|
||
| Specifies whether duplicate values | ||
| in the environment variable should be removed. | ||
| (Values are separated by the specified `Separator`_.) | ||
|
|
||
| If enabled, deduplication takes place *after* | ||
| the environment variable has been modified. | ||
| If set to :string:`keep-last`, | ||
| only the right-most value is retained. | ||
| Otherwise (|true| or :string:`keep-first`) | ||
| only the left-most value is retained. | ||
|
|
||
| The default is |false|. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most tools I'm familiar with keep the last definition of something, not the first. Python's argparse works this way, bash and zsh do this with env (so do Python, Rust, and C/C++) vars ( |
||
|
|
||
| :attribute:`Default-Components` | ||
| ------------------------------- | ||
|
|
||
|
|
@@ -575,6 +629,36 @@ Values are a valid |requirement| object or |null| | |
| (equivalent to an empty |requirement| object) | ||
| describing the package required. | ||
|
|
||
| :attribute:`Runtime-Environment` | ||
| -------------------------------- | ||
|
|
||
| :Type: |map| to [ |string-list| :separator:`or` |envvar| ] | ||
| :Applies To: |component|, |configuration| | ||
| :Required: No | ||
|
|
||
| Specifies environment variables that should be set | ||
| when executing an application that uses the component. | ||
| Keys are the environment variable names. | ||
|
|
||
| If a value is a |string-list|, | ||
| the value is treated as the `Values`_ attribute | ||
| of an |envvar| object | ||
| whose other attributes are unspecified. | ||
|
|
||
| :attribute:`Separator` | ||
| ---------------------- | ||
|
|
||
| :Type: |string| | ||
| :Applies To: |envvar| | ||
| :Required: No | ||
|
|
||
| Specifies what character or sequence of characters | ||
| is used to join multiple values of an environment variable. | ||
|
|
||
| If not specified, the default | ||
| is :string:`;` on Windows | ||
| or :string:`:` otherwise. | ||
|
|
||
| :attribute:`Type` | ||
| ----------------- | ||
|
|
||
|
|
@@ -620,6 +704,22 @@ but does not otherwise map directly to a component | |
| may use a symbolic component | ||
| to indicate availability of the feature to users. | ||
|
|
||
| :attribute:`Values` | ||
| ------------------- | ||
|
|
||
| :Type: |string-list| | ||
| :Applies To: |envvar| | ||
| :Required: Yes | ||
|
|
||
| Specifies the list of values | ||
| to assign to the environment variable. | ||
| Values are assigned according to the specified `Action`_ | ||
| and are joined by the specified `Separator`_. | ||
|
|
||
| If a value starts with ``@prefix@``, | ||
| the package's install prefix is substituted | ||
| (see `Package Searching`_). | ||
|
|
||
| :attribute:`Version` :applies-to:`(Package)` | ||
| -------------------------------------------- | ||
|
|
||
|
|
@@ -732,6 +832,12 @@ Notes | |
|
|
||
| .. |null| replace:: :keyword:`null` | ||
|
|
||
| .. |bool| replace:: :type:`boolean` | ||
|
|
||
| .. |true| replace:: :keyword:`true` | ||
|
|
||
| .. |false| replace:: :keyword:`false` | ||
|
|
||
| .. |string| replace:: :type:`string` | ||
|
|
||
| .. |list| replace:: :type:`list` | ||
|
|
@@ -752,6 +858,8 @@ Notes | |
|
|
||
| .. |configuration| replace:: :object:`configuration` | ||
|
|
||
| .. |envvar| replace:: :object:`environment-variable` | ||
|
|
||
| .. ... .. ... .. ... .. ... .. ... .. ... .. ... .. ... .. ... .. ... .. ... .. | ||
|
|
||
| .. kate: hl reStructuredText | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at Meson's environment variable handling, this all looks pretty similar to what we do. I've been convinced that is a sane mechanism.
One thing that I'd like to see is the ability to completely unset an environment variable, since some tools treat an empty environment variable and an unset one differently. I see two ways that could be achieved,
replacecould be nullable, so thatreplace: nullmeans "clear this from the environment", or there could be a:bool:'clear'attribute.