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

Lots of undefined references when compiling the GUI library for Debian #421

Open
OmerFlame opened this issue Sep 29, 2023 · 42 comments
Open

Comments

@OmerFlame
Copy link

OmerFlame commented Sep 29, 2023

Hello,

After seeing that this project is being worked on again, I decided to try compiling the project for Debian again to no avail - I took the precautions beforehand and modified the versions.inc.sh file to look like this, trying to follow the new RedHat versions stated in the specfiles:

libdispatch_version=5.4.2
libobjc2_version=2.1
#gnustep_make_version=2.7.0
gnustep_make_version=2.9.1
gnustep_base_version=master
gnustep_gui_version=master
gnustep_back_version=master

gorm_version=1.3.1
projectcenter_version=master

roboto_mono_version=0.2020.05.08
roboto_mono_checkout=master

MAKE_CMD=make
if type "gmake" 2>/dev/null >/dev/null ;then
  MAKE_CMD=gmake
fi

(Note: I also modified the download-sources.sh script so it works with the unexpected branch names and also renamed the make patch folder from 2.7.0 to 2.9.1 so that the patches will be able to apply properly)

It all goes quite smoothly until compiling libdispatch when I get the infamous -Werror issue, so I remove the flag from the various CMake files and then it compiles successfully. It all goes smoothly until I try to compile the GUI library when I get this massive wall of errors:

Making all in Tools ...
Making all for tool make_services...
 Compiling file make_services.m ...
 Linking tool make_services ...
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_getSymbol_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_parseInt64_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_getSymbols_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `utext_extract_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getCountry_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getScript_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uset_getItemCount_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getISOCountries_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getDisplayName_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_useAnchoringBounds_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `usearch_last_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_requireEnd_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_setRegion_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_clone_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_findNext_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_format_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_clear_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_clone_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_setSymbols_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_setMillis_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `usearch_close_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uenum_next_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_setLenient_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_setUText_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getLCID_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_useTransparentBounds_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_getMillis_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getDisplayLanguage_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_end_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_parse_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udatpg_getSkeleton_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_formatDouble_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_replaceFirstUText_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getDisplayCountry_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getISOLanguages_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucnv_getDefaultName_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_formatInt64_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_setTimeLimit_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unorm2_getInstance_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_openUText_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_parseDouble_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_close_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udatpg_close_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getAvailable_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_equivalentTo_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udatpg_getBestPattern_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_getLimit_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_add_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ulocdata_open_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_close_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_setMatchCallback_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_getTextAttribute_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_close_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_open_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucol_close_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `utext_equals_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_roll_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_getAttribute_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_countSymbols_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unorm2_normalize_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ulocdata_close_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_openKeywords_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_countAvailable_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucol_strcoll_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucol_setAttribute_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_replaceAllUText_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getKeywordValue_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_groupCount_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uset_getItem_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `utext_clone_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_getFieldDifference_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_open_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_get2DigitYearStart_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getLineOrientation_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udatpg_open_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_close_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_hitEnd_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `usearch_first_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uset_close_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getLanguage_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getDisplayKeywordValue_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ulocdata_getExemplarSet_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_getDoubleAttribute_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_getAttribute_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getVariant_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_set2DigitYearStart_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_open_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_format_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_start_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_lookingAt_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_clone_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getDisplayVariant_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getLocaleForLCID_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_get_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_getTimeZoneDisplayName_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_setDoubleAttribute_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_setAttribute_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucol_open_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `usearch_getMatchedLength_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ulocdata_getMeasurementSystem_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_patternUText_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_getCharacterOrientation_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uloc_canonicalize_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_setAttribute_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_matches_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucnv_getStandardName_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucal_set_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucurr_openISOCurrencies_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uenum_close_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_setSymbol_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `utext_close_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `utext_nativeLength_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ucol_setStrength_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `usearch_openFromCollator_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_setText_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `utext_replace_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `ulocdata_getDelimiter_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `unum_setTextAttribute_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `uregex_open_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `utext_setup_65_swift'
/usr/bin/ld: /Library/Libraries/libgnustep-base.so: undefined reference to `udat_isLenient_65_swift'

Why is this happening?? Why is Swift even being involved in here?

I am completely stumped by this...

Note: I am not trying to build packages for Debian, I am merely trying to compile from source.

@trunkmaster
Copy link
Owner

I can't reproduce it here on Debian 12, clang-13. Please show your ldd /Library/Libaries/libgnustep-base.so output. I suspect you have libdispatch from Swift package somewhere in the system installed.

Also keep in mind that Debian build files are quite outdated and you may face other build problems. For example, to build Workspace you need CoreFoundation library to be installed. You may use Packaing/RedHat scripts as a reference.

@OmerFlame
Copy link
Author

As for the ldd output, I'll give it in a moment - as for your remark about Debian build files being outdated, I already found ways to temporarily fix things on my own, which comes in the form of modifying the files and scripts and using the RedHat files as reference like you said. Good to see that my actions make sense 😅

@OmerFlame
Copy link
Author

Please show your ldd /Library/Libaries/libgnustep-base.so output

$ ldd libgnustep-base.so 
        linux-vdso.so.1 (0x00007ffc3eff8000)
        libobjc.so.4.6 => /System/lib/libobjc.so.4.6 (0x00007fed3a458000)
        libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fed39d7c000)
        libavahi-common.so.3 => /lib/x86_64-linux-gnu/libavahi-common.so.3 (0x00007fed3a44a000)
        libavahi-client.so.3 => /lib/x86_64-linux-gnu/libavahi-client.so.3 (0x00007fed39d69000)
        libgnutls.so.30 => /lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007fed39a00000)
        libxslt.so.1 => /lib/x86_64-linux-gnu/libxslt.so.1 (0x00007fed39d26000)
        libxml2.so.2 => /lib/x86_64-linux-gnu/libxml2.so.2 (0x00007fed39854000)
        libffi.so.8 => /lib/x86_64-linux-gnu/libffi.so.8 (0x00007fed39d1a000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fed39cfb000)
        libicui18n.so.72 => /lib/x86_64-linux-gnu/libicui18n.so.72 (0x00007fed39400000)
        libicuuc.so.72 => /lib/x86_64-linux-gnu/libicuuc.so.72 (0x00007fed39202000)
        libicudata.so.72 => /lib/x86_64-linux-gnu/libicudata.so.72 (0x00007fed37400000)
        libdispatch.so => /System/lib/libdispatch.so (0x00007fed39c6c000)
        libcurl-gnutls.so.4 => /lib/x86_64-linux-gnu/libcurl-gnutls.so.4 (0x00007fed39799000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fed37321000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fed39c48000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fed3713f000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fed36e00000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fed3a4d1000)
        libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fed39742000)
        libp11-kit.so.0 => /lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007fed36c68000)
        libidn2.so.0 => /lib/x86_64-linux-gnu/libidn2.so.0 (0x00007fed3710c000)
        libunistring.so.5 => /lib/x86_64-linux-gnu/libunistring.so.5 (0x00007fed36ab8000)
        libtasn1.so.6 => /lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007fed39c33000)
        libnettle.so.8 => /lib/x86_64-linux-gnu/libnettle.so.8 (0x00007fed370ba000)
        libhogweed.so.6 => /lib/x86_64-linux-gnu/libhogweed.so.6 (0x00007fed37071000)
        liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fed391d2000)
        libBlocksRuntime.so => /System/lib/libBlocksRuntime.so (0x00007fed39c2e000)
        libnghttp2.so.14 => /lib/x86_64-linux-gnu/libnghttp2.so.14 (0x00007fed36a89000)
        librtmp.so.1 => /lib/x86_64-linux-gnu/librtmp.so.1 (0x00007fed36a6a000)
        libssh2.so.1 => /lib/x86_64-linux-gnu/libssh2.so.1 (0x00007fed36a24000)
        libpsl.so.5 => /lib/x86_64-linux-gnu/libpsl.so.5 (0x00007fed39c1a000)
        libgssapi_krb5.so.2 => /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007fed369d1000)
        libldap-2.5.so.0 => /lib/x86_64-linux-gnu/libldap-2.5.so.0 (0x00007fed36972000)
        liblber-2.5.so.0 => /lib/x86_64-linux-gnu/liblber-2.5.so.0 (0x00007fed39732000)
        libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fed368b1000)
        libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fed37064000)
        libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fed367d0000)
        libcrypto.so.3 => /lib/x86_64-linux-gnu/libcrypto.so.3 (0x00007fed36200000)
        libkrb5.so.3 => /lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007fed366f4000)
        libk5crypto.so.3 => /lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007fed366c7000)
        libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fed3705e000)
        libkrb5support.so.0 => /lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007fed366b9000)
        libsasl2.so.2 => /lib/x86_64-linux-gnu/libsasl2.so.2 (0x00007fed3669d000)
        libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fed361dd000)
        libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007fed36691000)
        libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fed36096000)
        liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fed36070000)
        libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007fed37057000)
        libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fed3605f000)
        libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fed36037000)

Spot anything weird?

@OmerFlame
Copy link
Author

Also note that the libdispatch in /System/lib is not a symlink to something else - I do have a Swift toolchain installed on the system but it is not referenced in here (at least my eyes aren't able to pick it up...)

@trunkmaster
Copy link
Owner

trunkmaster commented Oct 2, 2023

/System/lib is not NextSpace layout either. NextSpace's location of libdispatch.so is /usr/NextSpace/lib. Here is an excerpt from Packaging/Sources/2_build_libdispatch.sh:

cmake .. \
        -DCMAKE_C_COMPILER=clang \
        -DCMAKE_CXX_COMPILER=clang++ \
        -DCMAKE_SKIP_RPATH=ON \
        -DCMAKE_BUILD_TYPE=Release \
        -DCMAKE_INSTALL_PREFIX=/usr/NextSpace \
        -DCMAKE_INSTALL_LIBDIR=/usr/NextSpace/lib \
        -DINSTALL_PRIVATE_HEADERS=YES \
        -DENABLE_TESTING=OFF \
        -DUSE_GOLD_LINKER=YES

See that -DCMAKE_INSTALL_LIBDIR and -DCMAKE_INSTALL_PREFIX?

@OmerFlame
Copy link
Author

Oh wow, I was under the impression it was in /System/lib, I believe that it's a remnant from other endeavors. I'll try again today and see if it's gonna work.

@OmerFlame
Copy link
Author

I got further, but now I am failing when compiling libcorefoundation, version 5.4.2 as per the spec file:

nextspace/Packaging/Sources/swift-corelibs-foundation/CoreFoundation/Base.subproj/CFBase.c:258:17: error: use of undeclared identifier '_CFAllocatorHintZeroWhenAllocating'
    if (hint == _CFAllocatorHintZeroWhenAllocating) {
                ^
1 error generated.
make[2]: *** [CMakeFiles/CoreFoundation.dir/build.make:76: CMakeFiles/CoreFoundation.dir/Base.subproj/CFBase.c.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:116: CMakeFiles/CoreFoundation.dir/all] Error 2
make: *** [Makefile:136: all] Error 2

I checked and turns out it is declared in a file called ForSwiftFoundationOnly.h - a file that is not used when the compile flag -DCF_DEPLOYMENT_SWIFT is equal to NO - I ran the CMake command exactly like the spec file says and this is what it gave me. Any ideas?

@trunkmaster
Copy link
Owner

I've built without a problem. Probably you haven't applied patches.

@OmerFlame
Copy link
Author

OmerFlame commented Oct 6, 2023

Huh, for some reason I didn't notice any patching in the spec file (is it done somewhere else? I've mostly been winging it, I am unfamiliar with spec files but it's been going okay so far), I'll check the patches and try again.

@OmerFlame
Copy link
Author

I successfully compiled libcorefoundation and now I moved on to compiling the applications and stumbled into more errors - Login.app compiled successfully but Workspace fails due to weird issues with the include headers of CoreFoundation:

In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:49:
In file included from ../../WM/core/log_utils.h:30:
/usr/NextSpace/include/CoreFoundation/CFLogUtilities.h:36:65: error: expected function body after function declarator
CF_EXPORT void CFLog(CFLogLevel level, CFStringRef format, ...) CF_NO_TAIL_CALL CF_FORMAT_FUNCTION(2, 3);
                                                                ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:16:1: error: unknown type name 'CF_IMPLICIT_BRIDGING_ENABLED'
CF_IMPLICIT_BRIDGING_ENABLED
^
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:19:20: error: expected ';' after top level declarator
typedef CFStringRef CFNotificationName CF_EXTENSIBLE_STRING_ENUM;
                   ^
                   ;
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:21:40: error: typedef redefinition with different types ('struct CF_BRIDGED_MUTABLE_TYPE' vs 'struct objc_object *')
typedef struct CF_BRIDGED_MUTABLE_TYPE(id) __CFNotificationCenter * CFNotificationCenterRef;
                                       ^
/usr/NextSpace/include/objc/runtime.h:93:4: note: previous definition is here
} *id;
   ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:21:43: error: expected ';' after top level declarator
typedef struct CF_BRIDGED_MUTABLE_TYPE(id) __CFNotificationCenter * CFNotificationCenterRef;
                                          ^
                                          ;
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:23:40: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFNotificationName name, const void *object, CFDictionaryRef userInfo);
                                       ^~~~~~~~~~~~~~~~~~~~~~~
                                       NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:23:64: error: interface type 'NSNotificationCenter' cannot be passed by value; did you forget * in 'NSNotificationCenter'?
typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFNotificationName name, const void *object, CFDictionaryRef userInfo);
                                                               ^
                                                              *
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:23:88: error: unknown type name 'CFNotificationName'; did you mean 'NSNotificationName'?
typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFNotificationName name, const void *object, CFDictionaryRef userInfo);
                                                                                       ^~~~~~~~~~~~~~~~~~
                                                                                       NSNotificationName
/Developer/Headers/Foundation/NSNotification.h:46:19: note: 'NSNotificationName' declared here
typedef NSString* NSNotificationName;
                  ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:38:11: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetLocalCenter(void);
          ^~~~~~~~~~~~~~~~~~~~~~~
          NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:38:11: error: interface type 'NSNotificationCenter' cannot be returned by value; did you forget * in 'NSNotificationCenter'?
CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetLocalCenter(void);
          ^
                                 *
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:44:11: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetDarwinNotifyCenter(void);
          ^~~~~~~~~~~~~~~~~~~~~~~
          NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:44:11: error: interface type 'NSNotificationCenter' cannot be returned by value; did you forget * in 'NSNotificationCenter'?
CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetDarwinNotifyCenter(void);
          ^
                                 *
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:62:48: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterAddObserver(CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior);
                                               ^~~~~~~~~~~~~~~~~~~~~~~
                                               NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:62:72: error: interface type 'NSNotificationCenter' cannot be passed by value; did you forget * in 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterAddObserver(CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior);
                                                                       ^
                                                                      *
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:64:51: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFNotificationName name, const void *object);
                                                  ^~~~~~~~~~~~~~~~~~~~~~~
                                                  NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:64:75: error: interface type 'NSNotificationCenter' cannot be passed by value; did you forget * in 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFNotificationName name, const void *object);
                                                                          ^
                                                                         *
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:64:105: error: unknown type name 'CFNotificationName'; did you mean 'NSNotificationName'?
CF_EXPORT void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFNotificationName name, const void *object);
                                                                                                        ^~~~~~~~~~~~~~~~~~
                                                                                                        NSNotificationName
/Developer/Headers/Foundation/NSNotification.h:46:19: note: 'NSNotificationName' declared here
typedef NSString* NSNotificationName;
                  ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:65:56: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterRemoveEveryObserver(CFNotificationCenterRef center, const void *observer);
                                                       ^~~~~~~~~~~~~~~~~~~~~~~
                                                       NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:65:80: error: interface type 'NSNotificationCenter' cannot be passed by value; did you forget * in 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterRemoveEveryObserver(CFNotificationCenterRef center, const void *observer);
                                                                               ^
                                                                              *
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake[4]: *** [/Developer/Makefiles/rules.make:521: obj/Advanced.obj/AdvancedPrefs.m.o] Error 1
gmake[3]: *** [/Developer/Makefiles/Instance/bundle.make:193: internal-bundle-run-compile-submake] Error 2
gmake[2]: *** [/Developer/Makefiles/Master/rules.make:297: Advanced.all.bundle.variables] Error 2
gmake[1]: *** [/Developer/Makefiles/Master/bundle.make:37: internal-all] Error 2
gmake: *** [/Developer/Makefiles/Master/serial-subdirectories.make:53: internal-all] Error 2

I am absolutely certain that the types mentioned in this wall of errors do exist, I found them very clearly in the headers for CoreFoundation. What's going on here?

@trunkmaster
Copy link
Owner

You've missed to copy Core Foundation addons before building:

cp %{_sourcedir}/CFNotificationCenter.c CoreFoundation/AppServices.subproj/
cp %{_sourcedir}/CFFileDescriptor.h CoreFoundation/RunLoop.subproj/
cp %{_sourcedir}/CFFileDescriptor.c CoreFoundation/RunLoop.subproj/
cp CoreFoundation/Base.subproj/SwiftRuntime/TargetConditionals.h CoreFoundation/Base.subproj/

You don't have CFNotificationCenter (as well as CFFileDescriptor - used by Window Manager) in your install. It doesn't exist in official Core Foundation repository.

@OmerFlame
Copy link
Author

Nope! I did run these lines and they are in my source tree for CoreFoundation - something else is going on here I think.

@OmerFlame
Copy link
Author

To show you how some of these don't make sense, here's the most laughably odd error from what I was getting:

/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:23:40: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFNotificationName name, const void *object, CFDictionaryRef userInfo);
                                       ^~~~~~~~~~~~~~~~~~~~~~~
                                       NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;

The line in question was a few lines after the declaration of CFNotificationCenterRef - another proof that what you're saying isn't the issue is that the file CFNotificationCenter.h is being mentioned in this very error, this file being one of the files that I needed to copy.

@OmerFlame
Copy link
Author

I also made sure that the symbols exist for the various functions declared in CFNotificationCenter.h - sure enough, they're there:

$ nm -D /usr/NextSpace/lib/libCoreFoundation.so | grep CFNotificationCenterRemoveEveryObserver
0000000000047bf0 T CFNotificationCenterRemoveEveryObserver

@trunkmaster
Copy link
Owner

trunkmaster commented Oct 6, 2023

To show you how some of these don't make sense, here's the most laughably odd error from what I was getting:

/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:23:40: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFNotificationName name, const void *object, CFDictionaryRef userInfo);
                                       ^~~~~~~~~~~~~~~~~~~~~~~
                                       NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;

The line in question was a few lines after the declaration of CFNotificationCenterRef - another proof that what you're saying isn't the issue is that the file CFNotificationCenter.h is being mentioned in this very error, this file being one of the files that I needed to copy.

No, CFNotificationCenter.h exists in Apple repository. CFNotificationCenter.c must be copied. You have to copy these files from NextSpace to CoreFoundation sources:

CFFileDescriptor.c
CFFileDescriptor.h
CFNotificationCenter.c

and apply at least these patches:

CF_shared_on_linux.patch
CFFileDescriptor.patch
CFNotificationCenter.patch

Also you have to copy files inside CoreFoundation sources like this:

cp CoreFoundation/Base.subproj/SwiftRuntime/TargetConditionals.h CoreFoundation/Base.subproj/

@OmerFlame
Copy link
Author

OmerFlame commented Oct 6, 2023

Did all of this already, I ran all of the commands listed in the spec file! However, the same errors still surface. I recompiled 5 times already, I am using clang 17. I can try other versions of clang though I am skeptical that it will make a difference.

EDIT: Can confirm, no difference with clang-14.

@trunkmaster
Copy link
Owner

Let me quote myself "I can't reproduce it here on Debian 12, clang-13."

@OmerFlame
Copy link
Author

Which version of clang-13 specifically?

@trunkmaster
Copy link
Owner

% clang -v
Debian clang version 13.0.1-11+b2
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64

% cat /etc/os-release 
PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

@trunkmaster
Copy link
Owner

@OmerFlame do you have success on building?

@OmerFlame
Copy link
Author

I don't have access to my computer at the moment, I can only try again this Thursday...

@OmerFlame
Copy link
Author

Nope, still failing.

I finally installed clang-13 and recompiled libcorefoundation and found out about something - in the code, including all the patches and header files, it's complaining about redefinition of typedef 'CFNotificationCenterRef'. This typedef is consistent with the errors mentioned in the applications build script.

It's also important to mention that all of the redefinition messages in the compiler are listed as warnings, not errors.

Something is weird here.

@OmerFlame
Copy link
Author

After fully recloning CoreFoundation, reapplying patches and copying headers, the redefinition issues disappeared, which is a step in the right direction. However, it STILL does not compile, complaining about CFNotificationCenterRef being completely missing, alongside CFNotificationName.

Yes, I did copy the files over, I applied the required patches, I did everything I needed to do. The files exist in the header files, yet it still gives me the following build errors:

[sudo] password for omershamai:
This is gnustep-make 2.9.1. Type 'gmake print-gnustep-make-help' for help.
Running in gnustep-make version 2 strict mode.
rm -rf ./*~ ./obj
Making clean in Login ...
rm -rf ./*~ ./obj
Making clean in Preferences ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Login.preferences)
(cd .; \
rm -rf    *.app)
Making clean in Workspace ...
rm -rf ./*~ ./obj
Making clean in Viewers/BrowserViewer ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   BrowserViewer.viewer)
Making clean in Viewers/IconViewer ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Icon.viewer)
Making clean in Inspectors ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Inspectors.bundle)
Making clean in Tools/FileMover ...
rm -rf ./*~ ./obj
Making clean in Tools/Sizer ...
rm -rf ./*~ ./obj
Making clean in Preferences/Advanced ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Advanced.wsprefs)
Making clean in Preferences/Browser ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Browser.wsprefs)
Making clean in Preferences/Dock ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Dock.wsprefs)
Making clean in Preferences/FileCopyOptions ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   FileCopyOptions.wsprefs)
Making clean in Preferences/IconView ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   IconView.wsprefs)
Making clean in Preferences/Shelf ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Shelf.wsprefs)
Making clean in Preferences/Desktops ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Desktops.wsprefs)
(cd .; \
rm -rf    *.app)
Making clean in Preferences ...
rm -rf ./*~ ./obj
Making clean in Modules/Display ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Display.preferences)
Making clean in Modules/Date ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Date.preferences)
Making clean in Modules/Localization ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Localization.preferences)
Making clean in Modules/Font ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Font.preferences)
Making clean in Modules/Display ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Display.preferences)
Making clean in Modules/Screen ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Screen.preferences)
Making clean in Modules/Keyboard ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Keyboard.preferences)
Making clean in Modules/Mouse ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Mouse.preferences)
Making clean in Modules/Menu ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Menu.preferences)
Making clean in Modules/Services ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Services.preferences)
Making clean in Modules/Sound ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Sound.preferences)
Making clean in Modules/Expert ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Expert.preferences)
Making clean in Modules/Password ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Password.preferences)
Making clean in Modules/Power ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Power.preferences)
(cd .; \
rm -rf    *.app)
Making clean in Terminal ...
rm -rf ./*~ ./obj
Making clean in Preferences ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf   Preferences.bundle)
(cd .; \
rm -rf    *.app)
Making clean in TextEdit ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf    *.app)
Making clean in TimeMon ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf    *.app)
Making clean in Review ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf    *.app)
Making clean in OpenUp ...
rm -rf ./*~ ./obj
(cd .; \
rm -rf    *.app)
This is gnustep-make 2.9.1. Type 'gmake print-gnustep-make-help' for help.
Running in gnustep-make version 2 strict mode.
Making all in Login ...
Making all in Preferences ...
Making all for bundle Login...
 Creating Login.preferences/....
 Compiling file Login.m ...
 Linking bundle Login ...
 Creating Login.preferences/Resources...
 Copying resources into the bundle wrapper...
 Copying localized resources into the bundle wrapper...
 Creating stamp file...
 Creating Login.preferences/Resources/Info-gnustep.plist...
Making all for app Login...
 Creating Login.app/....
 Compiling file Controller.m ...
 Compiling file LoginWindow.m ...
 Compiling file UserSession.m ...
 Compiling file Login_main.m ...
 Linking app Login ...
 Creating Login.app/Resources...
 Creating stamp file...
 Creating Login.app/Resources/Info-gnustep.plist...
 Creating Login.app/Resources/Login.desktop...
 Copying resources into the app wrapper...
Making all in Workspace ...
Preparing WM...
-- The C compiler identification is Clang 13.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Looking for include file bsd/string.h
-- Looking for include file bsd/string.h - found
-- Looking for strlcat
-- Looking for strlcat - found
-- Looking for strlcpy
-- Looking for strlcpy - found
-- Looking for include file ctype.h
-- Looking for include file ctype.h - found
-- Looking for include file dlfcn.h
-- Looking for include file dlfcn.h - found
-- Looking for include file fcntl.h
-- Looking for include file fcntl.h - found
-- Looking for include file inttypes.h
-- Looking for include file inttypes.h - found
-- Looking for include file libintl.h
-- Looking for include file libintl.h - found
-- Looking for include file limits.h
-- Looking for include file limits.h - found
-- Looking for include file memory.h
-- Looking for include file memory.h - found
-- Looking for include file sys/inotify.h
-- Looking for include file sys/inotify.h - found
-- Looking for inotify_init
-- Looking for inotify_init - found
-- Looking for include file malloc.h
-- Looking for include file malloc.h - found
-- Looking for mallinfo
-- Looking for mallinfo - found
-- Looking for include file poll.h
-- Looking for include file poll.h - found
-- Looking for poll
-- Looking for poll - found
-- Looking for include file stdint.h
-- Looking for include file stdint.h - found
-- Looking for include file stdlib.h
-- Looking for include file stdlib.h - found
-- Looking for include file stdnoreturn.h
-- Looking for include file stdnoreturn.h - found
-- Looking for include file strings.h
-- Looking for include file strings.h - found
-- Looking for include file string.h
-- Looking for include file string.h - found
-- Looking for include file syslog.h
-- Looking for include file syslog.h - found
-- Looking for include file sys/ioctl.h
-- Looking for include file sys/ioctl.h - found
-- Looking for include file sys/stat.h
-- Looking for include file sys/stat.h - found
-- Looking for include file sys/wait.h
-- Looking for include file sys/wait.h - found
-- Looking for include file unistd.h
-- Looking for include file unistd.h - found
-- Looking for include file sys/types.h
-- Looking for include file sys/types.h - found
-- Looking for gethostname
-- Looking for gethostname - found
-- Looking for mkstemp
-- Looking for mkstemp - found
-- Looking for secure_getenv
-- Looking for secure_getenv - found
-- Looking for select
-- Looking for select - found
-- Looking for setsid
-- Looking for setsid - found
-- Looking for strcasecmp
-- Looking for strcasecmp - found
-- Looking for strncasecmp
-- Looking for strncasecmp - found
-- Looking for sysconf
-- Looking for sysconf - found
-- Looking for vprintf
-- Looking for vprintf - found
-- Looking for include file math.h
-- Looking for include file math.h - found
-- Looking for atan
-- Looking for atan - found
-- Looking for sqrt
-- Looking for sqrt - found
-- Looking for cosf
-- Looking for cosf - found
-- Looking for sinf
-- Looking for sinf - found
-- Looking for powf
-- Looking for powf - found
-- Looking for M_PI
-- Looking for M_PI - found
-- Looking for XConvertCase
-- Looking for XConvertCase - found
-- Looking for XInternAtoms
-- Looking for XInternAtoms - found
-- Looking for include file X11/extensions/shape.h
-- Looking for include file X11/extensions/shape.h - found
-- Looking for include file X11/extensions/Xrandr.h
-- Looking for include file X11/extensions/Xrandr.h - found
-- Looking for include file X11/XKBlib.h
-- Looking for include file X11/XKBlib.h - found
-- Configuring done (4.0s)
-- Generating done (0.0s)
-- Build files have been written to: /home/omershamai/nextspace/Applications/Workspace/WM/cmake
Making all in Viewers/BrowserViewer ...
Making all for bundle BrowserViewer...
 Creating BrowserViewer.viewer/....
 Compiling file BrowserViewerBrowser.m ...
 Compiling file BrowserViewer.m ...
 Linking bundle BrowserViewer ...
 Creating BrowserViewer.viewer/Resources...
 Copying localized resources into the bundle wrapper...
 Creating stamp file...
 Creating BrowserViewer.viewer/Resources/Info-gnustep.plist...
Making all in Viewers/IconViewer ...
Making all for bundle Icon...
 Creating Icon.viewer/....
 Compiling file IconViewer.m ...
 Linking bundle Icon ...
 Creating Icon.viewer/Resources...
 Creating stamp file...
 Creating Icon.viewer/Resources/Info-gnustep.plist...
Making all in Inspectors ...
Making all for bundle Inspectors...
 Creating Inspectors.bundle/....
 Compiling file Inspector.m ...
 Compiling file FileAttributesInspector.m ...
 Compiling file FileToolsInspector.m ...
 Compiling file FileAccessInspector.m ...
 Compiling file WMInspector.m ...
 Compiling file FileInspector.m ...
 Compiling file FolderInspector.m ...
 Compiling file AppInspector.m ...
 Compiling file ImageInspector.m ...
 Compiling file RTFInspector.m ...
 Compiling file WMPermissions.m ...
 Compiling file WMPopUp.m ...
 Linking bundle Inspectors ...
 Creating Inspectors.bundle/Resources...
 Copying localized resources into the bundle wrapper...
 Creating stamp file...
 Creating Inspectors.bundle/Resources/Info-gnustep.plist...
Making all in Tools/FileMover ...
Making all for tool FileMover.tool...
 Compiling file Copy.m ...
 Compiling file Delete.m ...
 Compiling file FileMover_main.m ...
 Compiling file Link.m ...
 Compiling file Move.m ...
 Compiling file NSStringAdditions.m ...
 Compiling file ../Communicator.m ...
 Linking tool FileMover.tool ...
Making all in Tools/Sizer ...
Making all for tool Sizer.tool...
 Compiling file Size.m ...
 Compiling file Sizer_main.m ...
 Compiling file ../Communicator.m ...
 Linking tool Sizer.tool ...
Making all in Preferences/Advanced ...
Making all for bundle Advanced...
 Creating Advanced.wsprefs/....
 Compiling file AdvancedPrefs.m ...
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:49:
In file included from ../../WM/core/log_utils.h:30:
/usr/NextSpace/include/CoreFoundation/CFLogUtilities.h:36:65: error: expected function body after function declarator
CF_EXPORT void CFLog(CFLogLevel level, CFStringRef format, ...) CF_NO_TAIL_CALL CF_FORMAT_FUNCTION(2, 3);
                                                                ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:16:1: error: unknown type name 'CF_IMPLICIT_BRIDGING_ENABLED'
CF_IMPLICIT_BRIDGING_ENABLED
^
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:19:20: error: expected ';' after top level declarator
typedef CFStringRef CFNotificationName CF_EXTENSIBLE_STRING_ENUM;
                   ^
                   ;
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:21:40: error: typedef redefinition with different types ('struct CF_BRIDGED_MUTABLE_TYPE' vs 'struct objc_object *')
typedef struct CF_BRIDGED_MUTABLE_TYPE(id) __CFNotificationCenter * CFNotificationCenterRef;
                                       ^
/usr/NextSpace/include/objc/runtime.h:93:4: note: previous definition is here
} *id;
   ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:21:43: error: expected ';' after top level declarator
typedef struct CF_BRIDGED_MUTABLE_TYPE(id) __CFNotificationCenter * CFNotificationCenterRef;
                                          ^
                                          ;
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:23:40: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFNotificationName name, const void *object, CFDictionaryRef userInfo);
                                       ^~~~~~~~~~~~~~~~~~~~~~~
                                       NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:23:64: error: interface type 'NSNotificationCenter' cannot be passed by value; did you forget * in 'NSNotificationCenter'?
typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFNotificationName name, const void *object, CFDictionaryRef userInfo);
                                                               ^
                                                              *
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:23:88: error: unknown type name 'CFNotificationName'; did you mean 'NSNotificationName'?
typedef void (*CFNotificationCallback)(CFNotificationCenterRef center, void *observer, CFNotificationName name, const void *object, CFDictionaryRef userInfo);
                                                                                       ^~~~~~~~~~~~~~~~~~
                                                                                       NSNotificationName
/Developer/Headers/Foundation/NSNotification.h:46:19: note: 'NSNotificationName' declared here
typedef NSString* NSNotificationName;
                  ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:38:11: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetLocalCenter(void);
          ^~~~~~~~~~~~~~~~~~~~~~~
          NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:38:11: error: interface type 'NSNotificationCenter' cannot be returned by value; did you forget * in 'NSNotificationCenter'?
CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetLocalCenter(void);
          ^
                                 *
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:44:11: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetDarwinNotifyCenter(void);
          ^~~~~~~~~~~~~~~~~~~~~~~
          NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:44:11: error: interface type 'NSNotificationCenter' cannot be returned by value; did you forget * in 'NSNotificationCenter'?
CF_EXPORT CFNotificationCenterRef CFNotificationCenterGetDarwinNotifyCenter(void);
          ^
                                 *
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:62:48: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterAddObserver(CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior);
                                               ^~~~~~~~~~~~~~~~~~~~~~~
                                               NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:62:72: error: interface type 'NSNotificationCenter' cannot be passed by value; did you forget * in 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterAddObserver(CFNotificationCenterRef center, const void *observer, CFNotificationCallback callBack, CFStringRef name, const void *object, CFNotificationSuspensionBehavior suspensionBehavior);
                                                                       ^
                                                                      *
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:64:51: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFNotificationName name, const void *object);
                                                  ^~~~~~~~~~~~~~~~~~~~~~~
                                                  NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:64:75: error: interface type 'NSNotificationCenter' cannot be passed by value; did you forget * in 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFNotificationName name, const void *object);
                                                                          ^
                                                                         *
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:64:105: error: unknown type name 'CFNotificationName'; did you mean 'NSNotificationName'?
CF_EXPORT void CFNotificationCenterRemoveObserver(CFNotificationCenterRef center, const void *observer, CFNotificationName name, const void *object);
                                                                                                        ^~~~~~~~~~~~~~~~~~
                                                                                                        NSNotificationName
/Developer/Headers/Foundation/NSNotification.h:46:19: note: 'NSNotificationName' declared here
typedef NSString* NSNotificationName;
                  ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:65:56: error: unknown type name 'CFNotificationCenterRef'; did you mean 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterRemoveEveryObserver(CFNotificationCenterRef center, const void *observer);
                                                       ^~~~~~~~~~~~~~~~~~~~~~~
                                                       NSNotificationCenter
/Developer/Headers/AppKit/NSWorkspace.h:46:8: note: 'NSNotificationCenter' declared here
@class NSNotificationCenter;
       ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:65:80: error: interface type 'NSNotificationCenter' cannot be passed by value; did you forget * in 'NSNotificationCenter'?
CF_EXPORT void CFNotificationCenterRemoveEveryObserver(CFNotificationCenterRef center, const void *observer);
                                                                               ^
                                                                              *
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
gmake[5]: *** [/Developer/Makefiles/rules.make:521: obj/Advanced.obj/AdvancedPrefs.m.o] Error 1
gmake[4]: *** [/Developer/Makefiles/Instance/bundle.make:193: internal-bundle-run-compile-submake] Error 2
gmake[3]: *** [/Developer/Makefiles/Master/rules.make:297: Advanced.all.bundle.variables] Error 2
gmake[2]: *** [/Developer/Makefiles/Master/bundle.make:37: internal-all] Error 2
gmake[1]: *** [/Developer/Makefiles/Master/serial-subdirectories.make:53: internal-all] Error 2
gmake: *** [/Developer/Makefiles/Master/serial-subdirectories.make:53: internal-all] Error 2

Looking at the logs, I suspect some sort of lexical issues with clang.

@trunkmaster
Copy link
Owner

This is really something very strange... Let's look at 2 first errors in your output:

In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:49:
In file included from ../../WM/core/log_utils.h:30:
/usr/NextSpace/include/CoreFoundation/CFLogUtilities.h:36:65: error: expected function body after function declarator
CF_EXPORT void CFLog(CFLogLevel level, CFStringRef format, ...) CF_NO_TAIL_CALL CF_FORMAT_FUNCTION(2, 3);
                                                                ^
In file included from AdvancedPrefs.m:24:
In file included from ../../Workspace+WM.h:51:
In file included from ../../WM/screen.h:26:
In file included from ../../WM/WM.h:31:
/usr/NextSpace/include/CoreFoundation/CFNotificationCenter.h:16:1: error: unknown type name 'CF_IMPLICIT_BRIDGING_ENABLED'
CF_IMPLICIT_BRIDGING_ENABLED

CF_NO_TAIL_CALL and CF_IMPLICIT_BRIDGING_ENABLED are defined in /usr/NextSpace/include/CoreFoundation/CFBase.h. It looks like it's not defined at all. But if you look into CFLogUtilities.h and CFNotificationCenter.h you'll see that #include <CoreFoundation/CFBase.h> is a first #include in both files.

Please check if you don't have some weird CFBase.h somewhere in compiler paths. You can get paths by inspecting gnustep-config --objc-flags. For me it's -I. -I/Users/me/Library/Headers -I/Developer/Headers -I/usr/NextSpace/include.

It would be ideal if you can make installation of NextSpace in clean Debian 12 system virtual machine to exclude some trails of various other experiments. Great plus if you experienced enough with Debian to make changes to scripts for successful building of project and create pull request(s).

Other but long way: I'll make tests and changes to Packaging/Sources files to achive automated successful build on Debian and you try it on your system. My current development platform is Fedora 35 so I need to get used to Debian and stop writing code.

What do you think?

@OmerFlame
Copy link
Author

Holy crap, I think it's the ObjC flags. It has a leftover path from an experiment completely unrelated to NextSpace.

I'll update you on the situation.

@OmerFlame
Copy link
Author

Alright, I am barring this option from being possible. The include paths that are being output are:

-I. -I/home/omershamai/Library/Headers -I/Developer/Headers -I/System/include

/System/include and /home/omershamai/Library/Headers don't exist, and /Developer/Headers exists but doesn't have a CFBase.h file. I also checked CFBase.h inside the NextSpace tree and the defines were definitely there. Something is SUPER weird here... I am thinking about moving to Fedora soon but I will try a clean Debian version beforehand. This will take me a while to do though, since I am not at home for the entire week.

@OmerFlame
Copy link
Author

I hardcoded the headers to replace /System/include with /usr/NextSpace/include. Still doesn't work, still gives me the same errors.

@OmerFlame
Copy link
Author

Never mind, /Developer/Headers had its own version of CoreFoundation installed in it for some reason, I deleted it and it compiles the applications successfully now!!!

@OmerFlame
Copy link
Author

How do I add NextSpace to the desktop environment list in the login dialog? I can't see it.

@OmerFlame
Copy link
Author

I have no xsession file!

@trunkmaster
Copy link
Owner

How do I add NextSpace to the desktop environment list in the login dialog? I can't see it.

NextSpace is implemented as a standalone DE with it's own login dialog. The reasons for this include ability to shutdown or restart OS as user (from Workspace). Enabling of NextSpace's login dialog is simple:

# systemctl enable /usr/NextSpace/Apps/Login.app/Resources/loginwindow.service

As a part of job it sets Login.app as a default login dialog (/etc/systemd/system/display-manager.service links to loginwindow.service).

@OmerFlame
Copy link
Author

Got the login manager to show up, logged in but the session finishes with an error. Looking at the logs, it's missing Helvetica-Medium. I looked at the font book and Helvetica was actually missing, so I installed it. After that, the same error message showed up in the logs... What should I do now?

@trunkmaster
Copy link
Owner

Missing font is not a reason for Workspace to crash. It's something else...
Check your defaults contents (~/Library/Preferences) and compare with /etc/skel/Library/Preferences. Ideally, you should start with copy of /etc/skel - you may create separate account for that and check if it works.

@trunkmaster
Copy link
Owner

@OmerFlame I've improved building from sources scripts. I've managed to build all project on Debian with clang 14.
In its current shape there is the setup_user_home.sh script that helps to copy essential files to your user home directory.

@OmerFlame
Copy link
Author

I'll test it today!

@alexmyczko
Copy link
Contributor

ok these are what i can install

$ apt-cache search clang++-1 | grep "1. -" |grep -v python
clang-11 - C, C++ and Objective-C compiler
clang-12 - C, C++ and Objective-C compiler
clang-13 - C, C++ and Objective-C compiler
clang-14 - C, C++ and Objective-C compiler
clang-15 - C, C++ and Objective-C compiler

so i did a master checkout, went to Packaging/Sources and run ./0_build_libdispatch.sh
resulting in an all red:

- Check for working CXX compiler: /usr/bin/clang++ - broken
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCXXCompiler.cmake:62 (message):
  The C++ compiler

    "/usr/bin/clang++"

  is not able to compile a simple test program.

@trunkmaster
Copy link
Owner

Show me your dpkg -l | grep clang and clang++ -v outputs.

@alexmyczko
Copy link
Contributor

# dpkg -l | grep clang
ii  clang                                     1:14.0-55~exp2                              amd64        C, C++ and Objective-C compiler (LLVM based), clang binary
ii  clang-14                                  1:14.0.0-1ubuntu1.1                         amd64        C, C++ and Objective-C compiler
ii  libclang-common-14-dev                    1:14.0.0-1ubuntu1.1                         amd64        Clang library - Common development package
ii  libclang-cpp14                            1:14.0.0-1ubuntu1.1                         amd64        C++ interface to the Clang library
ii  libclang1-14                              1:14.0.0-1ubuntu1.1                         amd64        C interface to the Clang library

# clang++ -v
Ubuntu clang version 14.0.0-1ubuntu1.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64

@trunkmaster
Copy link
Owner

trunkmaster commented Feb 3, 2024

Probably you don't have some components installed. Please check cmake log for any clues. I've build complete project on Debian 12 and Ubuntu 22.04. But I could miss something.

@trunkmaster
Copy link
Owner

@alexmyczko have you succeed with build? Any findings with compiler?

@alexmyczko
Copy link
Contributor

unfortunately no, and no idea what is wrong.

@trunkmaster
Copy link
Owner

trunkmaster commented Feb 10, 2024

Send me your BUILD_ROOT/swift-corelibs-libdispatch-swift-5.9.2-RELEASE/_build/CMakeFiles/CMakeConfigureLog.yaml inside Packaging/Sources directory.

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

3 participants