Hi,

On 14/07/2025 10:43 am, Joshua Root wrote:
On 14/7/2025 19:22, Chris Jones via macports-dev wrote:
Hi,

On 14/07/2025 9:32 am, Sergey Fedorov wrote:
It is not a bug, but a feature? Workdirs are no longer named after ports, but start with a few letters of a ports name, followed by random characters.

Yes. <https://trac.macports.org/ticket/70539>

Yeah, I've noticed this and I have found it interferes with the use of ccache when building ports. I have enabled this for all my port builds, as I am often working on large ports (LLVM) and it *really* helps with rebuilds. However, this new feature seems to result in the build dir being different each rebuild, due to the random characters, and this of course renders the ccache invalid and useless.

Are we not setting CCACHE_BASEDIR?

I don't know this. All I know is this random path has pretty much rendered the use of the cache option in macports as broken.


How is this random string created, and why does it change whenever I make small portfile changes ?

<https://github.com/macports/macports-base/blob/v2.11.1/src/port1.0/ portutil.tcl#L1732>

Is there a way to disable this random string and go back to something similar to before, particularly when the use of ccache is enabled ?
The traditional work path still exists as a symlink to the shortened one.

Yes, but how then do we tell macports to use this when configuring the build? The problem is the new path with the random string finds its way into all the compilation options which is why cache is sensitive to it. e.g.

[4/5838] /opt/local/bin/ccache /usr/bin/clang++ -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/local/var/macports/build/rootHGGlRz/work/build/interpreter/llvm-project/llvm/lib/Demangle -I/opt/local/var/macports/build/rootHGGlRz/work/root-6-36-02/interpreter/llvm-project/llvm/lib/Demangle -I/opt/local/var/macports/build/rootHGGlRz/work/build/interpreter/llvm-project/llvm/include -I/opt/local/var/macports/build/rootHGGlRz/work/root-6-36-02/interpreter/llvm-project/llvm/include -pipe -I/opt/local/libexec/openssl3/include -Os -DNDEBUG -I/opt/local/libexec/openssl3/include -isystem/opt/local/include -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -Wc++11-narrowing -Wsign-compare -Wsometimes-uninitialized -Wconditional-uninitialized -Wheader-guard -Warray-bounds -Wcomment -Wtautological-compare -Wstrncat-size -Wloop-analysis -Wbool-conversion -m64 -pipe -W -Wall -Woverloaded-virtual -fsigned-char -fno-common -Qunused-arguments -pthread -stdlib=libc++ -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -w -fdiagnostics-color -O3 -DNDEBUG -std=c++17 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -mmacosx-version-min=15.0 -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -funwind-tables -MD -MT interpreter/llvm-project/llvm/lib/Demangle/CMakeFiles/LLVMDemangle.dir/MicrosoftDemangleNodes.cpp.o -MF interpreter/llvm-project/llvm/lib/Demangle/CMakeFiles/LLVMDemangle.dir/MicrosoftDemangleNodes.cpp.o.d -o interpreter/llvm-project/llvm/lib/Demangle/CMakeFiles/LLVMDemangle.dir/MicrosoftDemangleNodes.cpp.o -c /opt/local/var/macports/build/rootHGGlRz/work/root-6-36-02/interpreter/llvm-project/llvm/lib/Demangle/MicrosoftDemangleNodes.cpp

All the paths like /opt/local/var/macports/build/rootHGGlRz need to go back to something predictable and stable for each port build for the ccache option to be useful again.

Chris



- Josh

Reply via email to