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

CI on windows #82

Closed
est31 opened this issue Apr 13, 2023 · 9 comments
Closed

CI on windows #82

est31 opened this issue Apr 13, 2023 · 9 comments

Comments

@est31
Copy link
Contributor

est31 commented Apr 13, 2023

Hi, I had someone trying to add windows CI to my library, but it failed due to a CI issue caused by botan:

    ERROR: Error linking src\lib\asn1\alg_id.h into D:\a\rcgen\rcgen\target\debug\build\botan-sys-9c6d11f4de739658\out\botan\build\include\botan: [WinError 17] The system cannot move the file to a different disk drive: 'src\\lib\\asn1\\alg_id.h' -> 'D:\\a\\rcgen\\rcgen\\target\\debug\\build\\botan-sys-9c6d11f4de739658\\out\\botan\\build\\include\\botan\\alg_id.h'

it's apparently really two different disk drives, as alg_id.h seems to be in C:. I'm not sure if this is an issue of botan-rs, and how one can work around in the CI.

rustls/rcgen#118

@randombit
Copy link
Owner

Ah interesting. In the build system, on Unix systems we use symlinks to populate the include directory. For various reasons symlinks don't work well on Windows (have to have a special permission that is commonly not available) so we try to use hardlinks there. But hardlinks of course don't work across file systems.

This can be avoided by passing --link-method=copy to the configure.py build script but botan-src doesn't currently support providing this option.

@randombit
Copy link
Owner

I'm publishing botan-src 0.201903.1 right now, which will add support. You can set it by including in the environment

BOTAN_CONFIGURE_LINK_METHOD=copy

@randombit
Copy link
Owner

Published now, please give it a try and let me know if there are further problems.

I'll look at creating a Windows CI on this crate as well which will hopefully help catch issues like this

@est31
Copy link
Contributor Author

est31 commented Apr 13, 2023

Thanks! That advice solved the error.

Now it gives a different one :) (link):

  mingw32-make: *** No rule to make target 'D:\a\rcgen\rcgen\target\debug\build\botan-sys-b7ad4560577ce3ea\out\botan\botan.lib', needed by 'libs'.  Stop.

@randombit
Copy link
Owner

Oof, ok thanks I'll look into this

@randombit
Copy link
Owner

I have a Windows CI build progressing far enough to replicate the issue you are seeing, no idea why it is happening so far.

@randombit
Copy link
Owner

A tiny bit of progress - the makefile has D:\a\..\botan\botan.lib while the makefile target name is D:\a\..\botan/botan.lib (notice the different slash type in the last element of the path), and while these point to the same file, mingw make apparently doesn't understand that, so when it goes to look for a target it can't find a match.

@randombit
Copy link
Owner

@est31 with a lot of trial and error and a few minor hacks #84 has merged and we have at least one working Windows CI build.

I've published botan 0.10.5 (and botan-src 0.30101.2) which seem to support Windows. I'm going to close this ticket since CI does work, but please do open a new issue if you run into any further problems.

@est31
Copy link
Contributor Author

est31 commented Jul 15, 2023

@randombit that's really amazing! I am going to try this out very soon, in rustls/rcgen#125 . In any case, I'd like to thank you a lot for the help!

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

No branches or pull requests

2 participants