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

[dbus] Build failure when cross-compiling #40031

Open
Tracked by #767 ...
davidebeatrici opened this issue Jul 22, 2024 · 5 comments · May be fixed by #40038
Open
Tracked by #767 ...

[dbus] Build failure when cross-compiling #40031

davidebeatrici opened this issue Jul 22, 2024 · 5 comments · May be fixed by #40038
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@davidebeatrici
Copy link
Contributor

davidebeatrici commented Jul 22, 2024

Editing the portfile to pass -DDBUS_SESSION_SOCKET_DIR=/tmp to CMake fixes the issue.

Operating system

macOS (ARM64)

Steps to reproduce the behavior

./vcpkg install dbus:x64-osx-release

Failure logs

CMake Error at CMakeLists.txt:574 (message):
  cannot autodetect session socket directory when crosscompiling, pass
  -DDBUS_SESSION_SOCKET_DIR=...


-- Configuring incomplete, errors occurred!
@davidebeatrici davidebeatrici added the category:port-bug The issue is with a library, which is something the port should already support label Jul 22, 2024
@davidebeatrici
Copy link
Contributor Author

Also, the upstream logic looks wrong to me:

https://gitlab.freedesktop.org/dbus/dbus/-/blob/68637759b916a9d6a824a01318a55a76f7f08ec7/CMakeLists.txt#L565-L582

#### Find socket directories
set(DBUS_SESSION_SOCKET_DIR "" CACHE STRING "Default directory for session socket")
if(UNIX)
    if (CMAKE_CROSSCOMPILING)
        if (NOT DBUS_SESSION_SOCKET_DIR)
            message(FATAL_ERROR "cannot autodetect session socket directory "
                    "when crosscompiling, pass -DDBUS_SESSION_SOCKET_DIR=...")
        endif()
    elseif(NOT $ENV{TMPDIR} STREQUAL "")
        set(DBUS_SESSION_SOCKET_DIR $ENV{TMPDIR})
    elseif(NOT $ENV{TEMP} STREQUAL "")
        set(DBUS_SESSION_SOCKET_DIR $ENV{TEMP})
    elseif(NOT $ENV{TMP} STREQUAL "")
        set(DBUS_SESSION_SOCKET_DIR $ENV{TMP})
    else()
        set(DBUS_SESSION_SOCKET_DIR /tmp)
    endif()
endif()

On macOS the TMPDIR environment variable's value appears to be a unique path that is generated for the current process. I believe DBUS_SESSION_SOCKET_DIR should be set to /tmp instead.

@dg0yt
Copy link
Contributor

dg0yt commented Jul 23, 2024

Editing the portfile to pass -DDBUS_SESSION_SOCKET_DIR=/tmp to CMake fixes the issue.

The actual value should depend on the target system.

the upstream logic looks wrong to me

Apart from the potential macOS issue, the given code hides the cache variable (aka input variable) for native builds by setting a normal variable.

@davidebeatrici
Copy link
Contributor Author

The actual value should depend on the target system.

I agree, that should (and probably can only be) done at runtime.

Apart from the potential macOS issue, the given code hides the cache variable (aka input variable) for native builds by setting a normal variable.

That too, good catch.

@bwrsandman
Copy link
Contributor

Seeing this also with dbus:x86-linux

@dg0yt
Copy link
Contributor

dg0yt commented Aug 4, 2024

Seeing this also with dbus:x86-linux

Well, it is cross compiling if you are on a x64 host.

bwrsandman added a commit to openblack/openblack that referenced this issue Aug 19, 2024
bwrsandman added a commit to openblack/openblack that referenced this issue Aug 19, 2024
Lgt2x added a commit to Lgt2x/Descent3 that referenced this issue Oct 27, 2024
Due to a bug in DBUS and its VCPKG port (microsoft/vcpkg#40031), DBUS cannot be cross-compiled.
Lgt2x added a commit to Lgt2x/Descent3 that referenced this issue Oct 27, 2024
Due to a bug in DBUS and its VCPKG port (microsoft/vcpkg#40031), DBUS cannot be cross-compiled.
Lgt2x added a commit to Lgt2x/Descent3 that referenced this issue Oct 27, 2024
Due to a bug in DBUS and its VCPKG port (microsoft/vcpkg#40031), DBUS cannot be cross-compiled.
Lgt2x added a commit to Lgt2x/Descent3 that referenced this issue Oct 29, 2024
Due to a bug in DBUS and its VCPKG port (microsoft/vcpkg#40031), DBUS cannot be cross-compiled.
Lgt2x added a commit to Lgt2x/Descent3 that referenced this issue Oct 29, 2024
Due to a bug in DBUS and its VCPKG port (microsoft/vcpkg#40031), DBUS cannot be cross-compiled.
Lgt2x added a commit to Lgt2x/Descent3 that referenced this issue Oct 29, 2024
Due to a bug in DBUS and its VCPKG port (microsoft/vcpkg#40031), DBUS cannot be cross-compiled.
daschuer added a commit to daschuer/vcpkg that referenced this issue Jan 16, 2025
daschuer added a commit to daschuer/vcpkg that referenced this issue Jan 17, 2025
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 a pull request may close this issue.

4 participants