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

Glob search order should be "specified" #81

Open
mwoehlke opened this issue Oct 21, 2024 · 3 comments
Open

Glob search order should be "specified" #81

mwoehlke opened this issue Oct 21, 2024 · 3 comments
Labels
bug The issue represents a problem with the specification in its current form. need discussion Resolution of this issue should be discussed within the wider community before resolving.

Comments

@mwoehlke
Copy link
Member

Currently, Package Searching gives a list of paths and specifies the order in which each item should be searched. However, some items involve globs. We should document the order in which matching globs are searched, even if that order is "unspecified" or "implementation defined".

Note that CMake appears to use CMAKE_FIND_PACKAGE_SORT_ORDER and CMAKE_FIND_PACKAGE_SORT_DIRECTION to control this order; it would be helpful for CMake's implementation if whatever we specify is compatible with this.

@mwoehlke mwoehlke added bug The issue represents a problem with the specification in its current form. need discussion Resolution of this issue should be discussed within the wider community before resolving. labels Oct 21, 2024
@dcbaker
Copy link
Collaborator

dcbaker commented Oct 22, 2024

I'd prefer if we have some sort of definition here. I have real concerns about difficulties in projects with multiple build systems getting different results because (for example) CMake sorts one way, and Meson sorts another. If we leave it unspecified, it would appreciate something like "currently unspecified. This may change in a future revision of the CPS spec".

For reference, Meson would probably want to uses whatever Python's glob.glob() does.

@mwoehlke
Copy link
Member Author

Meson would probably want to uses whatever Python's glob.glob() does.

Right; there are going to be potential implementation headaches if we specify a particular sorting order. I'm more inclined to leave it unspecified, but we should specify that it's unspecified. 🙂 (Similarly, I'm in the process of implementing this for CMake, with the most convenient implementation being to do the same as for .cmake files. Which... is unspecified order by default, consistent with what Python's glob.glob(...) is documented to do, and in both cases almost certainly means "whatever the underlying FS does".)

Discussion is always welcome, but this Issue exists firstly as a reminder to "fix" the documentation. (Since this has a normative impact, even if actual practice isn't affected, I'm considering it a "bug", not just editorial.)

This may change in a future revision of the CPS spec

As far as I'm concerned, it's always permissible to specify something that was previously unspecified, since the specified behavior will always be a subset of what the unspecified behavior permitted.

@dcbaker
Copy link
Collaborator

dcbaker commented Oct 24, 2024

As far as I'm concerned, it's always permissible to specify something that was previously unspecified, since the specified behavior will always be a subset of what the unspecified behavior permitted.

Fair. My motivation is that language communicates to a reader "we know that leaving this unspecified could be problematic, but we're not going to specifying anything until we see it be a problem in practice"

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. need discussion Resolution of this issue should be discussed within the wider community before resolving.
Projects
None yet
Development

No branches or pull requests

2 participants