libressl/portable

Expected steps for Visual Studio native build on x64 Windows 10

Closed this issue · 4 comments

I've encountered build issues attempting to build libressl portable from source. My steps are:

First check to see if prebuilt windows libraries are available via https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/ but the last zip is libressl-2.5.5-windows.zip which is quite dated.

git clone master (this repository)

The docs state a pre-build step is necessary, but leave Windows users unclear how to perform the ./autogen.sh step as it clearly depends on l/unix tooling. However both the primary readme and readme.windows assure that native VS2022 builds are supported, so, assume cmake will later handle this and proceed.

In a newly created vs repository inside portable, issue cmake ../ -G "Visual Studio 17 2022" from the x64 Native Tools VS 2022 command prompt.

However it spews numerous "file failed to open for reading (No such file or directory)", and for the first dozen or so I can confirm they are not present at this point, so leaning on cmake was insufficient. Other errors relate to CMakeList.txt formatting and regex use, so I'm wondering if there's a specific cmake version requirement?

For example:

CMake Error at CMakeLists.txt:26 (string):
  string sub-command STRIP requires two arguments.

What am I doing wrong?

Thanks

As far as I know (and how I have been able to do it) is that before running CMake, it is required to run ./update.sh inside a linux/unix shell. This will clone the openbsd sources into the portable libressl. I use Windows Subsystem for Linux to run that (you could probably also use git bash or cygwin), and then I can open the CMake file in visual studio. This could be better explained I think!

Thanks, that is doable. Could that be added under the Prerequisites section for Windows users just to make it abundantly clear?

Using git bash (apparently via MINGW64)

$ ./autogen.sh
pulling upstream openbsd source
Not on a tag, grabbing latest (NOTE: this may be broken from time to time)
Already on 'master'
Your branch is up to date with 'origin/master'.
Already up to date.
libcrypto version 53:0:0
libssl version 56:0:0
libtls version 29:0:0
Added OID dsa
objects.txt:41:Undefined identifier X9_62_id_fieldType

Looks like an error, and any following cmake fails with similar errors from the first post.

I'd imagine you're also missing Perl, or perhaps grabbed the Git HEAD at the wrong time. At any rate, let's call the question of whether to use git or not answered in https://github.com/libressl/portable?tab=readme-ov-file#building-from-a-git-checkout - thanks @RandomInEqualities for the docs updates.