-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Bazel support for windows #472
Comments
I don't have plans to work on this, and I don't have much Windows dev experience. If someone wants to take it on, let me know and I'll happily provide guidance on the Bazel side of things. The first step to resolving the The PR that fixes the Windows build should also enable Windows CI by adding to
|
Hi, for Windows support I think you need to do the following:
Unfortunately I don't have an elegant solution for |
Do we need gen_sh on Windows? I had hoped the pregenerated headers in https://github.com/google/glog/tree/master/src/windows/glog would work. Using bash in Windows builds is not ideal as Bazel is trying to drop the dependency on bash/msys.
If I understand correctly,
One pattern I've seen for platform-dependent builds is to use variables to collect the common and platform-specific sources, eg https://github.com/nelhage/rules_boost/blob/13a7a40214bf62b6c5e44aa376db18c6315e67b2/BUILD.boost#L929 This avoids having lots of hard-to-read nesting since the cc_library rules, but you still need to select(). Hope this helps, thanks for looking in to the issue! |
I was also looking into it, and I have something working both on linux and windows. But I faced an unexpected issue related to : bazelbuild/bazel#6337 IIUC, on linux we use the strip_include_prefix so external projects can include headers using glog/ prefix. I'll add a link to my current implementation soon. |
FWIW, I don't think there's a big advantage of (one difference: |
I feel like it's possible, but when I try that I'm struggling to figure out how to resolve these errors that pop up:
Wow, did not know. I guess this means I'll have to port my build scripts to something else too. (Python?) Do you know why they haven't been able to drop the dependency so far?
Yes this works, thank you so much!
Oh, but what I meant is that if you try this for the |
Hmm, sometimes
You can always use it yourself if you want, but for a simple dependency like glog it would be nice to allow those who haven't installed msys to build it. There's a little bit of background here: https://blog.bazel.build/2017/10/16/windows-retrospect.html
I'd expect the following to work, does it not? Alternatively we could stop inlining the script and have
|
@drigz Sorry for the lack of a response by the way, I'd left the notification email unread in my inbox this whole time to get back to you with an example when I could get one ready... I just haven't managed to yet. Great to see progress was made regardless though. Thank you both! |
@mehrdadn No problem! I've merged the PR now, maybe you could give it a try and see if it works for you. |
@drigz Okay so I'm trying to build glog now (commit 925858d), and I'm getting errors about
|
@drigz: Actually, let me double check things. Something funny is going on because I thought I still had a patch that worked (from my earlier proposed change), but it seems to be giving the exact same error. Not sure what's going on yet, but it's possible the problem isn't here. |
@drigz Update: sorry, it seems I had something wrong on my end. I haven't fully tested everything through, but at least it seems in fact both of them are compiling fine! I haven't I'll let you know if anything comes up. :) Thanks a lot for your help! |
* Updated glog to version 0.5.0 to account for google/glog#472. * Updated .bazelrc to specify C++17 correctly for Windows. * Added documentation.
Using google/glog from a bazel project on windows doesn't work.
bazel/glog.bzl doesn't seem to be windows compatible (but does on linux and darwing). Is there a plan to add support for it ?
here is the error I get :
The text was updated successfully, but these errors were encountered: