Skip to content

Figure out how to set the working directory for spawned processes on all platforms #1271

Closed
@ahoppen

Description

@ahoppen

Amazon Linux 2 and CentOS 7 have a glibc that doesn’t support posix_spawn_file_actions_addchdir_np and thus TSCBasic.Process can’t launch a process on these platforms with the working directory set. We currently fall back to launching the index tasks without a working directory on these platforms, which I think is fine because SwiftPM gives us compiler arguments with absolute paths. But we should figure something out.

Using Foundation.Process is not an option because it runs chdir on the current process for Posix platforms, which is racy if there are multiple subprocesses being spawned simultaneously. On Windows TSCBasic.Processs uses Foundation.Process and Foundation.Process properly set the working directory of the subprocesses on Windows, so Windows is not a problem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions