Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stop leaking internal headers to other libraries.#729

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
NWilson merged 7 commits intoPCRE2Project:masterfromfeuerste:bazel_fix
Mar 17, 2025

Conversation

@feuerste
Copy link
Contributor

This is important for e.g. glib/gio, which also
has an internal config.h, and fails to compile, as it often picks up the pcre2 config.h first.

This is important for e.g. glib/gio, which alsohas an internal config.h, and fails to compile, asit often picks up the pcre2 config.h first.
@feuerste
Copy link
ContributorAuthor

@NWilson Can you please have a look? Thanks a lot!

@NWilson
Copy link
Member

Interesting. I see the issue. I don't know Bazel at all, but I can see that it's documented for theincludes to be exported as part of the library's public interface.

From a little bit of Googling, I'm concerned about:

  • Is the-I syntax truly universal? For example, on Windows/I<path> is the standard commandline syntax. Does Bazel magically cover over this difference by parsing the COPTS and translating them to a toolchain-appropriate format? I can't find any docs on a list of supported COPTS flags. So, I worry there are places where this won't work.
  • Another alternative I've seen online is to make an internal dummy cc_library with the config header, which the real library would depend on. That's a bit like thepcre2test_dotc_headers hack I added - something similar could work to encapsulate the include directory in a private way.

@feuerste
Copy link
ContributorAuthor

Thanks for looking into this!

  • Is the-I syntax truly universal? For example, on Windows/I<path> is the standard commandline syntax. Does Bazel magically cover over this difference by parsing the COPTS and translating them to a toolchain-appropriate format? I can't find any docs on a list of supported COPTS flags. So, I worry there are places where this won't work.

I've seen it in quite a few bazel projects and MSVC according tohttps://learn.microsoft.com/en-us/cpp/build/reference/compiler-option allows both/ and- to specify compiler options, but you are right, the other option below is a bit cleaner.

  • Another alternative I've seen online is to make an internal dummy cc_library with the config header, which the real library would depend on. That's a bit like thepcre2test_dotc_headers hack I added - something similar could work to encapsulate the include directory in a private way.

I changed it to use an impl library which is solely for internal use. Please take another look!

@NWilson
Copy link
Member

I have pushed a commit to your branch, which is my attempt to make the diff a bit smaller, by only pulling out the headers into their own internal dependency.

I am able to run thebazelisk build //... andbazelisk test //... commands locally.

I don't know enough about Bazel to confirm whether or not your original issue is fixed however (the public export of config.h to downstream clients).

@NWilson
Copy link
Member

Also@feuerste, if you're a Bazel user, do you know if it's OK now to remove the WORKSPACE.bazel file? I think this is some old compatibility thing for Bazel <6.3 (according to the docs), and those versions are now out of support I believe.

@feuerste
Copy link
ContributorAuthor

I have pushed a commit to your branch, which is my attempt to make the diff a bit smaller, by only pulling out the headers into their own internal dependency.

I am able to run thebazelisk build //... andbazelisk test //... commands locally.

I don't know enough about Bazel to confirm whether or not your original issue is fixed however (the public export of config.h to downstream clients).

I just tested it locally with all my dependencies, and it still works, so from my side we can merge it.

@feuerste
Copy link
ContributorAuthor

Also@feuerste, if you're a Bazel user, do you know if it's OK now to remove the WORKSPACE.bazel file? I think this is some old compatibility thing for Bazel <6.3 (according to the docs), and those versions are now out of support I believe.

I'm pretty sure we can remove that file, probably in a separate PR?
@mering, can you confirm?

@NWilson
Copy link
Member

I just tested it locally with all my dependencies, and it still works, so from my side we can merge it.

Thank you very much! I'll merge.

I'll open a separate PR for removing WORKSPACE.bazel.

@NWilsonNWilson merged commit3a4310e intoPCRE2Project:masterMar 17, 2025
35 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@NWilsonNWilsonNWilson approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@feuerste@NWilson

[8]ページ先頭

©2009-2025 Movatter.jp