Uploaded image for project: 'Swift'
  1. Swift
  2. SR-566

NSTask should forward a valid environment

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Foundation, llbuild
    • Labels:
      None
    • Environment:

      I've provided a portable Docker image to reproduce this issue.
      However the affected config is Linux/64 running swift-2.2-SNAPSHOT-2016-01-11-a

      Description

      ....this is an odd bug.

      swift-build-tool returns error code 127 when it happens to be invoked via NSTask.

      An identical invocation that isn't via NSTask works fine. ...I am as puzzled as you.

      To assist with reproducing this issue, I've created a portable Docker image that exactly matches my environment. Reproduction steps:

      1. Extract the files to some directory
      2. docker build .

      Expected results: Container builds
      Actual results: Docker container fails to build

      Essentially:

      1. The docker container tries to invoke launch.swift
      2. launch.swift creates an NSTask that calls swift-build-tool
      3. swift-build-tool returns error code 127 to launch.swift
      4. launch.swift hits fatalError codepath

      If you instead invoke swift-build-tool in exactly the same way without NSTask, everything's fine:

      RUN swift launch.swift #doesn't work
      # RUN swift-build-tool -f .atllbuild/llbuild.yaml #works fine
      

      Theories:

      1. Maybe corelibs-Foundation is doing something strange?
      2. could swift-build-tool be expecting a tty / stdin / stdout?

        Attachments

          Activity

            People

            • Assignee:
              phausler Philippe Hausler
              Reporter:
              drewcrawford Drew Crawford
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: