Skip to content

Deprecation errors compiling process on MacOS #261

Description

@newhoggy
$ autoreconf -i
$ cabal build all
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - process-1.6.15.0 (lib:process) (first run)
Configuring process-1.6.15.0...
configure: WARNING: unrecognized options: --with-compiler
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to enable C11 features... none needed
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for vfork.h... no
checking for pid_t... yes
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for signal.h... yes
checking for sys/wait.h... yes
checking for fcntl.h... yes
checking for setitimer... yes
checking for sysconf... yes
checking for execvpe... no
checking for spawn.h... yes
checking for posix_spawnp... yes
checking for posix_spawn_file_actions_addchdir... no
checking for /usr/bin/gcc options needed to detect all undeclared functions... none needed
checking whether POSIX_SPAWN_SETSID is declared... yes
checking whether POSIX_SPAWN_SETSID_NP is declared... no
checking whether POSIX_SPAWN_SETPGROUP is declared... yes
checking whether posix_spawn reports errors sensibly... yes
checking value of SIG_DFL... 0
checking value of SIG_IGN... 1
configure: creating ./config.status
config.status: creating include/HsProcessConfig.h
configure: WARNING: unrecognized options: --with-compiler
Preprocessing library for process-1.6.15.0..
Building library for process-1.6.15.0..
[1 of 5] Compiling System.Process.Common ( System/Process/Common.hs, /Users/jky/wrk/iohk/process/dist-newstyle/build/aarch64-osx/ghc-8.10.7/process-1.6.15.0/build/System/Process/Common.o, /Users/jky/wrk/iohk/process/dist-newstyle/build/aarch64-osx/ghc-8.10.7/process-1.6.15.0/build/System/Process/Common.dyn_o )
[2 of 5] Compiling System.Process.Posix ( System/Process/Posix.hs, /Users/jky/wrk/iohk/process/dist-newstyle/build/aarch64-osx/ghc-8.10.7/process-1.6.15.0/build/System/Process/Posix.o, /Users/jky/wrk/iohk/process/dist-newstyle/build/aarch64-osx/ghc-8.10.7/process-1.6.15.0/build/System/Process/Posix.dyn_o )
[3 of 5] Compiling System.Process.Internals ( System/Process/Internals.hs, /Users/jky/wrk/iohk/process/dist-newstyle/build/aarch64-osx/ghc-8.10.7/process-1.6.15.0/build/System/Process/Internals.o, /Users/jky/wrk/iohk/process/dist-newstyle/build/aarch64-osx/ghc-8.10.7/process-1.6.15.0/build/System/Process/Internals.dyn_o )
[4 of 5] Compiling System.Process   ( System/Process.hs, /Users/jky/wrk/iohk/process/dist-newstyle/build/aarch64-osx/ghc-8.10.7/process-1.6.15.0/build/System/Process.o, /Users/jky/wrk/iohk/process/dist-newstyle/build/aarch64-osx/ghc-8.10.7/process-1.6.15.0/build/System/Process.dyn_o )
[5 of 5] Compiling System.Cmd       ( System/Cmd.hs, /Users/jky/wrk/iohk/process/dist-newstyle/build/aarch64-osx/ghc-8.10.7/process-1.6.15.0/build/System/Cmd.o, /Users/jky/wrk/iohk/process/dist-newstyle/build/aarch64-osx/ghc-8.10.7/process-1.6.15.0/build/System/Cmd.dyn_o )

cbits/posix/fork_exec.c:148:15: error:
     warning: 'vfork' is deprecated: Use posix_spawn or fork [-Wdeprecated-declarations]
        int pid = myfork();
                  ^
    |
148 |     int pid = myfork();
    |               ^

cbits/posix/fork_exec.c:32:16: error:
     note: expanded from macro 'myfork'
   |
32 | #define myfork vfork
   |                ^
#define myfork vfork
               ^

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:604:1: error:
     note: 'vfork' has been explicitly marked deprecated here
    |
604 | __deprecated_msg("Use posix_spawn or fork")
    | ^
__deprecated_msg("Use posix_spawn or fork")
^

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:208:48: error:
     note: expanded from macro '__deprecated_msg'
            #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                          ^
    |
208 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
    |                                                ^
1 warning generated.

cbits/posix/fork_exec.c:148:15: error:
     warning: 'vfork' is deprecated: Use posix_spawn or fork [-Wdeprecated-declarations]
        int pid = myfork();
                  ^
    |
148 |     int pid = myfork();
    |               ^

cbits/posix/fork_exec.c:32:16: error:
     note: expanded from macro 'myfork'
   |
32 | #define myfork vfork
   |                ^
#define myfork vfork
               ^

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:604:1: error:
     note: 'vfork' has been explicitly marked deprecated here
    |
604 | __deprecated_msg("Use posix_spawn or fork")
    | ^
__deprecated_msg("Use posix_spawn or fork")
^

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/cdefs.h:208:48: error:
     note: expanded from macro '__deprecated_msg'
            #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                          ^
    |
208 |         #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
    |                                                ^
1 warning generated.

Activity

  1. newhoggy commented on Sep 15, 2022

    @newhoggy
    Author

    This also happens on process-1.6.15.0.

  2. newhoggy commented on Sep 15, 2022

    @newhoggy
    Author
    $ uname -a
    Darwin MacBook-Pro.local 21.6.0 Darwin Kernel Version 21.6.0: Wed Aug 10 14:28:23 PDT 2022; root:xnu-8020.141.5~2/RELEASE_ARM64_T6000 arm64
    
  3. snoyberg commented on Sep 16, 2022

    @snoyberg
    Collaborator

    Any thoughts on this @bgamari?

  4. bgamari commented on Mar 13, 2023

    @bgamari
    Contributor

    I suspect that the right approach here is to simply drop support for vfork. Afterall, it is quite a historical artifact, has quite ugly semantics,and consequently is indicated to be obsolete in POSIX.1-2001 and was removed entirely from POSIX.1-2008.

  5. added 2 commits that reference this issue on Mar 13, 2023
    13fe0b5
    203aa08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions