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

swift build ignores -Xswiftc -Ounchecked (and other options)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Done
    • Component/s: Package Manager
    • Labels:
    • Environment:

      $ swift --version
      Apple Swift version 4.0 (swiftlang-900.0.65 clang-900.0.37)
      Target: x86_64-apple-macosx10.9

       

      MacBook Pro (Retina, 15-inch, Late 2013) running macOS 10.13

       

      Description

      What it does:

      Issuing the command swift build -c release -Ounchecked does not result in a build with runtime safety checks removed.

      According to BuildPlan.swift, the default optimization arguments for the build configuration (either -Onone -g -enable-testing for debug builds or -O for release builds) always come after the options specified on the command-line, causing the developer-specified options for optimizations to be overridden.

      In addition, -j<threads> is also overridden as well as others.

      What it should do:

      According to the swift build --help the option -Xswiftc is documented as Pass flag through to all Swift compiler invocations. As no exceptions are specified, it is assumed that all options are passed through, including those for optimizations.

      Ideally, the developer-specified command-line options last on the command line to avoid confusion. If this is not possible for all options, then a warning should be presented to inform the developer that their option has been overridden.

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            nettlep Paul Nettle
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: