Skip to content

RFC: Tool Introspection #2

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

grafikrobot
Copy link
Member

@grafikrobot grafikrobot commented Mar 18, 2025

This presents a way for tools to both describe what they can do, and for tools to adhere to what users ask them to do. And do it in a way that is future proof.

preview

wording

grafikrobot added a commit to grafikrobot/ecostd.standard that referenced this pull request Mar 22, 2025
Initial, ported from wg21 source, wording for ecostd/rfcs#2
Copy link

@bruxisma bruxisma left a comment

Choose a reason for hiding this comment

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

Overall a good amount of info, but there are serious issues with:

  1. the use of asciidoc over more well known formats such as markdown for the actual proposal
  2. We should lean more heavily on prior art from other languages, as the future of C++ tooling is tied entirely to "having tools and languages talk to each other regardless of why they want to"

Comment on lines +136 to +137
`.stdinfo` text. For example: `cl.exe` => `cl.stdinfo`, or
`pass:[g++]` => `pass:[g++].stdinfo`.

Choose a reason for hiding this comment

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

I'm very much of the opinion that we should keep .exe in the name on Windows. It is possible to treat multiple file extensions as executables via COMSPEC and the windows registry (this is why .pyw files can be double clicked and run like any executable). Keeping the file extension for everything but .exe comes off as requiring an extra step for this one specific behavior.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is the suggestion to uniformly just add .stdinfo to the tool name? I.e. The following?

  • tool.exe ==> tool.exe.stdinfo
  • tool.sh ==> tool.sh.stdinfo
  • tool.bat ==> tool.bat.stdinfo

I like the idea as it's just simpler to explain. And likely easier to implement for everyone. And that's regardless of the exec thing.

Choose a reason for hiding this comment

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

Yes that's what I'm suggesting.

Comment on lines +139 to +142
2. The introspection file can be found: in the same filesystem location
as the tool executable (or script, or equivalent), in an implementation defined
location relative to the tool location, or in an implementation defined global
location (i.e. an absolute path location).

Choose a reason for hiding this comment

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

This should have a sublist so it is obvious which is used.

Suggested change
2. The introspection file can be found: in the same filesystem location
as the tool executable (or script, or equivalent), in an implementation defined
location relative to the tool location, or in an implementation defined global
location (i.e. an absolute path location).
2. The introspection file can be found:
.. in the same filesystem location as the tool executable (or script, or equivalent)
.. in an implementation defined location relative to the tool location
.. in an implementation defined global location (i.e. an absolute path location)

Furthermore not having a central location as defined by at least an environment variable separate from the implementation is not going to turn out well. Developers will always want to override or provide information on a tool themselves and having a central location like e.g., pkg-config is worthwhile.

interface. This can include any single interface, like a single target tool
option. Or it can include a collective interface of the target tool that covers
many options. A capability is specified as a series of "scoped" identifiers
separated by underscore ("_"). The capability must match this regular expression:

Choose a reason for hiding this comment

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

There is plenty of reasoning in this section for the rest of the regex, however there is nothing to explain why _ is preferred over - or : or even an ascii C0 control code.

^[0-9]+([.][0-9]+){0,2}$
----

==== Version Range

Choose a reason for hiding this comment

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

We should adopt pre-existing syntax and specifications from other languages for version constraints12. We don't need to invent a new one.

Footnotes

  1. https://python-poetry.org/docs/dependency-specification

  2. https://github.com/npm/node-semver

applications that want custom capabilities to create alternate names has
various drawbacks, yes, we should accept numbers in the names.

=== Version Specification

Choose a reason for hiding this comment

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

The version specification does not take so-called "epochs" into account. These are specified in tools such as RPM and apt-get, and in packaging specifications such as PEP440.

include::example-07.json[]
----

=== Version Matching

Choose a reason for hiding this comment

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

The RPM, PEP440, and Debian folks have all done work in this space. We should look at and reference their pre-existing work.

If the concern here is "how do we handle ranges and compatibility?" that is not our job, and there are solutions for it such as pubgrub, which has been adopted by Dart.

Using "core" is clear, short, and avoids using an abbreviation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants