Skip to content
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

CPS_PATH environment variable behaves differently than PKG_CONFIG_PATH environment variable #45

Closed
dcbaker opened this issue Mar 5, 2024 · 4 comments · Fixed by #48
Closed
Labels
bug The issue represents a problem with the specification in its current form. scheduled The maintainers have flagged this issue as something to be addressed.
Milestone

Comments

@dcbaker
Copy link
Collaborator

dcbaker commented Mar 5, 2024

Concern

$PKG_CONFIG_PATH provides an array of paths to search for .pc files, while $CPS_PATH provides an array of prefixes, with the libdir and datadir rules applied. This is likely to cause confusion for users of pkg-config switching to cps-config or s similar tool.

For example, a current pkg-config command line might look like:

PKG_CONFIG_PATH=$HOME/installs/lib/pkg-config pkg-config zlib --cflags

While the equivalent cps-config command would be:

CPS_PATH=$HOME/installs cps-config zlib --cflags

Proposal

$CPS_PATH should match the semantics of $PKG_CONFIG_PATH, as it is the obvious analogue. A new $CPS_PREFIX_PATH variable should be added in addition, which has the currently speced behavior for $CPS_PATH

Concretely, this means that $CPS_PATH would not apply any libdir or datadir, it would be considered a full prefix and each path would be searched for <name-like>s. A cps-config command of:

CPS_PATH=$HOME/custom-cps cps-config zlib --cflags

Would search:

$HOME/custom-cps/zlib.cps
$HOME/custom-cps/zlib/zlib.cps
$HOME/custom-cps/zlib/*/zlib.cps
/usr/lib/cps/zlib.cps
/usr/lib/cps/zlib/zlib.cps
...

$CPS_PREFIX_PATH would prepend new prefixes to be searched:

sh CPS_PREFIX_PATH="/opt" cps-config zlib --clfags

would search:

/opt/lib/cps/zlib.cps
/opt/lib/cps/zlib/zlib.cps
/opt/lib/cps/zlib/*/zlib.cps
/opt/<share>/cps/...
/usr/lib/cps/zlib.cps
...

Reasoning

Having a CPS_PATH that is analogous to PKG_CONFIG_PATH and sets absolute search directories is useful for non-FHS setups, hand written cps files loaded on the side, and is familiar to pkg-config users. I chose CPS_PREFIX_PATH based on CMake's CMAKE_PREFIX_PATH option, which has the same behavior and is likely to feel familiar to CMake users, and may provide CMake the ability to trivially add prefixes to cps and it's traditional package mechanism

dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 5, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 5, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 6, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 6, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 6, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
@mwoehlke
Copy link
Member

mwoehlke commented Mar 6, 2024

Aside: #44 probably should have bumped the specification version. I'm not going to lose too much sleep given that we're still beating on that area (i.e. this issue, for one), but we should make sure the next change does include a version bump.

@dcbaker
Copy link
Collaborator Author

dcbaker commented Mar 6, 2024

Okay, I wasn't sure if you wanted to gather up sets of changes and periodically make version bumps, or have a version bump with every change, or every behavior change.

@mwoehlke
Copy link
Member

mwoehlke commented Mar 6, 2024

My hope is that, in the long run, changes will be infrequent enough that every change warrants a version change rather than having to adopt a formal release process. Hopefully most of those will be point revisions. For now, breaking changes warrant only minor revision bumps, and the bar for what can be "squeezed into" a point revision is lower.

That said, I'm not opposed to grouping changes if we know we need to change a bunch of things, and certainly anything that gets grouped together in a single branch/PR does not need to change the version every commit.

I'm probably going to add some wording to this effect to the new contribution recommendations. Just to be clear, things like fixing typos, or changes (e.g. the aforementioned contribution recommendations) that don't affect the specification itself (including e.g. cosmetic changes to the specification HTML) don't need version bumps.

And, yes, I expect there's a good chance we'll get to (and pass) 0.100.0. 🙂

@bretbrownjr
Copy link
Collaborator

Adding a PR template to note the need for version bump is cheap.

Adding CI to bump the version or at least reject PRs missing version bumps is affordable too, though we should get the existing CI pull request landed first.

mwoehlke added a commit that referenced this issue Mar 7, 2024
Use CPS_PREFIX_PATH instead of CPS_PATH to specify additional prefixes.
This functionality is similar to CMake's CMAKE_PREFIX_PATH and may be
useful for cross-compiles or other somewhat more exotic build
environments wherein an additional FHS-like file tree is present and
should be used for builds.

"Add" a much more restricted CPS_PATH that is more similar to
PKG_CONFIG_PATH.

Also, remove a redundant sentence from the search order prose; the
ordering it imposes is already specified by the ordering of the search
paths list.

See also #45.
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 8, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 10, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
@mwoehlke mwoehlke added scheduled The maintainers have flagged this issue as something to be addressed. bug The issue represents a problem with the specification in its current form. labels Mar 13, 2024
@mwoehlke mwoehlke added this to the 1.0 milestone Mar 13, 2024
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 13, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 14, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 14, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 15, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 15, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 15, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 15, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
dcbaker added a commit to dcbaker/cps-config that referenced this issue Mar 19, 2024
This means it does not work like pkg-config's `PKG_CONFIG_PATH`, but
like CMake's `-DCMAKE_PREFIX_PATH`.

See CPS issue: cps-org/cps#45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue represents a problem with the specification in its current form. scheduled The maintainers have flagged this issue as something to be addressed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants