Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

Conversation

@sergiud
Copy link
Contributor

@sergiud sergiud commented Mar 30, 2021

Eliminate Windows specific headers:

  • Avoids duplication headers which should be platform agnostic
  • Reduces maintenance burden by requiring changes in a single file only

@sergiud sergiud added this to the 0.5 milestone Mar 30, 2021
@sergiud sergiud self-assigned this Mar 30, 2021
@google-cla google-cla bot added the cla: yes label Mar 30, 2021
@sergiud
Copy link
Contributor Author

sergiud commented Mar 30, 2021

@drigz I would like to remove Windows specific header files which Bazel requires. Is there a way to avoid this?

@drigz
Copy link
Member

drigz commented Mar 31, 2021

Let me take a look at whether I can expand the header templates without introducing a new dependency to the Windows+Bazel build. Since the reference to hash/hash_compare in preprocess.sh appears to be a red herring, I think we can get away with fixed-string-replacements, so this could be possible.

@sergiud sergiud force-pushed the remove-windows-headers branch 2 times, most recently from 071ffd2 to 8a9c26a Compare March 31, 2021 14:14
@sergiud
Copy link
Contributor Author

sergiud commented Mar 31, 2021

@drigz For some reason, AppVeyor builds do not show up under merge checks anymore. Do you happen to know what is the problem?

@drigz
Copy link
Member

drigz commented Mar 31, 2021

I'm afraid I'm not familiar with AppVeyor.

@sergiud
Copy link
Contributor Author

sergiud commented Mar 31, 2021

I believe this is a permission problem in the Github project configuration which I don't have access to. Could you check? (I assume you can see the settings since you're a group member).

@sergiud sergiud force-pushed the remove-windows-headers branch 4 times, most recently from 19baf32 to ae82726 Compare April 1, 2021 11:22
@sergiud
Copy link
Contributor Author

sergiud commented Apr 1, 2021

@drigz I would like to drop windows/config.h as well. Is there a way to reuse the config.h generated by Bazel?

@drigz
Copy link
Member

drigz commented Apr 6, 2021

I believe this is a permission problem in the Github project configuration which I don't have access to. Could you check? (I assume you can see the settings since you're a group member).

I can see the Settings but I can't see anything problematic: AppVeyor is listed under https://github.com/google/glog/settings/installations, and https://www.appveyor.com/blog/2018/10/02/github-apps-integration/ suggests nothing else is required. Do you have access to the AppVeyor account/UI? Maybe that would have more info.

I would like to drop windows/config.h as well. Is there a way to reuse the config.h generated by Bazel?

Why do you want to remove it? It should be possible but I expect it would be more complicated than just leaving the file there.

@sergiud
Copy link
Contributor Author

sergiud commented Apr 6, 2021

@drigz Thanks for checking. Unfortunately, I don't have access to the AppVeyor account. I believe only google members have. I tried contacting @ukai already. However, without a response so far.

Regarding src/windows/config.h: it duplicates the one generated from src/config.h.cmake.in. Since Bazel already uses the latter as a template to generate a config.h, I don't see any reason for keeping a Windows specific configuration header anymore. With my limited Bazel knowledge, however, I could not find a way to reuse the generated header for Windows Bazel builds. I believe the required changes are actually trivial.

In the long term, I'd like to remove Windows specific workarounds anyway particularly once we switch to C++17. Keeping the above header is therefore not an option.

I've added a rationale for the PR in my initial comment.

@drigz
Copy link
Member

drigz commented Apr 6, 2021

Unfortunately, I don't have access to the AppVeyor account.

I tried logging into AppVeyor with my GitHub SSO - I couldn't see any existing projects, though - maybe something got deleted. I found googleapis/google-cloud-python#6253 which could be related. Do you know what AppVeyor is needed/used for?

In the long term, I'd like to remove Windows specific workarounds anyway particularly once we switch to C++17. Keeping the above header is therefore not an option.

The non-trivial element is that windows/config.h sets GOOGLE_GLOG_DLL_DECL - do you have any plans to change how the DLL macros are set/interpreted? Or should I look for a way to set that in the Bazel windows build that matches the current windows/config.h?

@sergiud
Copy link
Contributor Author

sergiud commented Apr 6, 2021

Actually, CMake already generates an export.h which selects the definitions for *_DLL_DECL based on the used toolchain. Which is also a reason why I would like to avoid yet another config.h which currently overrides CMake definitions.

For Bazel, this does need to be this complicated. You can use something along the lines of

"@bazel_tools//src/conditions:windows": ["GOOGLE_GLOG_DLL_DECL=__declspec(dllexport)"],

I do not intend to change how these macros are interpreted.

As for AppVeyor, we use it for Windows CI builds. Travis builds only for Linux. It seems, @google-admin manages the glog AppVeyor account.

@sergiud sergiud force-pushed the remove-windows-headers branch from ae82726 to 7d60d6e Compare April 6, 2021 17:59
@sergiud sergiud changed the base branch from master to win-headers April 6, 2021 18:00
@sergiud sergiud marked this pull request as draft April 6, 2021 18:02
@sergiud sergiud changed the base branch from win-headers to master April 6, 2021 18:16
@sergiud sergiud marked this pull request as ready for review April 6, 2021 18:16
@sergiud sergiud merged commit e51790b into google:master Apr 6, 2021
@sergiud sergiud mentioned this pull request May 6, 2021
@sergiud sergiud deleted the remove-windows-headers branch February 12, 2022 13:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants