xtendo-org / rawfilepath

Haskell library for encoding-free interaction with Unix system. Use RawFilePath (ByteString) instead of FilePath (String)
Other
17 stars 3 forks source link

Build fails on macOS with GHC 9.6 (`unix-2.8`) #13

Open cho-m opened 2 months ago

cho-m commented 2 months ago

When building rawfilepath (as dependency of cgrep) on macOS using GHC 9.6.6 and Cabal 3.12.1.0, I see the following failure:

cbits/runProcess.c:252:13: error:
     error: call to undeclared function 'execvpe'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
                execvpe(args[0], args, environment);
                ^
    |
252 |             execvpe(args[0], args, environment);
    |             ^
1 error generated.
`clang' failed in phase `C Compiler'. (Exit code: 1)
Error: [Cabal-7125]
Failed to build rawfilepath-1.1.1 (which is required by exe:cgrep from cgrep-8.1.1). See the build log above for details.

It seems like execvpe doesn't exist in system libraries on macOS (and probably most BSD platforms) as mentioned at https://www.gnu.org/software/gnulib/manual/html_node/execvpe.html

The error may be due to the removal of execvpe workaround in unix-2.8 from execvpe.h (https://github.com/haskell/unix/commit/b8eb2486b15d564e73ef9307e175ac24a186acd2), in which case build may only succeed on platforms that have execvpe.

xtendo-org commented 2 days ago

Oops sorry to notice this late. Let me have a look when I get the chance to use a macOS-running machine.