#63726 closed defect (fixed)
mysql8: Could not run sw_vers
Reported by: | josephsacco | Owned by: | herbygillot (Herby Gillot) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.1 |
Keywords: | monterey | Cc: | arietis (Sergei Guselnikov), chrstphrchvz (Christopher Chavez) |
Port: | mysql8 |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
mysql8 does not build under MacOS 12.0.01:
databases_mysql8/mysql8/work/build :info:configure -- CMAKE_GENERATOR: Unix Makefiles :info:configure -- Looking for sys/types.h :info:configure -- Looking for sys/types.h - found :info:configure -- Looking for stdint.h :info:configure -- Looking for stdint.h - found :info:configure -- Looking for stddef.h :info:configure -- Looking for stddef.h - found :info:configure -- Check size of void * :info:configure -- Check size of void * - done :info:configure -- SIZEOF_VOIDP 8 :info:configure CMake Error at cmake/package_name.cmake:92 (MESSAGE): :info:configure Could not run sw_vers :info:configure Call Stack (most recent call first): :info:configure cmake/package_name.cmake:150 (GET_PACKAGE_FILE_NAME) :info:configure CMakeLists.txt:754 (INCLUDE) :info:configure -- Configuring incomplete, errors occurred! :info:configure See also "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_databases_mysql8/mysql8/work/build/CMakeFiles/CMakeOutput.log".
Log file attached.
-Joseph
Attachments (5)
Change History (28)
Changed 3 years ago by josephsacco
comment:1 Changed 3 years ago by arietis (Sergei Guselnikov)
Cc: | arietis added |
---|
comment:2 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Cc: | chrstphrchvz added |
---|
comment:3 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
:info:configure CMake Error at cmake/package_name.cmake:92 (MESSAGE): :info:configure Could not run sw_vers :info:configure Call Stack (most recent call first): :info:configure cmake/package_name.cmake:150 (GET_PACKAGE_FILE_NAME) :info:configure CMakeLists.txt:754 (INCLUDE) :info:configure -- Configuring incomplete, errors occurred!
I’m curious—what does the sw_vers
command output on macOS Monterey, and is it somehow formatted differently from previous macOS such that it would break the relevant CMake code?
comment:4 Changed 3 years ago by josephsacco
cavandish:~ jsacco$ sw_vers ProductName: macOS ProductVersion: 12.0.1 BuildVersion: 21A559
-Joseph
Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Attachment: | sw_vers_debug.diff added |
---|
Patch to debug output from sw_vers command
comment:5 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
I attached a patch sw_vers_debug.diff. Joseph, could you please give it a try and report what is output?
comment:6 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Can someone please assign this ticket to the maintainer (@herbygillot)?
comment:7 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|---|
Keywords: | monterey added; mysql8 make removed |
Owner: | set to herbygillot |
Status: | new → assigned |
Summary: | mysql8 does not build under MacOS 12.0.01 → mysql8: Could not run sw_vers |
Their code is certainly very stupid. Why do they run sw_vers
and then parse its output with regular expressions when they could just run sw_vers -productVersion
and use its output directly? Even so, I don't see why their code does not work.
comment:8 Changed 3 years ago by josephsacco
Output with patch applied:
-- CMAKE_GENERATOR: Unix Makefiles -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of void * -- Check size of void * - done -- SIZEOF_VOIDP 8 -- SW_VERS_OUTPUT_LIST: 'ProductName: macOS;ProductVersion: 12.0.1;BuildVersion: 21A559' -- SW_VERS_PRODUCTNAME: 'ProductName: macOS' -- SW_VERS_PRODUCTVERSION: 'ProductVersion: 12.0.1' -- CMAKE_MATCH_1: '12' -- CMAKE_MATCH_2: '0' CMake Error at cmake/package_name.cmake:97 (MESSAGE): Could not run sw_vers Call Stack (most recent call first): cmake/package_name.cmake:155 (GET_PACKAGE_FILE_NAME) CMakeLists.txt:754 (INCLUDE)
Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Attachment: | more_sw_vers_debug.diff added |
---|
Another patch to debug sw_vers command output
comment:9 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Joseph, thank you for testing the patch. I believe I now know what is causing the problem. Could you please test more_sw_vers_debug.diff? The output I expect from it is:
-- SW_VERS_OUTPUT_LIST: 'ProductName: macOS;ProductVersion: 12.0.1;BuildVersion: 21A559' -- SW_VERS_PRODUCTNAME: 'ProductName: macOS' -- SW_VERS_PRODUCTVERSION: 'ProductVersion: 12.0.1' -- CMAKE_MATCH_1: '12' -- CMAKE_MATCH_2: '0' -- CMAKE_MATCH_1: TRUE -- CMAKE_MATCH_2: FALSE
I will attach another patch with a possible fix shortly.
comment:10 Changed 3 years ago by josephsacco
Confirmed...
Output with more_sw_vers_debug.diff
patch applied:
-- SW_VERS_OUTPUT_LIST: 'ProductName: macOS;ProductVersion: 12.0.1;BuildVersion: 21A559' -- SW_VERS_PRODUCTNAME: 'ProductName: macOS' -- SW_VERS_PRODUCTVERSION: 'ProductVersion: 12.0.1' -- CMAKE_MATCH_1: '12' -- CMAKE_MATCH_2: '0' -- CMAKE_MATCH_1: TRUE -- CMAKE_MATCH_2: FALSE CMake Error at cmake/package_name.cmake:107 (MESSAGE): Could not run sw_vers
Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Attachment: | patch-package_name.cmake.diff added |
---|
Patch with possible fix
comment:11 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
If the port configures correctly with the patch, I will open a pull request. I have not found any reports of this issue upstream, so I will likely also forward the issue and the patch upstream.
comment:12 Changed 3 years ago by josephsacco
Build of mysql8
completed
cavandish:bin jsacco$ port installed | grep mysql8 mysql8 @8.0.27_0 (active)
-Joseph
comment:13 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
comment:14 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:15 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Reported upstream: https://bugs.mysql.com/bug.php?id=105464
However upstream says they cannot reproduce the issue.
comment:16 Changed 3 years ago by josephsacco
Hmmm... The upstream team used cmake @3.21.3. The latest on MacPorts is cmake @3.21.4 A cmake issue perhaps?
I can do the experiment this weekend when I get some free cycles.
-Joseph
comment:17 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
I currently don’t have any idea why upstream doesn’t observe the issue.
Maybe give Ryan’s suggestion to instead use sw_vers -productVersion
(comment:7) a try: https://github.com/chrstphrchvz/mysql-server/commit/65ed29a0f964.patch
comment:18 Changed 3 years ago by josephsacco
Ryan's patch is, of course, a patch to follow the current patch. And yes, with both applied in sequence, mysql8 builds.
-Joseph
comment:19 Changed 3 years ago by josephsacco
FWIW... Today I installed cmake @3.21.3, removed patch-package_name.cmake.diff
from the Portfile and ran port configure
. The configuration stage failed:
CMake Error at cmake/package_name.cmake:92 (MESSAGE): Could not run sw_vers Call Stack (most recent call first): cmake/package_name.cmake:150 (GET_PACKAGE_FILE_NAME) CMakeLists.txt:754 (INCLUDE) -- Configuring incomplete, errors occurred!
So... I have no idea what magic the upstream team performed.
-Joseph
comment:20 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Apparently upstream had already fixed the issue internally using what I believe is an equivalent change: https://bugs.mysql.com/bug.php?id=105464#c517341
Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Attachment: | patch-package_name.cmake.2.diff added |
---|
Patch for upstream fix
comment:21 follow-up: 22 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Joseph, could you please test patch-package_name.cmake.2.diff (using it instead of patch-package_name.cmake.diff)? I will then let upstream know that it works for you.
comment:22 Changed 3 years ago by chrstphrchvz (Christopher Chavez)
Replying to chrstphrchvz:
Joseph, could you please test patch-package_name.cmake.2.diff (using it instead of patch-package_name.cmake.diff)? I will then let upstream know that it works for you.
No need to deactivate or uninstall mysql8. I only need to know that the configure phase works, so I would do port clean mysql8
and port -vst configure mysql8
.
comment:23 Changed 3 years ago by josephsacco
Christopher,
- Added
patch-package_name.cmake.2.diff
to files directory - Edited Portfile to use
patch-package_name.cmake.2.diff
instead ofpatch-package_name.cmake.diff
- Ran
sudo port -vst configure mysql8
---> Applying patch-package_name.cmake.2.diff DEBUG: Environment: DEBUG: CC_PRINT_OPTIONS='YES' DEBUG: CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_Users_jsacco_ports_databases_mysql8/mysql8/work/.CC_PRINT_OPTIONS' DEBUG: CPATH='/opt/local/include' DEBUG: DEVELOPER_DIR='/Library/Developer/CommandLineTools' DEBUG: LIBRARY_PATH='/opt/local/lib' DEBUG: MACOSX_DEPLOYMENT_TARGET='12.0' DEBUG: SDKROOT='/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk' Executing: cd "/opt/local/var/macports/build/_Users_jsacco_ports_databases_mysql8/mysql8/work/mysql-8.0.27" && /usr/bin/patch -p1 < '/Users/jsacco/ports/databases/mysql8/files/patch-package_name.cmake.2.diff' DEBUG: system: cd "/opt/local/var/macports/build/_Users_jsacco_ports_databases_mysql8/mysql8/work/mysql-8.0.27" && /usr/bin/patch -p1 < '/Users/jsacco/ports/databases/mysql8/files/patch-package_name.cmake.2.diff'
- Configure phase completed without incident.
Onwards,
-Joseph
main.log