Hi, Remove the pledge(2) interface (broken since OpenBSD-6.3).
If anybody wants to use pledge(2) and unveil(2) from Haskell, this should be done with a separate library on hackage.haskell.org. Nothing in the ports tree is using it. Ok? Index: Makefile =================================================================== RCS file: /cvs/ports/lang/ghc/Makefile,v retrieving revision 1.209 diff -u -p -r1.209 Makefile --- Makefile 8 Mar 2023 02:30:08 -0000 1.209 +++ Makefile 14 Mar 2023 06:53:07 -0000 @@ -12,6 +12,7 @@ NO_CCACHE = Yes USE_NOEXECONLY = Yes GHC_VERSION = 9.2.7 +REVISION = 0 DISTNAME = ghc-${GHC_VERSION} CATEGORIES = lang devel HOMEPAGE = https://www.haskell.org/ghc/ @@ -137,9 +138,6 @@ TEST_DEPENDS = print/ghostscript/gnu ${M post-extract: cd ${WRKSRC} && ${AUTOCONF_ENV} ./boot - cd ${WRKSRC}/libraries/unix && \ - mkdir -p System/OpenBSD && \ - install -m 644 ${FILESDIR}/Process.hsc System/OpenBSD BOOTSTRAP_SHLIBS = ${WRKDIR}/ghc-${BIN_VER}-shlibs-${MACHINE_ARCH} Index: files/Process.hsc =================================================================== RCS file: files/Process.hsc diff -N files/Process.hsc --- files/Process.hsc 24 Mar 2016 20:32:25 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,31 +0,0 @@ -{-# LANGUAGE Safe #-} - -module System.OpenBSD.Process ( pledge ) where - -import Foreign -import Foreign.C -import System.Posix.Internals ( withFilePath ) - --- | This function provides an interface to the OpenBSD --- <http://man.openbsd.org/OpenBSD-current/man2/pledge.2 pledge(2)> --- system call. --- --- Passing 'Nothing' to the promises or paths arguments has the same --- effect as passing NULL to the corresponding arguments of the system --- call (i.e. not changing the current value). -pledge :: Maybe String -> Maybe [FilePath] -> IO () - -pledge promises paths = - maybeWith withCString promises $ \cproms -> - maybeWith withPaths2Array0 paths $ \paths_arr -> - throwErrnoIfMinus1_ "pledge" (c_pledge cproms paths_arr) - -withPaths2Array0 :: [FilePath] -> (Ptr (Ptr CChar) -> IO a) -> IO a - -withPaths2Array0 paths f = - withMany withFilePath paths $ \cstrs -> - withArray0 nullPtr cstrs $ \paths_arr -> - f paths_arr - -foreign import ccall unsafe "unistd.h pledge" - c_pledge :: CString -> Ptr CString -> IO CInt Index: patches/patch-libraries_unix_unix_cabal =================================================================== RCS file: patches/patch-libraries_unix_unix_cabal diff -N patches/patch-libraries_unix_unix_cabal --- patches/patch-libraries_unix_unix_cabal 11 Mar 2022 19:29:00 -0000 1.5 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,11 +0,0 @@ ---- libraries/unix/unix.cabal.orig Thu Feb 4 17:16:38 2016 -+++ libraries/unix/unix.cabal Wed Nov 2 11:07:58 2016 -@@ -112,6 +112,8 @@ library - System.Posix.Terminal - System.Posix.Terminal.ByteString - -+ System.OpenBSD.Process -+ - other-modules: - System.Posix.Directory.Common - System.Posix.DynamicLinker.Common Index: pkg/PLIST =================================================================== RCS file: /cvs/ports/lang/ghc/pkg/PLIST,v retrieving revision 1.30 diff -u -p -r1.30 PLIST --- pkg/PLIST 8 Mar 2023 02:30:08 -0000 1.30 +++ pkg/PLIST 14 Mar 2023 06:53:07 -0000 @@ -5228,10 +5228,6 @@ lib/ghc/unix-${UNIX_VER}/ lib/ghc/unix-${UNIX_VER}/HSunix-${UNIX_VER}.o lib/ghc/unix-${UNIX_VER}/HSunix-${UNIX_VER}.p_o lib/ghc/unix-${UNIX_VER}/System/ -lib/ghc/unix-${UNIX_VER}/System/OpenBSD/ -lib/ghc/unix-${UNIX_VER}/System/OpenBSD/Process.dyn_hi -lib/ghc/unix-${UNIX_VER}/System/OpenBSD/Process.hi -lib/ghc/unix-${UNIX_VER}/System/OpenBSD/Process.p_hi lib/ghc/unix-${UNIX_VER}/System/Posix/ lib/ghc/unix-${UNIX_VER}/System/Posix.dyn_hi lib/ghc/unix-${UNIX_VER}/System/Posix.hi @@ -7756,7 +7752,6 @@ share/doc/ghc/html/libraries/transformer share/doc/ghc/html/libraries/transformers-${TRANSFORMERS_VER}/transformers.txt share/doc/ghc/html/libraries/unix-${UNIX_VER}/ share/doc/ghc/html/libraries/unix-${UNIX_VER}/LICENSE -share/doc/ghc/html/libraries/unix-${UNIX_VER}/System-OpenBSD-Process.html share/doc/ghc/html/libraries/unix-${UNIX_VER}/System-Posix-ByteString-FilePath.html share/doc/ghc/html/libraries/unix-${UNIX_VER}/System-Posix-ByteString.html share/doc/ghc/html/libraries/unix-${UNIX_VER}/System-Posix-Directory-ByteString.html