-
Notifications
You must be signed in to change notification settings - Fork 1
feat: support openssl from bcr #5
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
base: bazelboost-1.83.0
Are you sure you want to change the base?
Conversation
…l query` for targets that rely on `boost.asio` due to the fact that OpenSSL is not in BCR yet.
Did you want any assistance? I get a new computer tomorrow! So I can finally work on Mac, Linux, and Windows. |
Yeah feel free! I'm not sure when I'll get around to finishing it, but I'll be keeping tabs if you do! |
Okay! I get the last part today so hopefully Ill have a setup by tomorrow. Do you know what the main blockers right now are? |
what I noticed immediately is boost asio uses some openssl headers that seem to not be available on the openssl bcr module. I wasn't sure if I just misconfigured openssl though. |
oh intriguing. because openssl is the super set of boringssl. Ill reach out to the maintainer and see what they say. |
Ok I reached out and he told me to post raccoons-build/bazel-openssl-cc#1 which is their very first issue! @zaucy can you re-run the linux and windows checks. |
turned off fail fast so they'll all run - also made you a maintainer so feel free to adjust this PR or run the gh action as much as you need |
Nice thank you! Looks like the windows error is on their side too: https://github.com/bazelboost/asio/actions/runs/12381745142/job/34560955188?pr=5 |
didn't realise they did a release recently - looks like its just Windows thats an issue |
Well I volunteered to add Windows support since I got openssl working on Windows previously. So we shall see. I am still building my computer but it will be done soon. |
@zaucy I have been working on the Windows support the past couple of days! But I ran into an issue where bazel isnt specifying the includes. bazelbuild/bazel#25171 Have you seen this before? |
From the looks of it it seems you're passing Also you should prefer the |
OH the space. I wonder where we are doing that? Edit: Oh it was implicitly adding a space in our copts between arguments which works on linux and mac but now Windows. Thank you! |
@zaucy Do you happen to understand perl scripts? Openssl uses them to generate |
I'm not really familiar with perl. I do know however that
For the not generated part - if I were to guess it would be because the output paths are different on Windows in some subtle way. |
Thank you for the advice! I agree Oh nevermind its still a problem lol fun |
@zaucy I created a |
My current guess is that because the genfiles are being generated in the Generation:
Error:
|
Okay so its marking the generating action as successful but outputting no files (known to bazel). Thats the issue.
Output:
|
Are you using some absolute paths or internal bazel path assumptions? Could be part of the problem. Want to link me the script? I can try to run it and try a few things maybe. |
It is kind of odd. The script only exists on my branch and the way I have been testing is running the github actions since there are quite a few steps. raccoons-build/bazel-openssl-cc#5 The script being run looks like this though.
So it takes four params. An example would be
Or if you ran from a fork of openssl directly it would be
|
I reproduced the error in https://github.com/andrewkatson/perl_genrule_problem.git if you wanted an easier playground for this |
Ok just to close the loop I was accidentally overwriting the files generated with each new generation... |
Update: This may not even be possible.... |
What is the plan if this is truly not possible? Because my other project is blocked on boost asio working for Bazel and I gave up on Windows on my personal project... So perhaps we should just say using boost asio with Bazel and openssl doesnt work on Windows until rules_perl works and/or Bazel stops overriding |
Ok another reason this cannot be done. Openssl only generates assembly for Windows using nasm not masm. And the only nasm toolchain I can find for bazel only supports Linux and Mac. So like I am not sure what action I can even do here. |
@zaucy what can we do here? |
As I'm not very familiar with how openssl compiles on Windows at all I'm not sure. For my projects I've been pretty content using boringssl on Windows so it hasn't been much of an issue for me. As for support in boost.asio as long as boost asio compiles with openssl as a dep (even on windows if it's not used) then that seems fine at least for me and hopefully anyone else targetting Windows until openssl is actually supported in the BCR. |
WDYM? Without explicit Windows support will it ever compile with openssl as a dep? Or do you mean it needs to compile when boringssl is specified via flag -- which even with no Windows support it shouldn't be an issue iiuc? I will keep trying to get openssl working with Windows but I do feel concerned with the next steps. For instance, the only ways I see forward are either 1. Making my own custom toolchain and maintaining it or 2. Using As far as boringssl in my project I cannot because we somehow use features in openssl that are not in boringssl -- I have tried compiling with boringssl and I get compilation errors around missing definitions. Also my project is millions of lines of legacy code that I inherited so I am unsure of the feasibility of fixing that. Especially since I am no cryptography expert and the cryptography used is complex, archaic, and widespread. |
I just mean that OpenSSL already has to be enabled via flag in this repo and the However I understand that might not be feasible for you and your project you're inheriting. Sounds like a lot to manage. Does openssl compiles for Windows with MSVC + CMake upstream? I haven't looked at the official build instructions. If that's the case and the generated files from perl script is the limiting factor then could we not patch in those generated files just for Windows? Then running the perl script as a build step might not be necessary. I did try your https://github.com/andrewkatson/perl_genrule_problem.git repo, but I didn't get anywhere with the time I was able to spend looking. |
Okay that makes sense. Its funny Openssl has this file which says it supports MSVC (which is what I am trying to do now) but only |
Oh intriguing it also supports |
I found this from boringssl... https://github.com/rustls/boringssl/blob/018edfaaaeea43bf35a16e9f7ba24510c0c003bb/util/util.bzl#L149. So we could just get around this entire headache by disabling all the assembly... WDYT? between that and using OpenSSLs limited support for masm. @zaucy |
@zaucy I finished adding OpenSSL support for Windows with Bazel and am getting my pr reviewed now |
Congrats! That is great news |
Just an update. v1 of the review is done and now we are hashing out (hopefully) final details! |
No description provided.