Created attachment 253035 [details] poudriere build failure log For some reason, CMakeTestCCompiler.cmake fails due to /nonexistent dir which obviously doesn't exists. This affects neovim only, ~600 other ports are building totally fine including those using CMake as well. loading initial cache file /wrkdirs/usr/ports/editors/neovim/work/.build/.deps/build/tmp/treesitter_query-cache-Release.cmake -- The C compiler identification is Clang 18.1.5 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - failed -- Check for working C compiler: /usr/local/libexec/ccache/cc -- Check for working C compiler: /usr/local/libexec/ccache/cc - broken CMake Error at /usr/local/share/cmake/Modules/CMakeTestCCompiler.cmake:67 (message): The C compiler "/usr/local/libexec/ccache/cc" is not able to compile a simple test program. It fails with the following output: Change Dir: '/wrkdirs/usr/ports/editors/neovim/work/.build/.deps/build/src/treesitter_query-build/CMakeFiles/CMakeScratch/TryCompile-jEIFhw' Run Build Command(s): /usr/local/bin/ninja -v cmTC_eb36d [1/2] /usr/local/libexec/ccache/cc -std=gnu99 -fPIE -MD -MT CMakeFiles/cmTC_eb36d.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_eb36d.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_eb36d.dir/testCCompiler.c.o -c /wrkdirs/usr/ports/editors/neovim/work/.build/.deps/build/src/treesitter_query-build/CMakeFiles/CMakeScratch/TryCompile-jEIFhw/testCCompiler.c FAILED: CMakeFiles/cmTC_eb36d.dir/testCCompiler.c.o /usr/local/libexec/ccache/cc -std=gnu99 -fPIE -MD -MT CMakeFiles/cmTC_eb36d.dir/testCCompiler.c.o -MF CMakeFiles/cmTC_eb36d.dir/testCCompiler.c.o.d -o CMakeFiles/cmTC_eb36d.dir/testCCompiler.c.o -c /wrkdirs/usr/ports/editors/neovim/work/.build/.deps/build/src/treesitter_query-build/CMakeFiles/CMakeScratch/TryCompile-jEIFhw/testCCompiler.c ccache: error: Failed to create directory /nonexistent/.ccache/tmp: Permission denied ninja: build stopped: subcommand failed. CMake will not be able to correctly generate this project. Call Stack (most recent call first): CMakeLists.txt:2 (project) -- Configuring incomplete, errors occurred! ninja: build stopped: subcommand failed. *** Error code 1 Stop. make: stopped in /usr/ports/editors/neovim
$ cat /usr/local/etc/poudriere.conf # ZPOOL=zroot BASEFS=/usr/local/poudriere BUILD_AS_NON_ROOT=yes CCACHE_DIR=/var/cache/ccache/poudriere/ CCACHE_DIR_NON_ROOT_SAFE=yes PORTBUILD_USER=pbuild PORTBUILD_UID=65529 PARALLEL_JOBS=2 PREPARE_PARALLEL_JOBS=6 #ALLOW_MAKE_JOBS=yes ALLOW_MAKE_JOBS_PACKAGES="pkg ccache gcc1* llvm1* node2* rust firefox libreoffice telegram-desktop" MUTUALLY_EXCLUSIVE_BUILD_PACKAGES="gcc1* llvm1* node2* rust firefox libreoffice telegram-desktop" DISTFILES_CACHE=/usr/ports/distfiles NOLINUX=yes USE_PROCFS=no USE_FDESCFS=no USE_TMPFS="data localbase wrkdir" $ ll -dn /var/cache/ccache/poudriere/ drwxr-xr-x 19 65529 0 20 Aug 21 14:45 /var/cache/ccache/poudriere/
that ccache: error: Failed to create directory /nonexistent/.ccache/tmp: Permission denied error means, that the buildsystem forgets CCACHE_DIR and HOME (set to somewhere inside workdir by the ports framework (I would argue it should get set to /nonexistent by the framework, to catch problems)) so ccache fallsback on its default location for the cache $HOME/.ccache and fails, as $HOME doesn't exists (which is good, because it identified a broken buildsystem)
Created attachment 253059 [details] v0 (apply via `git am`) This is an ugliest possible way to make it build. Also, pet portclippy/portfmt.
(In reply to Anton Saietskii from comment #3) That will make it build, but the problem is that it builds just fine with ccache as root. As someone who has to rebuild neovim frequently, dropping ccache is my very last resort. What I'm unclear on is whether the problem lies in neovim or in the ports framework.
(In reply to Adam Weinberger from comment #4) but does it really build fine or does it just appear to build fine, as the fallback ccache location /root/.ccache/ is writeable by root? As other ports pass along CCACH_DIR fine to the underlying buildsystem, it would be strange if the port is at fault here, but not impossible
(In reply to Adam Weinberger from comment #4) > What I'm unclear on is whether the problem lies in neovim or in the ports framework. neovim ofc. As I indicated in comment #1, considerable count of other ports builds fine with non-root ccache.
looking into the build log, it seems like that port builds some of its dependencies (like treesitter) itself and looses some variables there. Could these dependencies made into ports instead? The way neovim does it also violates the seperation into configure and build phase, as it uses cmake to configure these dependencies in the build phase instead of in the configure phase.
(In reply to Benjamin Takacs from comment #7) I just realized that your comment probably identified the actual problem. Could this be as simple as passing the correct CCACHE_DIR when building the tree-sitter parsers? And Benjamin: as it is written, it it supposed config the parsers during post-configure, and then build them in post-build. If cmake needs to be called differently, then please show me what it should do instead. There's no value to building them as a separate port. They are required for neovim, they must be built within the neovim source tree, and they require that neovim do-configure: is completed. Creating a separate port means needing to duplicate the same code into another port, and always keeping them 100% in sync.
Also: I'm fine with adding NO_CCACHE as long as it's behind an OPTION. But really this is a problem with neovim's cmake configuration, and it should be reported upstream.
(In reply to Adam Weinberger from comment #8) Looking at the port, yes that post-build target forgets to pass along variables, probably changing it to ${SETENVI} ${WRK_ENV} ${CONFIGURE_ENV} ${CMAKE_BIN} ${CMAKE_ARGS} --build ${BUILD_WRKSRC}/.deps should correct that mistake (inspired by Mk/Uses/cmake.mk)