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

Swift: add possibility to run the extractor under an env-specified tool #11029

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

Conversation

redsun82
Copy link
Contributor

@redsun82 redsun82 commented Oct 28, 2022

if CODEQL_EXTRACTOR_SWIFT_RUN_UNDER env variable is set, and either

  • CODEQL_EXTRACTOR_SWIFT_RUN_UNDER_FILTER is not set, or
  • it is set to a regexp matching any substring of the extractor call then the extractor process is substituted with the command (and possibly options) stated in CODEQL_EXTRACTOR_SWIFT_RUN_UNDER, followed by the system arguments of the extractor itself (which should include the extractor program itself at the start).

Before calling exec, CODEQL_EXTRACTOR_SWIFT_RUN_UNDER is unset to avoid unpleasant loops.

An example usage is to run the extractor under gdbserver :1234 when the arguments match a given source file.

@github-actions github-actions bot added the Swift label Oct 28, 2022
if `CODEQL_EXTRACTOR_SWIFT_RUN_UNDER` env variable is set, and either
* `CODEQL_EXTRACTOR_SWIFT_RUN_UNDER_FILTER` is not set, or
* it is set to a regexp matching any substring of the extractor call
then the extractor process is substituted with the command (and possibly
options) stated in `CODEQL_EXTRACTOR_SWIFT_RUN_UNDER`, followed by the
system arguments of the extractor itself (which should include the
extractor program itself at the start).

Before calling `exec`, `CODEQL_EXTRACTOR_SWIFT_RUN_UNDER` is unset to
avoid unpleasant loops.

An example usage is to run the extractor under `gdbserver :1234` when
the arguments match a given source file.
@redsun82 redsun82 force-pushed the redsun82/swift-filtered-debugging branch from d091812 to 3dcdc73 Compare Oct 28, 2022
@redsun82 redsun82 marked this pull request as ready for review Oct 28, 2022
@redsun82 redsun82 requested a review from a team as a code owner Oct 28, 2022
Copy link
Contributor

@d10c d10c left a comment

LGTM, with minor suggestions.

swift/extractor/main.cpp Outdated Show resolved Hide resolved
@redsun82 redsun82 requested a review from a team Oct 31, 2022
d10c
d10c approved these changes Oct 31, 2022
Copy link
Contributor

@d10c d10c left a comment

Some tests would be welcome, but the code looks good.

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

Successfully merging this pull request may close these issues.

None yet

2 participants