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

add support for ignore by regex #385

Merged
merged 4 commits into from
Sep 29, 2022
Merged

add support for ignore by regex #385

merged 4 commits into from
Sep 29, 2022

Conversation

t-bltg
Copy link
Contributor

@t-bltg t-bltg commented Sep 28, 2022

I'm trying to generate MPI signatures in JuliaParallel/MPI.jl#644.

It would be convenient to filter output by regex, since output_ignorelist requires listing everything by hand (and this would take more time than writing this PR).

E.g. this works in my generator.toml:

output_ignoreregex = ["^PMPI_", "^QMPI_"]

@Gnimuc
Copy link
Member

Gnimuc commented Sep 29, 2022

It would be great if we could add regex support to output_ignorelist instead of introducing a new config entry.

@Gnimuc
Copy link
Member

Gnimuc commented Sep 29, 2022

X-ref: #380

@t-bltg
Copy link
Contributor Author

t-bltg commented Sep 29, 2022

X-ref: #380

Thanks for poiting to #380.

It would be great if we could add regex support to output_ignorelist

The problem is that the .toml cannot parse regex string macros:

ERROR: TOML Parser error:
none:5:21 error: unexpected start of value
  output_ignorelist = [r"^PMPI_", r"^QMPI_", r"^MPIX_", r"^PMPIX_", r"^QMPIX_", r"^MPI_T_", r"^MPI_Session_"]
                      ^                                                                                       
Stacktrace:
 [1] parse
   @ ./toml_parser.jl:441 [inlined]

Thus, we cannot distinguish regexes from regular string in output_ignorelist, thus breaking the current behavior if we make all entries in output_ignorelist behave like regexes.

Please advise on the implementation ?

@Gnimuc
Copy link
Member

Gnimuc commented Sep 29, 2022

Is it feasible to treat everything as regex string?

@Gnimuc
Copy link
Member

Gnimuc commented Sep 29, 2022

I can not come up with an ambitious case.

@t-bltg
Copy link
Contributor Author

t-bltg commented Sep 29, 2022

Is it feasible to treat everything as regex string?

I guess I can try. Would that imply exclusivelist should become one too ?

EDIT: ignorelist now mapped to a regex, this works for our MPI PR.

src/generator/passes.jl Outdated Show resolved Hide resolved
@Gnimuc Gnimuc merged commit f004082 into JuliaInterop:master Sep 29, 2022
@Gnimuc
Copy link
Member

Gnimuc commented Sep 29, 2022

Thanks!

@t-bltg
Copy link
Contributor Author

t-bltg commented Sep 29, 2022

Amazing.

Would it be possible to tag a new version so that we can add a valid [compat] entry for Clang.jl in JuliaParallel/MPI.jl#644 ?

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 this pull request may close these issues.

2 participants