Skip to content

Commit 4efc123

Browse files
committed
Add dyld_{requires,libraries}
Add attributes to allow specifying requirements that are only needed to satisfy the dynamic library loader (or the linker, when operating in certain strict modes). Because these are only needed by the build in limited cases (and arguably are only "needed" to work around broken environments), this is not being treated as a breaking schema change. Fixes: #106
1 parent 7255e42 commit 4efc123

2 files changed

Lines changed: 41 additions & 1 deletion

File tree

conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
project = 'Common Package Specification'
1414
copyright = '2025, Matthew Woehlke'
1515

16-
version_info = (0, 14, 0)
16+
version_info = (0, 14, 1)
1717
release = '.'.join(map(str, version_info))
1818
version = '.'.join(map(str, version_info[:2]))
1919

schema.rst

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,46 @@ Attribute names are case sensitive.
307307
the latter, when applicable to the source being compiled,
308308
shall have precedence.
309309

310+
.. ----------------------------------------------------------------------------
311+
.. cps:attribute:: dyld_libraries
312+
:type: list(string)
313+
:context: component configuration
314+
315+
Specifies a list of additional libraries
316+
that are required in the manner of `dyld_requires`_.
317+
(Note that packages should avoid using this attribute if at all possible.
318+
Use `dyld_requires`_ instead whenever possible.)
319+
320+
.. ----------------------------------------------------------------------------
321+
.. cps:attribute:: dyld_requires
322+
:type: list(string)
323+
:context: component configuration
324+
325+
Specifies additional components required by a component
326+
which are needed only by the dynamic library loader.
327+
Unlike `requires (component)`_ or `link_requires`_,
328+
these are not used to resolve symbol references of the consumer,
329+
but represent "private" requirements of the component
330+
on which this attribute appears.
331+
332+
Typically, such requirements represent a need
333+
to ensure that the required component can be found at run time.
334+
This is usually accomplished in one of three ways:
335+
336+
- Ensuring that the component resides in a default / "system" search path.
337+
338+
- Providing the component path in an environment variable
339+
which influences the dynamic library loader's search paths.
340+
341+
- Encoding the component path in the binary
342+
in a way that influences the dynamic library loader
343+
(e.g. "RPATH").
344+
345+
Whether these requirements are needed at build time
346+
depends on which of the above strategies is employed,
347+
and whether the linker requires that all library references
348+
can be fully resolved at link time.
349+
310350
.. ----------------------------------------------------------------------------
311351
.. cps:attribute:: hints
312352
:type: list(string)

0 commit comments

Comments
 (0)