Opened 5 years ago

Last modified 13 months ago

#59219 assigned defect

fossil fails to build from source if ccache port installed

Reported by: ned-deily (Ned Deily) Owned by: ci42
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: chrstphrchvz (Christopher Chavez), bsdooby (Peter von Niederhäusern)
Port: fossil

Description

Title says it all. This appears to be a similar problem to #50891 (I also have not changed the default value of configureccache in macports.conf) with a likely similar solution. Note error:

ccache: error: Failed to create directory /macports/var/macports/build/.ccache/tmp: Operation not permitted

Workaround is to temporarily:

port deactivate ccache

tail of main.log:

:info:configure Build C compiler.../usr/bin/clang -arch x86_64
:info:configure Checking for stdlib.h...not found
:info:configure Error: Compiler does not work. See config.log
:info:configure Try: 'configure --help' for options
:info:configure Command failed:  cd "/macports/var/macports/build/_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fossil/fossil/work/fossil-2.9" && ./configure --prefix=/macports --with-tcl=/macports/lib --with-th1-docs --with-th1-hooks --with-exec-rel-paths --json
:info:configure Exit code: 1
:error:configure Failed to configure fossil, consult /macports/var/macports/build/_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fossil/fossil/work/fossil-2.9/config.log

Contents of config.log:

Invoked as: ./configure --prefix=/macports --with-tcl=/macports/lib --with-th1-docs --with-th1-hooks --with-exec-rel-paths --json
Failed: ccache /usr/bin/clang -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -arch x86_64 -c -g0 conftest__.c -o conftest__.o
ccache: error: Failed to create directory /macports/var/macports/build/.ccache/tmp: Operation not permitted
child process exited abnormally
============
The failed code was:
int main(void) {

return 0;
}
============
Failed: ccache /usr/bin/clang -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -arch x86_64 -c conftest__.c -o conftest__.o
ccache: error: Failed to create directory /macports/var/macports/build/.ccache/tmp: Operation not permitted
child process exited abnormally
============
The failed code was:
#include <stdlib.h>
int main(void) {

return 0;
}
============

Change History (11)

comment:1 Changed 5 years ago by jmroot (Joshua Root)

Cc: ci42 removed
Owner: set to ci42
Status: newassigned

comment:2 Changed 5 years ago by ra1nb0w

I am using ccache with macports and don't see this problem.
Check with https://github.com/macports/macports-ports/pull/5569

comment:3 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

I also have ccache and didn't observe this issue building fossil 2.10.1 (macOS 10.15.5, Xcode command line tools 11.5)

comment:4 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:5 Changed 4 years ago by ned-deily (Ned Deily)

FWiW, it still happens for me on a current 10.15.5 system with MacPorts 2.6.2 base. Note that I have MacPorts installed to a non-standard prefix so all ports are built from source.

# port uninstall fossil
--->  Deactivating fossil @2.10_0
--->  Cleaning fossil
--->  Uninstalling fossil @2.10_0
--->  Cleaning fossil
# port uninstall ccache
# port install ccache
--->  Computing dependencies for ccache
--->  Fetching distfiles for ccache
--->  Attempting to fetch ccache-3.7.9.tar.gz from https://distfiles.macports.org/ccache
--->  Verifying checksums for ccache
--->  Extracting ccache
--->  Configuring ccache
--->  Building ccache
--->  Staging ccache into destroot
--->  Installing ccache @3.7.9_0
--->  Activating ccache @3.7.9_0
--->  Cleaning ccache
--->  Scanning binaries for linking errors
--->  No broken files found.
--->  No broken ports found.
# port install fossil
--->  Computing dependencies for fossil
--->  Fetching distfiles for fossil
--->  Verifying checksums for fossil
--->  Extracting fossil
--->  Configuring fossil
Error: Failed to configure fossil, consult /opt/macports/var/macports/build/_opt_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fossil/fossil/work/fossil-2.10/config.log
Error: Failed to configure fossil: configure failure: command execution failed
Error: See /opt/macports/var/macports/logs/_opt_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fossil/fossil/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: Processing of port fossil failed
# tail /opt/macports/var/macports/logs/_opt_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fossil/fossil/main.log
:info:configure Try: 'configure --help' for options
:info:configure Command failed:  cd "/opt/macports/var/macports/build/_opt_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fossil/fossil/work/fossil-2.10" && ./configure --prefix=/opt/macports --with-tcl=/opt/macports/lib --with-th1-docs --with-th1-hooks --with-exec-rel-paths --json
:info:configure Exit code: 1
:error:configure Failed to configure fossil, consult /opt/macports/var/macports/build/_opt_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fossil/fossil/work/fossil-2.10/config.log
:error:configure Failed to configure fossil: configure failure: command execution failed
:debug:configure Error code: NONE
:debug:configure Backtrace: configure failure: command execution failed
:debug:configure     while executing
:debug:configure "$procedure $targetname"
:error:configure See /opt/macports/var/macports/logs/_opt_macports_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fossil/fossil/main.log for details.
# port uninstall ccache
--->  Deactivating ccache @3.7.9_0
--->  Cleaning ccache
--->  Uninstalling ccache @3.7.9_0
--->  Cleaning ccache
root@vana:~# port clean fossil
--->  Cleaning fossil
root@vana:~# port install fossil
--->  Computing dependencies for fossil
--->  Fetching distfiles for fossil
--->  Verifying checksums for fossil
--->  Extracting fossil
--->  Configuring fossil
--->  Building fossil
--->  Staging fossil into destroot
--->  Installing fossil @2.10_0
--->  Activating fossil @2.10_0
[...]

comment:6 Changed 4 years ago by kencu (Ken)

could be a permissions error as you're not using sudo and everyone else is.

ccache: error: Failed to create directory /macports/var/macports/build/.ccache/tmp: Operation not permitted

comment:7 Changed 4 years ago by ned-deily (Ned Deily)

Well. no, the "#" means I am already in root, i.e., I did:

$ sudo bash
# port ...

But to be clear, this is obviously a minor issue. I have a workaround. If other people aren't seeing it or can workaournd it, I would not be upset if you chose to close it. I was just trying to be a good citizen!

comment:8 Changed 4 years ago by kencu (Ken)

it's still a permissions error, for some reason...

comment:9 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

What permissions does /opt/local/var/macports/build/.ccache have on the reporter’s machine, i.e. what does ls -dl /opt/local/var/macports/build/.ccache output? On my machine it is:

% ls -dl /opt/local/var/macports/build/.ccache 
drwxr-xr-x  20 macports  wheel  640 Nov 16 03:10 /opt/local/var/macports/build/.ccache

comment:10 Changed 3 years ago by ned-deily (Ned Deily)

I no longer have ccache installed but, after installing the ccache port (from source - I note again that this installation uses a non-standard prefix so all ports are installed from source), there still is no .ccache directory in the build directory:

# ls -dl /opt/macports/var/macports/build/
drwxr-xr-x  2 root  admin  64 Nov 16 18:27 /opt/macports/var/macports/build/
# ls -dl /opt/macports/var/macports/build/.ccache
ls: /opt/macports/var/macports/build/.ccache: No such file or directory

and

port install fossil

still fails attempting to create /opt/macports/var/macports/build/tmp.

For grins, I tried a fresh MacPorts binary install into a vanilla 12.0.1 virtual machine using the downloaded MacPorts Monterey installer. After a selfupdate, I then did a port install ccache. FWIW, all of the ccache dependencies were binary downloads but the ccache port itself built from source. I verified then that there was no /opt/local/var/macports/build/.ccache. I then did port install fossil and, after installing tcl as a dependency, the fossil port proceeded to build from source and failed at exactly the same spot attempting to create ..ccache/tmp:

# more /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_fossil/fossil/work/fossil-2.15.2/config.log
Invoked as: ./configure --prefix=/opt/local --with-tcl=/opt/local/lib --with-th1-docs --with-th1-hooks --with-exec-rel-paths --json
Tclsh: /opt/local/bin/tclsh
Failed: ccache /usr/bin/clang -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -c -g0 conftest__.c -o conftest__.o
ccache: error: Failed to create directory /opt/local/var/macports/build/.ccache/tmp: Operation not permitted
child process exited abnormally
============
The failed code was:
int main(void) {

return 0;
}
============
Failed: ccache /usr/bin/clang -pipe -Os -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch x86_64 -c conftest__.c -o conftest__.o
ccache: error: Failed to create directory /opt/local/var/macports/build/.ccache/tmp: Operation not permitted
child process exited abnormally
============
The failed code was:
#include <stdlib.h>
int main(void) {

return 0;
}

============

So it is undoubtedly a permissions issue involving the macports username but it seems to be reproducible on a vanilla MacPorts installation at least if the ccache and fossil ports have to be built from source.

Version 1, edited 3 years ago by ned-deily (Ned Deily) (previous) (next) (diff)

comment:11 Changed 13 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: bsdooby added

Has duplicate #68547.

The original report said configureccache had not been changed from its default value of no in macports.conf. Does changing it to yes work around the issue?

Note: See TracTickets for help on using tickets.