# opam config report
# opam-version 2.5.2
# self-upgrade no
# system arch=arm64 os=macos os-distribution=homebrew os-version=26.5.2
# solver builtin-mccs+glpk
# install-criteria -removed,-count[avoid-version,changed],-count[version-lag,request],-count[version-lag,changed],-count[missing-depexts,changed],-changed
# upgrade-criteria -removed,-count[avoid-version,changed],-count[version-lag,solution],-count[missing-depexts,changed],-new
# jobs 9
# repositories 1 (http), 2 (version-controlled)
# current-switch none set
Description
With git config --global core.fsmonitor true, Git creates a Unix socket at .git/fsmonitor--daemon.ipc. Commands that copy a repository root (notably opam repository set-url) then fail:
Fatal error: Copying sockets (.../.opam/repo/default/.git/fsmonitor--daemon.ipc) is unsupported
or, during the subsequent update:
[ERROR] Could not update repository "default": Copying sockets (.../.opam/repo/default/.git/fsmonitor--daemon.ipc) is unsupported
Reproducer
git config --global core.fsmonitor true
- Ensure the default repository is a git clone under
~/.opam/repo/default (or run any git command there so the fsmonitor daemon starts).
opam repository set-url default git+https://github.com/ocaml/opam-repository.git
Notes
OpamSystem.copy_dir raises on Unix.S_SOCK (src/core/opamSystem.ml).
- On 2.5.2 this hits the backup
copy_dir in repository set-url, and again the quarantine copy_dir in the VCS first-init path (OpamFilename.copy_dir of repo → repo.new after git fetch, which itself creates the socket when fsmonitor is enabled).
- Master isolates git via
GIT_CONFIG_GLOBAL/GIT_CONFIG_SYSTEM (2b1536a9a), which avoids creating the socket during opam's own git calls, but an already-present socket (or one created by an external git in that tree) still breaks any full directory copy.
Workaround
git -C ~/.opam/repo/default fsmonitor--daemon stop
rm -f ~/.opam/repo/default/.git/fsmonitor--daemon.ipc
# temporarily:
git config --global core.fsmonitor false
A robust fix would likely skip uncopyable runtime artefacts such as sockets in copy_dir (or stop/remove the fsmonitor daemon before copying .git).
Description
With
git config --global core.fsmonitor true, Git creates a Unix socket at.git/fsmonitor--daemon.ipc. Commands that copy a repository root (notablyopam repository set-url) then fail:or, during the subsequent update:
Reproducer
git config --global core.fsmonitor true~/.opam/repo/default(or run anygitcommand there so the fsmonitor daemon starts).opam repository set-url default git+https://github.com/ocaml/opam-repository.gitNotes
OpamSystem.copy_dirraises onUnix.S_SOCK(src/core/opamSystem.ml).copy_dirinrepository set-url, and again the quarantinecopy_dirin the VCS first-init path (OpamFilename.copy_dirofrepo→repo.newaftergit fetch, which itself creates the socket when fsmonitor is enabled).GIT_CONFIG_GLOBAL/GIT_CONFIG_SYSTEM(2b1536a9a), which avoids creating the socket during opam's own git calls, but an already-present socket (or one created by an externalgitin that tree) still breaks any full directory copy.Workaround
A robust fix would likely skip uncopyable runtime artefacts such as sockets in
copy_dir(or stop/remove the fsmonitor daemon before copying.git).