Skip to content

[openssl] Finish unified configuration for windows and non-windows - #27261

Merged
JavierMatosD merged 13 commits into
microsoft:masterfrom
dg0yt:openssl-unix
Feb 28, 2023
Merged

[openssl] Finish unified configuration for windows and non-windows#27261
JavierMatosD merged 13 commits into
microsoft:masterfrom
dg0yt:openssl-unix

Conversation

@dg0yt

@dg0yt dg0yt commented Oct 16, 2022

Copy link
Copy Markdown
Contributor
  • What does your PR fix?

    Complements [openssl] Revise jom/nmake support #27150 for the unix part, using a similar structure.
    Leverages vcpkg_configure_make/vcpkg_install_make via a simple configure wrapper script instead of adding indirection via a complex CMake project.
    Unifies windows and unix feature configuration in the main port file, ensuring consistency. (Inconsistencies was added even by those who should review PRs: [openssl] Add no-ssl3 and no-weak-ssl-ciphers to Configure options #28743)
    Retains etc/ssl.
    Removes pointless no-ssl2 option which was deprecated years ago.
    Improves the linux kernel headers message.
    Adds a check and message for Perl's IPC::Cmd module. Cf. [openssl] Build error #27929 et al.

  • Which triplets are supported/not supported? Have you updated the CI baseline?

    unchanged, no

  • Does your PR follow the maintainer guide?

    yes

  • If you have added/updated a port: Have you run ./vcpkg x-add-version --all and committed the result?

    yes

  • Tests

    This change would benefit from independent testing wrt to all the target triplet particularities.

    • x64-linux (CI, @dg0yt)
    • x64-linux-dynamic (@dg0yt)
    • arm-linux cross (@dg0yt)
    • x64-mingw-static cross (@dg0yt)
    • x64-mingw-static native (@dg0yt)
    • x64-mingw-dynamic cross (@dg0yt)
    • x64-mingw-dynamic native (@dg0yt)
    • x64-osx (CI)
    • *-android
    • *-ios
    • *-emscripten

@dg0yt
dg0yt force-pushed the openssl-unix branch 2 times, most recently from 9f57ced to 0ce019f Compare October 16, 2022 18:35
@FrankXie05 FrankXie05 added the category:port-bug The issue is with a library, which is something the port should already support label Oct 17, 2022

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new experimental fast check for PR issues. Please let us know if this bot is helpful!

After committing all other changes, the version database must be updated
git add -u && git commit
git checkout 79fa9d85cb4510b05c2657bd7ec8a6a2cb266dc5 -- versions
./vcpkg x-add-version --all
Diff
diff --git a/versions/baseline.json b/versions/baseline.json
index 888ca87..0fe514b 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -5474,7 +5474,7 @@
     },
     "openssl": {
       "baseline": "3.0.5",
-      "port-version": 5
+      "port-version": 6
     },
     "openssl-unix": {
       "baseline": "1.1.1h",
diff --git a/versions/o-/openssl.json b/versions/o-/openssl.json
index 58def96..e33a631 100644
--- a/versions/o-/openssl.json
+++ b/versions/o-/openssl.json
@@ -1,5 +1,10 @@
 {
   "versions": [
+    {
+      "git-tree": "505abd97c0b1f95c72b96509bd13fa7d0dc84225",
+      "version": "3.0.5",
+      "port-version": 6
+    },
     {
       "git-tree": "067a790dfd1559e77d5a199ccbe982322882d667",
       "version": "3.0.5",

github-actions[bot]
github-actions Bot previously approved these changes Jan 17, 2023
@dg0yt

dg0yt commented Jan 18, 2023

Copy link
Copy Markdown
Contributor Author

Baseline regression with similarities to #28827, investigating.

@dg0yt dg0yt changed the title [openssl] Revise non-windows build [openssl] Finish unified configuration for windows and non-windows Jan 18, 2023
@dg0yt
dg0yt marked this pull request as ready for review January 18, 2023 07:17
@dg0yt
dg0yt marked this pull request as draft January 18, 2023 17:23
github-actions[bot]
github-actions Bot previously approved these changes Jan 21, 2023
github-actions[bot]
github-actions Bot previously approved these changes Feb 10, 2023
github-actions[bot]
github-actions Bot previously approved these changes Feb 16, 2023
@dg0yt

dg0yt commented Feb 16, 2023

Copy link
Copy Markdown
Contributor Author

CC @BillyONeal This should really be handled before the next upstream update.

LilyWangLL
LilyWangLL previously approved these changes Feb 17, 2023
FrankXie05
FrankXie05 previously approved these changes Feb 17, 2023
@FrankXie05 FrankXie05 added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Feb 17, 2023

@JavierMatosD JavierMatosD left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks great, with some minor changes/feedback. The important one is that it looks like you are using {VERSION} openssl/portfile.cmake but removed vcpkg_minimum_required.

Other than that, it looks good to me. :)

file(COPY "${CURRENT_PACKAGES_DIR}/${script}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/${script}" "${CURRENT_PACKAGES_DIR}/debug/${script}")
endforeach()
vcpkg_copy_tools(TOOL_NAMES openssl AUTO_CLEAN)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

c_rehash could be added to vcpkg_copy_tools

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot handle scripts with vcpkg_copy_tools because it only handles .exe for windows. And this code runs for native mingw builds.

Comment thread ports/openssl/unix/portfile.cmake Outdated
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
foreach(script IN ITEMS "bin/c_rehash")
file(COPY "${CURRENT_PACKAGES_DIR}/${script}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/${script}" "${CURRENT_PACKAGES_DIR}/debug/${script}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just rename instead of copy and remove?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't matter that much. We always have to remove the debug variant. So there will always be two commands.
The loop is obsolete now. OTOH it makes clear that c_rehash is a script. This fact is relevant with regard to vcpkg_copy_tools.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

Comment thread ports/openssl/unix/portfile.cmake Outdated
Comment on lines +132 to +144
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_MINGW)
# For consistency with nmake build
file(GLOB engines "${CURRENT_PACKAGES_DIR}/lib/ossl-modules/*.dll")
if(engines)
file(COPY ${engines} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/ossl-modules")
endif()
file(GLOB engines "${CURRENT_PACKAGES_DIR}/debug/lib/ossl-modules/*.dll")
if(engines)
file(COPY ${engines} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/ossl-modules")
endif()
endif()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be guarded by if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_MINGW) since you are already checking if there are dll's in ossl-modules? If there are DLLs, they should be moved regardless IMO.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems robust enough to remove the extra guard now. OTOH, it make the purpose very clear.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

@@ -1,31 +1,57 @@
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like you're still using VERSION; should this be kept?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The check is obsolete since the check in scripts/ports.cmake was updated.

@JavierMatosD JavierMatosD added requires:author-response and removed info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. labels Feb 23, 2023

@dg0yt dg0yt left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can do the simlifications, but it seems in some spots it is remains necessay to say why it is this way.

@@ -1,31 +1,57 @@
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. The check is obsolete since the check in scripts/ports.cmake was updated.

Comment thread ports/openssl/unix/portfile.cmake Outdated
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
foreach(script IN ITEMS "bin/c_rehash")
file(COPY "${CURRENT_PACKAGES_DIR}/${script}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/${script}" "${CURRENT_PACKAGES_DIR}/debug/${script}")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't matter that much. We always have to remove the debug variant. So there will always be two commands.
The loop is obsolete now. OTOH it makes clear that c_rehash is a script. This fact is relevant with regard to vcpkg_copy_tools.

file(COPY "${CURRENT_PACKAGES_DIR}/${script}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/${script}" "${CURRENT_PACKAGES_DIR}/debug/${script}")
endforeach()
vcpkg_copy_tools(TOOL_NAMES openssl AUTO_CLEAN)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot handle scripts with vcpkg_copy_tools because it only handles .exe for windows. And this code runs for native mingw builds.

Comment thread ports/openssl/unix/portfile.cmake Outdated
Comment on lines +132 to +144
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_MINGW)
# For consistency with nmake build
file(GLOB engines "${CURRENT_PACKAGES_DIR}/lib/ossl-modules/*.dll")
if(engines)
file(COPY ${engines} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/ossl-modules")
endif()
file(GLOB engines "${CURRENT_PACKAGES_DIR}/debug/lib/ossl-modules/*.dll")
if(engines)
file(COPY ${engines} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/ossl-modules")
endif()
endif()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems robust enough to remove the extra guard now. OTOH, it make the purpose very clear.

@dg0yt dg0yt left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JavierMatosD Ready to review again.

Comment thread ports/openssl/unix/portfile.cmake Outdated
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
foreach(script IN ITEMS "bin/c_rehash")
file(COPY "${CURRENT_PACKAGES_DIR}/${script}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/${script}" "${CURRENT_PACKAGES_DIR}/debug/${script}")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

Comment thread ports/openssl/unix/portfile.cmake Outdated
Comment on lines +132 to +144
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" AND VCPKG_TARGET_IS_MINGW)
# For consistency with nmake build
file(GLOB engines "${CURRENT_PACKAGES_DIR}/lib/ossl-modules/*.dll")
if(engines)
file(COPY ${engines} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/ossl-modules")
endif()
file(GLOB engines "${CURRENT_PACKAGES_DIR}/debug/lib/ossl-modules/*.dll")
if(engines)
file(COPY ${engines} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/ossl-modules")
endif()
endif()

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-bug The issue is with a library, which is something the port should already support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants