Skip to content

MacOS Monterey deprecated vfork system call #34

Description

@tmcgilchrist

When compiling this package on Monterey 12.4:

spawn_stubs.c:491:33: warning: 'vfork' is deprecated: Use posix_spawn or fork [-Wdeprecated-declarations]
  ret = Bool_val(v_use_vfork) ? vfork() : fork();
                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/unistd.h:604:1: note: 'vfork' has been explicitly marked deprecated here
__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: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 warning generated.

then running the tests fails with an unrelated error, /usr/bin/sleep doesn't exist on Monterey.

$ dune build @runtest
File "test/tests.ml", line 147, characters 0-480: sigprocmask threw Unix.Unix_error(Unix.ENOENT, "execve", "/usr/bin/sleep").
  Raised by primitive operation at Spawn.spawn in file "src/spawn.ml" (inlined), line 162, characters 6-16
  Called from Spawn.spawn in file "src/spawn.ml", line 169, characters 2-87
  Called from Spawn_test__Tests.(fun).run in file "test/tests.ml", line 150, characters 16-81
  Called from Spawn_test__Tests.(fun) in file "test/tests.ml", line 157, characters 4-19

FAILED 1 / 9 tests

This package should update to use fork(2) or, ideally, posix_spawn(3) as suggested in man vfork 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions