Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 914195 - dev-qt/qtbase-6.5.2-r2 : cmake fails because /tmp is a symlink
Summary: dev-qt/qtbase-6.5.2-r2 : cmake fails because /tmp is a symlink
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Qt Bug Alias
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-14 18:27 UTC by Thomas Capricelli
Modified: 2023-09-14 20:49 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Capricelli 2023-09-14 18:27:56 UTC
It fails early on:

CMake Error at CMakeLists.txt:58 (message):
  The path
  "/tmp/portage/dev-qt/qtbase-6.5.2-r2/work/qtbase-everywhere-src-6.5.2_build"
  contains symlinks.  This is not supported.  Possible solutions:

      - Map directories using a transparent mechanism such as mount --bind
      - Pass the real path of the build directory to CMake, e.g. using
        cd $(realpath <path>) before invoking cmake <source_dir>.
               
Call Stack (most recent call first):
  CMakeLists.txt:65 (qt_internal_check_if_path_has_symlinks)


Reproducible: Always





Indeed /tmp is a symlink (to var/tmp, on a real, spinning, disk, / is a ssd). This is a fairly common setup on lot of desktop/servers i administer. I never had any problem with this.

Does gentoo has a position on this ? I know about mount -bind, but that's more complicated because the link is not 'obvious' when using ls.
Comment 1 Ionen Wolkens gentoo-dev 2023-09-14 18:37:35 UTC
Wonder why it even pickups /tmp?

 * Source directory (CMAKE_USE_DIR): "/var/tmp/portage/dev-qt/qtbase-6.5.2-r2/work/qtbase-everywhere-src-6.5.2"
 * Build directory  (BUILD_DIR):     "/var/tmp/portage/dev-qt/qtbase-6.5.2-r2/work/qtbase-everywhere-src-6.5.2_build"

(note /var/tmp)

CMake Error at CMakeLists.txt:58 (message):
  The path
  "/tmp/portage/dev-qt/qtbase-6.5.2-r2/work/qtbase-everywhere-src-6.5.2_build"
Comment 2 Ionen Wolkens gentoo-dev 2023-09-14 18:46:45 UTC
aka I was about to say just don't use PORTAGE_TMPDIR=/tmp and use the real path, but then it seems there's some nonsense going on and I do assume you're using /var/tmp.
Comment 3 Thomas Capricelli 2023-09-14 18:49:42 UTC
ah, indeed, /var/tmp  is mentionned. I don't know then.

I can confirm i have PORTAGE_TMPDIR=/var/tmp in make.conf.
Comment 4 Thomas Capricelli 2023-09-14 18:56:41 UTC
the problem comes from ../work/qtbase-everywhere-src-6.5.2/CMakeLists.txt

And there, CMAKE_BINARY_DIR is indeed /tmp/ instead of /var/tmp.

But I dont know where this variable comes from, presumably from cmake... I don't know how to debug further.
Comment 5 Ionen Wolkens gentoo-dev 2023-09-14 19:16:44 UTC
Yeah, being picky about symlinks in the build dir does not seem so great on itself, but that is something else. Could possibly be a odd quirk in cmake itself, or at most the eclass (haven't had a close look).
Comment 6 Ionen Wolkens gentoo-dev 2023-09-14 19:23:46 UTC
It does work fine with e.g. PORTAGE_TMPDIR=/otherdir.

"Maybe" cmake is doing something strange like trying to shorten the path, aka it finds that /tmp/dir is the same inode as /var/tmp/dir or something, then strips /var

If so, then I don't really know what to do with this.
Comment 7 Ionen Wolkens gentoo-dev 2023-09-14 19:25:44 UTC
(In reply to Ionen Wolkens from comment #6)
> It does work fine with e.g. PORTAGE_TMPDIR=/otherdir.
> 
> "Maybe" cmake is doing something strange like trying to shorten the path,
> aka it finds that /tmp/dir is the same inode as /var/tmp/dir or something,
> then strips /var
> 
> If so, then I don't really know what to do with this.
(possibly intended to simplify e.g. /dir/dir/../../dir cases)
Comment 8 Ionen Wolkens gentoo-dev 2023-09-14 20:04:08 UTC
As far as qtbase goes, this was added by [1], not that the behaviour described in [2] should affect us.

There's a 2nd bug, but it's either restricted or deleted, so I don't know what it was about.

Either way, dropping the symlink check seems harmless so may just do that after a closer look.

If someone feels like convincing upstream that the check is not needed it'd be great, albeit ball risks being tossed around when it's partly caused by cmake passing a different path than the real symlink-less one we gave to it.

[1] https://github.com/qt/qtbase/commit/41aff1cd938457539fd6fd1009a3859de6b78095
[2] https://bugreports.qt.io/browse/QTBUG-89559
Comment 9 Larry the Git Cow gentoo-dev 2023-09-14 20:15:38 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d490887059ff73ebd7ad9d76348c001d02c5ef5

commit 4d490887059ff73ebd7ad9d76348c001d02c5ef5
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2023-09-14 20:08:52 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2023-09-14 20:14:09 +0000

    dev-qt/qtbase: skip build dir's symlink check
    
    Closes: https://bugs.gentoo.org/914195
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 dev-qt/qtbase/files/qtbase-6.5.2-no-symlink-check.patch | 5 +++++
 dev-qt/qtbase/qtbase-6.5.2-r2.ebuild                    | 1 +
 dev-qt/qtbase/qtbase-6.5.9999.ebuild                    | 4 ++++
 dev-qt/qtbase/qtbase-6.6.9999.ebuild                    | 4 ++++
 dev-qt/qtbase/qtbase-6.9999.ebuild                      | 4 ++++
 5 files changed, 18 insertions(+)
Comment 10 Thomas Capricelli 2023-09-14 20:49:57 UTC
I tried this last version and I can confirm it now works, thanks !