Opened 20 months ago

Last modified 9 months ago

#67125 assigned defect

ccache fails to build on 10.5

Reported by: rmottola (Riccardo) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: leopard Cc: mascguy (Christopher Nielsen), khepler
Port: ccache

Description

compilation with clang 7.0

Run Build Command(s):/usr/bin/make -f Makefile cmTC_b4223/fast && /usr/bin/make  -f CMakeFiles/cmTC_b4223.dir/build.make CMakeFiles/cmTC_b4223.dir/build
Building CXX object CMakeFiles/cmTC_b4223.dir/src.cxx.o
/opt/local/bin/clang++-mp-7.0 -Dstd_filesystem_without_libfs  -pipe -Os -DNDEBUG -isystem/opt/local/include/LegacySupport -I/opt/local/include -stdlib=macports-libstdc++ -D_GLIBCXX_USE_CXX11_ABI=0  -arch x86_64 -mmacosx-version-min=10.5 -std=c++17 -MD -MT CMakeFiles/cmTC_b4223.dir/src.cxx.o -MF CMakeFiles/cmTC_b4223.dir/src.cxx.o.d -o CMakeFiles/cmTC_b4223.dir/src.cxx.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_ccache/ccache/work/build/CMakeFiles/CMakeTmp/src.cxx
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_ccache/ccache/work/build/CMakeFiles/CMakeTmp/src.cxx:1:14: fatal error: 'filesystem' file not found
    #include <filesystem>
             ^~~~~~~~~~~~
1 error generated.

Attachments (1)

CMakeError.log (4.9 KB) - added by rmottola (Riccardo) 20 months ago.

Download all attachments as: .zip

Change History (14)

Changed 20 months ago by rmottola (Riccardo)

Attachment: CMakeError.log added

comment:1 Changed 20 months ago by rmottola (Riccardo)

Owner: set to michaelld
Status: newassigned

comment:2 Changed 20 months ago by kencu (Ken)

We haven't really crossed this bridge yet.

On 10.5 using macports-libstdc++ as you are, the headers and libraries are coming from libgcc. On 10.5, that is currently libgcc 7.

gcc7 did not have a full implementation of std_filesystem, although it apparently does exist in experimental:

https://stackoverflow.com/questions/45867379/why-does-gcc-not-seem-to-have-the-filesystem-standard-library

so if you changed the header to:

#include <experimental/filesystem>

and added the needed link library:

-lstdc++fs

you might likely find it works.

Once we (someone) gets around to doing a proper upgrade of the libgcc ports on 10.4/10.5 default to gcc12, then std_filesystem should just be found automatically I would hope.

comment:3 Changed 20 months ago by rmottola (Riccardo)

I am actually building with clang 7, but yes, the max gcc I have is 7... should I try building gcc8? from the post you cite it should fix stuff.

//C compiler
CMAKE_C_COMPILER:STRING=/opt/local/bin/clang-mp-7.0

I tried my luck by adding it here: CMAKE_EXE_LINKER_FLAGS:STRING=-Wl,-headerpad_max_install_names -L/opt/local/lib -lMacportsLegacySupport -lstdc++fs

But I couldn't get it to work, since what is broken is the cmake test itself and there I have little difference. The test is not friendly towards older systems :(

comment:4 Changed 19 months ago by rmottola (Riccardo)

All compilers beyond gcc7 are marked as "known to fail" do you agree?

comment:5 Changed 19 months ago by rmottola (Riccardo)

Do you know how to patch the cmake test, @kencu ? I know little about cmake.

comment:6 Changed 19 months ago by kencu (Ken)

I can look into this a bit later.

It's about time we did the work to get 10.4 and 10.5 to default to gcc12/libgcc12 and that would avoid all this too...

comment:7 Changed 18 months ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:8 Changed 16 months ago by khepler

Cc: khepler added

comment:9 in reply to:  6 Changed 16 months ago by mascguy (Christopher Nielsen)

Replying to kencu:

I can look into this a bit later.

It's about time we did the work to get 10.4 and 10.5 to default to gcc12/libgcc12 and that would avoid all this too...

While that would be great - and fully support it! - we can also potentially revert to an older ccache release for 10.5. (At least in the interim, until we have better support for 10.4/10.5.)

Ryan, is the latter idea something you'd support?

comment:10 Changed 14 months ago by rmottola (Riccardo)

Just tried updating now... and of course it fails

-- Performing Test std_filesystem_with_libfs - Failed
CMake Error at cmake/StdFilesystem.cmake:22 (message):
  Toolchain doesn't support std::filesystem with nor without -lstdc++fs
Call Stack (most recent call first):

however I also see lots of errors this time (I don't know if they happened last time) which look similar to what I got when building clang:

-- Found assembler: /opt/local/bin/clang-mp-7.0
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
sh: /bin/ps: Operation not permitted
-- The ASM_MASM compiler identification is unknown

comment:11 Changed 14 months ago by kencu (Ken)

This:

sh: /bin/ps: Operation not permitted

is considered to be a 'spurious' error that cmake puts forth, only on MacPorts I believe, when something -- almost anything -- goes wrong on some systems.

It has something to do with the way macports builds software with sandboxing, and only happens with cmake -- but that is all I know about it.

It's not a real error. The real error is presumably the fact that std::fllesystem support is not found.

comment:12 Changed 13 months ago by rmottola (Riccardo)

@kencu indeed, I have seen that error also in other ports, but then things work.

Ideas on how to unlock ccache? I don't know how to hack cmake to pass the test and thus try it. gcc8 to gcc12 are still marked as "known to fail". (Is it true? should I try?)

comment:13 Changed 9 months ago by rmottola (Riccardo)

Just as a reference, I went back versions until I found one which compiled: 4.6.3 I put that in my local tree.

Note: See TracTickets for help on using tickets.