Le 2025-06-23 13:50, Jochen Sprickerhof a écrit :
* picca <[email protected]> [2025-06-23 11:22]:
git clone https://salsa.debian.org/picca/pkg-haskell-tools
to reproduce the issue
create a p directory in the repository
cd pkg-haskell-tools
mkdir p
cd p && apt source ufo-core
cd ..
cabal run make-all -- --unshare
Thanks, I was able to reproduce this after
apt build-dep pkg-haskell-tools
and installing some more packages.
The problem is that make-all leaks file descriptors:
$ ls -l /proc/423642/fd/
lr-x------ 1 jspricke jspricke 64 23. Jun 13:30 0 -> 'pipe:[412637]'
l-wx------ 1 jspricke jspricke 64 23. Jun 13:30 1 -> 'pipe:[418570]'
l-wx------ 1 jspricke jspricke 64 23. Jun 13:30 2 -> 'pipe:[418556]'
lr-x------ 1 jspricke jspricke 64 23. Jun 13:30 3 ->
/usr/bin/mmdebstrap
lrwx------ 1 jspricke jspricke 64 23. Jun 13:30 4 ->
/home/jspricke/pkg-haskell-tools/lab/.shake/.shake.lock
lrwx------ 1 jspricke jspricke 64 23. Jun 13:30 5 ->
/home/jspricke/pkg-haskell-tools/lab/.shake/.shake.database
lr-x------ 1 jspricke jspricke 64 23. Jun 13:30 6 ->
/home/jspricke/pkg-haskell-tools/lab/cache/binaries/ufo-core.txt
Which one is the one leaking ?
I guess you want to set close_fds here:
https://hackage.haskell.org/package/process-1.0.1.1/docs/System-Process.html#t%3ACreateProcess
I can confirm that adding
Exit c ← cmdWrap "sbuild" $ cmd
(Cwd targetDir)
(EchoStdout False)
+ (CloseFileHandles) $
["sbuild"
--, "-c", schrootName
--, "-c", "unstable-amd64"
, "-A"
, "--no-apt-update"
, "--dist", dist
--, "--chroot-setup-commands=bash " ++
cfixup
, "--extra-repository=deb
http://deb.debian.org/debian unstable main contrib non-free
non-free-firmware"
, "--extra-repository=deb [trusted=yes]
file://" ++ crepoDir ++ " ./"
, dsc
] ++ sbuildArgs
make it works...
Now my question why is it necessary ?
$unshare_bind_mounts = [ { directory => "/dev/shm", mountpoint =>
"/sharedshm" } ];
Can you give some reasoning why you want to do that?
the current code of dht (with the schroot) create a fix script 'cfixup'
on the host and a repository.
fixupScript ∷ [String] → String
fixupScript pkgs = unlines $
[ "#!/bin/bash"
-- I disable locking in the schroot. I have /var/cache/apt/archives
bind-mounted
-- via /etc/schroot/default/fstab, so with locking, I could not run
-- multiple sbuilds at the same time
, "echo 'Debug::NoLocking \"true\";' >
/etc/apt/apt.conf.d/no-locking"
] ++ ignoreArchiveDepends pkgs
ignoreArchiveDepends ∷ [String] → [String]
ignoreArchiveDepends [] = []
ignoreArchiveDepends pkgs =
[ "#!/bin/bash"
, "apt-get install dctrl-tools" -- Just in case it is not installed
in the base schroot
, "for f in /var/lib/apt/lists/*_Packages"
, "do"
, "grep-dctrl -v -F Package -X \\( " ++ disj ++ " \\) < \"$f\" >
\"$f\".tmp"
, "mv \"$f\".tmp \"$f\""
, "done"
]
where disj = intercalate " -o " pkgs
I am not sure if this is relevant with unshare...
I try for now to reproduce schroot with unsahre...
Fred