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

qt5-kde on MacOS 12.6.2 , SDK 13.1 #92

Closed
21stcaveman opened this issue Dec 27, 2022 · 30 comments
Closed

qt5-kde on MacOS 12.6.2 , SDK 13.1 #92

21stcaveman opened this issue Dec 27, 2022 · 30 comments

Comments

@21stcaveman
Copy link

21stcaveman commented Dec 27, 2022

Been having a bit of an issue when trying to install qt5-kde on a fresh install of Monterey 12.6.2
Installed XCode 14.2 which comes with SDK 13.1
When I get to configure part of qt5-kde, it complains about not finding the SDK for 'macosx12'. I tracked that down to line 719 of the Portfile. 'xcrun --show-sdk-path -sdk macosx12' indeed fails on this system, so I tried 'xcrun --show-sdk-path -sdk macosx' and 'xcrun --show-sdk-path -sdk macosx13.1', they both work fine.
I commented everything out from line 719 to line 742 (simply didn't put enough time to understand why it breaks! sorry.) except for this part:

set SDK [exec xcrun -show-sdk-version]
if {[catch {exec xcrun --show-sdk-path -sdk macosx${SDK}} result]} {
    ui_msg "Couldn't find the preferred nor a SDK macosx${SDK}: ${result}"
    ui_msg "WARNING: this has been known to lead to build errors"
} else {
    ui_debug "Using default SDK macosx${SDK}"
    configure.args-append \
            -sdk macosx${SDK}
}

That did fix the configure part.

@RJVB
Copy link
Owner

RJVB commented Dec 27, 2022 via email

@21stcaveman
Copy link
Author

hmmm.. doesn't seem to work. This is what I did:

...
               # the preferred matching SDK isn't available; check if the default SDK is
                set SDK [exec xcrun -show-sdk-version]
                if {${SDK} >= 12} {
                    # on this (and newer?) OS versions we need to use `-sdk macosx`
                    # see #92
                    set SDK ""
                }
                if {[catch {exec xcrun --show-sdk-path -sdk macosx${SDK}} result]} {
                    ui_msg "Couldn't find the preferred nor a SDK macosx${SDK}: ${result}"
                    ui_msg "WARNING: this has been known to lead to build errors"
...

and I get this in the configure step:
Project ERROR: Could not resolve SDK --show-sdk-path for 'macosx12'

@21stcaveman
Copy link
Author

well, it turns out it doesn't even get to that. I see:

sdkroot was /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk
Using SDK from configure.sdkroot= /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk

How is 'sdkroot' set?

@RJVB
Copy link
Owner

RJVB commented Jan 4, 2023 via email

@21stcaveman
Copy link
Author

I won't even see that messgage, because the if in line 719 passes with true (configure.sdkroot is not empty). So it won't even get into the else clause.
I'm not passing the sdkroot, and it is not an env variable on my system.
if I understand correctly, line 851 clears configure.sdkroot , correct? If that is correct, how is sdkroot set for the 'if' in line 719?

@RJVB
Copy link
Owner

RJVB commented Jan 4, 2023 via email

@21stcaveman
Copy link
Author

oh, sure. I've put this before the if:

set SDK [exec xcrun -show-sdk-version]
ui_msg "SDK='${SDK}' , os.major='${os.major}'"

and this is the message it prints out :
SDK='13.1' , os.major='21'

I'm on MacOS Monterey, v12.6.2

@RJVB
Copy link
Owner

RJVB commented Jan 5, 2023 via email

@21stcaveman
Copy link
Author

you mean something like this?

set SDK [exec xcrun -show-sdk-version]
if {${SDK} >= 12} {
    set SDK ""
}
ui_msg "SDK='${SDK}' , os.major='${os.major}'"

If I add that, I get:
SDK='' , os.major='21'
which shows that it works. But in my case, it never actually gets to that point, because sdkroot is set.

Now, as mentioned above, sdkroot is set to /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk. Looking at lines 721 and 722 of the Portfile, we are extracting the last bit (which is macosx12) and passing it to -sdk option if sdkroot is set.
I suspect something like this would fix the problem:

...
if {${os.major} >= 21} {
    # on this (and newer?) OS versions we need to use `-sdk macosx`
    # see [#92](https://github.com/RJVB/macstrop/issues/92)
    configure.args-append -sdk macosx
} else {
    if {${configure.sdkroot} ne ""} {
    ...
}
...

@21stcaveman
Copy link
Author

also, since we're talking about this port, I had to apply this patch again for it to build. Not sure if that should be included or not, just fyi.

@RJVB
Copy link
Owner

RJVB commented Jan 7, 2023

OK, I think I understand now. The error about a macosx12 SDK that you get is printed by the configure script, I should probably have realised that earlier.

That probably also means you're on one of those OS versions which does not by default have the SDK corresponding to its own version ... and really that configure.sdkroot is set inappropriately in your case. Could you check if indeed you don't have a v12 SDK installed? If not, you could post a question about that on one of the mailing lists.

@RJVB
Copy link
Owner

RJVB commented Jan 7, 2023 via email

@RJVB RJVB closed this as completed in 7c42a2f Jan 7, 2023
@21stcaveman
Copy link
Author

Did you pull since xmas? I fixed that issue that day, from what I can see (or at least tried). I'm about to push a tentative fix for the current issue; if not successful feel free to reopen!

I did. This is a new laptop, so I pulled the latest. qt-everywhere still failed to build, and I applied that patch to fix it.
Sounds good, thanks for all the time you put into this, appreciate it.

@RJVB
Copy link
Owner

RJVB commented Jan 8, 2023 via email

@RJVB
Copy link
Owner

RJVB commented Apr 15, 2023

That's weird, so you pulled the ports tree AND did a port clean qt5-kde or at least a port-redo-install-phase -patch qt5-kde? The patch should have been applied automatically in that case!

I just saw that I had forgotten (stupidly) that os.major corresponds to the Darwin version, not to the OS major version as we think of it and it should be used here (i.e. 10 for the original Mac OS X). That ought to be fixed now...

@21stcaveman
Copy link
Author

fyi, just upgraded to 12.6.7 and rebuilt qt5-kde, the patch was automatically applied.

I did run into another issue, where it tries to compile a VERSION file, and complains about 'This' not being a defined type!
had to fix it by commenting the entire file out.
Not sure why, but I do run into that here and there with different ports. in this case, it was :
qt-everywhere-opensource-src-5.9.8/qtscript/src/3rdparty/javascriptcore/VERSION

@RJVB
Copy link
Owner

RJVB commented Jul 2, 2023 via email

@21stcaveman
Copy link
Author

21stcaveman commented Jul 2, 2023

What do you mean with "with different ports"? Not just the qt5-kde ports?

Honestly, it might have been this port before, I just don't remember it. Would need to check my notes.

My qt-everywhere-opensource-src-5.9.8/qtscript/src/3rdparty/javascriptcore/VERSION contains non-code that should never be compiled

Mine as well! that's the thing. It throws an error saying 'This' is not defined in file qtscript/src/3rdparty/javascriptcore/version , where that file shouldn't even be included in the compilation list! as soon as I put that entire file in /* */, the error goes away and all is fine.
I'll try to post the logfile next time.

@RJVB
Copy link
Owner

RJVB commented Jul 3, 2023 via email

@21stcaveman
Copy link
Author

Judging by the fact that issue is resolved by commenting out the VERSION file, I would say no. It is the same file.

@RJVB
Copy link
Owner

RJVB commented Jul 3, 2023 via email

@21stcaveman
Copy link
Author

21stcaveman commented Aug 1, 2023

SO, had to rebuild today, and got a chance to copy the main.log file. Here is the first error caused by the version file (line 538151):

:info:build cd script/ && ( test -e Makefile || /opt/local/var/macports/build/_opt_local_site-ports_aqua_qt5-kde/qt5-kde/work/build/qtbase/bin/qmake -o Makefile /opt/local/var/macports/build/_opt_local_site-ports_aqua_qt5-kde/qt5-kde/work/qt-everywhere-opensource-src-5.9.8/qtscript/src/script/script.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile
:info:build make[3]: Entering directory '/opt/local/var/macports/build/_opt_local_site-ports_aqua_qt5-kde/qt5-kde/work/build/qtscript/src/script'
...
:info:build In file included from /opt/local/var/macports/build/_opt_local_site-ports_aqua_qt5-kde/qt5-kde/work/qt-everywhere-opensource-src-5.9.8/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/pcre/pcre_compile.cpp:44:
:info:build In file included from /opt/local/var/macports/build/_opt_local_site-ports_aqua_qt5-kde/qt5-kde/work/qt-everywhere-opensource-src-5.9.8/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/config.h:68:
:info:build In file included from /opt/local/var/macports/build/_opt_local_site-ports_aqua_qt5-kde/qt5-kde/work/qt-everywhere-opensource-src-5.9.8/qtscript/src/3rdparty/javascriptcore/JavaScriptCore/wtf/FastMalloc.h:27:
:info:build In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/new:91:
:info:build In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.1.sdk/usr/include/c++/v1/cstddef:37:
:info:build /opt/local/var/macports/build/_opt_local_site-ports_aqua_qt5-kde/qt5-kde/work/qt-everywhere-opensource-src-5.9.8/qtscript/src/3rdparty/javascriptcore/version:1:1: error: unknown type name 'This'
:info:build This is a snapshot of JavaScriptCore from
:info:build ^
:info:build /opt/local/var/macports/build/_opt_local_site-ports_aqua_qt5-kde/qt5-kde/work/qt-everywhere-opensource-src-5.9.8/qtscript/src/3rdparty/javascriptcore/version:1:8: error: expected ';' after top level declarator
:info:build This is a snapshot of JavaScriptCore from
:info:build ^

I can send you the log file, if it would be useful.

@RJVB
Copy link
Owner

RJVB commented Aug 2, 2023 via email

@RJVB
Copy link
Owner

RJVB commented Aug 2, 2023 via email

@RJVB
Copy link
Owner

RJVB commented Aug 2, 2023 via email

@21stcaveman
Copy link
Author

Just rebuilt the port with these changes, all went well. I think you're good to merge that.

@RJVB
Copy link
Owner

RJVB commented Aug 3, 2023 via email

@21stcaveman
Copy link
Author

21stcaveman commented Aug 4, 2023

What do you mean with "with different ports"? Not just the qt5-kde ports?

Honestly, it might have been this port before, I just don't remember it. Would need to check my notes.

Aha, found the other one! same thing happens to the 'qgpgme' port.

@RJVB
Copy link
Owner

RJVB commented Aug 4, 2023

You mean gpgme-1.10.0/VERSION ?

@21stcaveman
Copy link
Author

yup, that's the one.

RJVB added a commit that referenced this issue Aug 5, 2023
… on case-insensitive filesystems

Closes: #92
Committed from host : Bola
RJVB added a commit that referenced this issue Aug 5, 2023
…sensitive filesystems

Closes: #92
Committed from host : Portia.local
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