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

Programmatic identification of conftest nodes #3626

Closed
acmorrow opened this issue Apr 23, 2020 · 0 comments · Fixed by #3755
Closed

Programmatic identification of conftest nodes #3626

acmorrow opened this issue Apr 23, 2020 · 0 comments · Fixed by #3755

Comments

@acmorrow
Copy link
Contributor

acmorrow commented Apr 23, 2020

Describe the Feature
Programmatic identification of conftest nodes.

Much like the issue reported in #3625, several of our tools work by interposing on emitters or scanners of existing builders. In some cases, the work we want to perform is inappropriate for conftests, either because of the special environment in which they execute, or because the injected behavior is inappropriate for conftests.

For now, we need to do something ugly like

if not "conftest" in str(target[0):
    # Do stuff to non-conftest nodes

which is unpleasant and far from foolproof. We think it would be better if there were an attribute or method on Node that would allow us to identify conftest-related nodes directly. Ideally, we could write something better, like:

if not target[0].is_conftest():
    # Do stuff to non-conftest nodes

Alternatively:

if not getattr(target[0].attributes, "is_scons_conftest", False):
    # Do stuff to non-conftest nodes

Would it be possible to adorn all nodes used by the SConf subsystem this way? It would make it much easier to handle such nodes differently when required, without needing to worry that someone is going to introduce a file called "conftest.cpp" next year when they want to write a test for some configuration, not knowing that that name has special meaning to SCons and our tools.

Required information
https://pairlist4.pair.net/pipermail/scons-users/2020-April/008072.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant