profile
viewpoint
Owen Voorhees owenv owenvoorhees.com Software Engineer at Fieldwire, Swift compiler contributor

apple/swift 53938

The Swift Programming Language

apple/swift-driver 457

Swift compiler driver reimplementation in Swift

owenv/OVGraphView 6

An Objective-C class that makes it easy to display data as a line graph on iOS

owenv/swift-doc 6

Experimental Swift tool for doc generation via symbol graph dumps

owenv/NSString-OVSSTimeAdditions 2

A category on NSString to properly format a duration in hours, minutes, and seconds.

owenv/NSDate-OVSSConditionalDaysAdditions 1

A category on NSDate that calculates dates that might not be constant, like the beginning of the current week, mont, or year.

owenv/pop 0

Extensible iOS and OS X animation library.

owenv/sourcekit-lsp 0

Language Server Protocol implementation for Swift and C-based languages

pull request commentapple/swift

Support -print-target-info in fake frontends used by incremental dependency tests

@swift-ci please test

owenv

comment created time in 2 hours

pull request commentapple/swift

Support -print-target-info in fake frontends used by incremental dependency tests

@swift-ci python lint

owenv

comment created time in 2 hours

push eventowenv/swift

Owen Voorhees

commit sha 7f399c02a145459b5a8798aadfdeb8d913034931

Support -print-target-info in fake frontends used by incremental dependency tests Forward these invocations to the real driver instead. This is necesary to run these tests with swift-driver

view details

push time in 2 hours

pull request commentapple/swift-driver

Include prefix args from -driver-use-frontend-path in -print-target-info jobs

@swift-ci please test

owenv

comment created time in 4 hours

PR opened apple/swift-driver

Reviewers
Include prefix args from -driver-use-frontend-path in -print-target-info jobs

This, along with https://github.com/apple/swift/pull/34405 will let us see real failures in the incremental dependency lit tests. Without these changes, nearly all the tests fail immediately because they rely on fake frontends and the -print-target-info decoding fails.

+9 -5

0 comment

3 changed files

pr created time in 4 hours

push eventowenv/swift-driver

Owen Voorhees

commit sha 63149710527522117daf2dfc5f440f7812bd5d25

Include prefix args from -driver-use-frontend-path in -print-target-info jobs

view details

push time in 4 hours

pull request commentapple/swift

Support -print-target-info in fake frontends used by incremental dependency tests

@swift-ci please test

owenv

comment created time in 4 hours

PR opened apple/swift

Reviewers
Support -print-target-info in fake frontends used by incremental dependency tests

Forward these invocations to the real driver instead, so that we can run these tests with the new driver (otherwise nearly all the tests fail immediately because the driver can't decode the target info).

+41 -0

0 comment

6 changed files

pr created time in 4 hours

create barnchowenv/swift-driver

branch : prefix-args

created branch time in 4 hours

create barnchowenv/swift

branch : fake-frontend-target-info

created branch time in 4 hours

PullRequestReviewEvent

pull request commentapple/swift-package-manager

Sync the latest TSC changes to SPM's vendored copy

Sounds good 👍

owenv

comment created time in 2 days

Pull request review commentapple/swift

[Diag] Print the diagnostic ID name from localization

 bool SerializedLocalizationWriter::emit(llvm::StringRef filePath) {   return OS.has_error(); } +llvm::StringRef+LocalizationProducer::getMessageOr(swift::DiagID id,+                                   llvm::StringRef defaultMessage) const {+  auto localizedMessage = getMessage(id);+  if (localizedMessage.empty())+    return defaultMessage;+  llvm::StringRef diagnosticName(diagnosticNameStrings[(unsigned)id]);+  const std::string &localizedDebugDiagnosticMessage =+      localizedMessage.str() + diagnosticName.str();

I haven't written much c++ in the last few weeks, but I think returning a reference to this temporary will result in a use-after-free. Since this concatenation of the message and name isn't a constant string, we might need to hold onto it somewhere in the diagnostics pipeline until it's emitted

HassanElDesouky

comment created time in 2 days

Pull request review commentapple/swift

[Diag] Print the diagnostic ID name from localization

 enum LocalDiagID : uint32_t {   NumDiags }; +static constexpr const char *const diagnosticNameStrings[] = {+#define ERROR(ID, Options, Text, Signature) " [" #ID "]",+#define WARNING(ID, Options, Text, Signature) " [" #ID "]",+#define NOTE(ID, Options, Text, Signature) " [" #ID "]",+#define REMARK(ID, Options, Text, Signature) " [" #ID "]",

nit: You can shorten this to one line: #define DIAG(KIND, ID, Options, Text, Signature) " [" #ID "]",

HassanElDesouky

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentapple/swift-package-manager

Sync the latest TSC changes to SPM's vendored copy

@swift-ci please smoke test

owenv

comment created time in 2 days

push eventowenv/swift-package-manager

Owen Voorhees

commit sha 2896927ed36eec963f02c4d613c0c8f175a02a5d

Sync the latest TSC changes to SPM's vendored copy

view details

push time in 2 days

pull request commentapple/swift-package-manager

Sync the latest TSC changes to SPM's vendored copy

@swift-ci please smoke test

owenv

comment created time in 2 days

pull request commentapple/swift-driver

Update SourceFileDependencyGraph deserialzation

This should pass tests now, but I need to sync TSC changes to the vendor copy in SPM before merging

@swift-ci please test

owenv

comment created time in 2 days

create barnchowenv/swift-package-manager

branch : tsc-sync

created branch time in 2 days

push eventowenv/swift-driver

Owen Voorhees

commit sha 8ac8ed5caec31b3eabc824df49adcdb23c59bb0d

Pass -index-file-path as a primary file input

view details

Owen Voorhees

commit sha 7e5a68b9b51bcde5b59bdf8e7134bc3a548b1ef8

Remove the fileSystem in ExplicitModuleBuildHandler Instead, this commit introduces a new VirtualPath case, temporaryFileWithKnownContents. This allows the ExplicitModuleBuildHandler to indirectly delegate writing artifact info temporary files to the ArgsResolver.

view details

Artem Chikin

commit sha fb428e201a22615cc25df61043ea2489b62919d1

[Build Script Helper] Make the 'build' action use the CMake build flow This allows us to decouple building swift-driver inside `swift`'s `build-script` without depending on SwiftPM. Note, this applies to both Darwin and Linux platforms.

view details

Artem Chikin

commit sha d6068191bc57c98b2f0ccf3206f9fb8f93686b91

[Build Script Helper] Pass Foundation and Dispatch build directories to Yams CMake Linux build

view details

Artem Chikin

commit sha adc732c4558766bcb9988dc8606a13c6cb2066a6

Remove extra option to print explicit dependency build jobs. Just using `-driver-print-jobs` is fine.

view details

Artem Chikin

commit sha 438a5e0a740fcea87f4af43fcde13aa0c6b2fb41

Merge pull request #291 from artemcm/CMakeBuild [Build Script Helper] Make the 'build' action use the CMake build flow

view details

Xi Ge

commit sha 1e3f8f4ba55faa503c88ff74ecf8d4463995fe01

Implement -driver-print-actions for testing purposes The C++ driver uses -driver-print-actions in several tests. We should implement the same action in the Swift driver so we can run the compiler-side tests by using the Swift driver. Printing the exactly same results is difficult but they should be semantically equivalent.

view details

Xi Ge

commit sha a50b8a8cb33e8a2dea94630d9d5e60e9cb380b7b

Merge pull request #295 from nkcsgexi/implement-driverPrintActions Implement -driver-print-actions for testing purposes

view details

Xi Ge

commit sha 337ddf4b42f2f32b30c312b9b10c173e47f9acc1

Don't complain about '-sanitize=' unsupported if not given at all for the freebsd target

view details

David Ungar

commit sha 9c66cc8e0f76bf757374e5b46cb2cb9bf9883830

add primaryInputs to jobs

view details

Xi Ge

commit sha 095937cb90b728ab122b8bac236f6d740327c701

Merge pull request #296 from nkcsgexi/sanitizer-flag-parse Don't complain about '-sanitize=' unsupported if not given at all for the freebsd target

view details

David Ungar

commit sha 5ae9bd879afd319d8714f1a7d0908e2d06af9bf8

Merge pull request #297 from davidungar/incremental-10-9b Add a `primaryInputs` field to `Job` which will be needed for incremental compilation.

view details

David Ungar

commit sha 9bc4730afb768b58e4e45630bbcdf6b78c581b32

write build record

view details

David Ungar

commit sha 8ac661a1b886599775416f47becd028d0718bab3

First cut at a test

view details

David Ungar

commit sha 07b2b171e9def074507a640ce3da466d3be84574

Fixed up test

view details

Saleem Abdulrasool

commit sha e853be1e216448db61001a596741676908ae84e4

SwiftDriver: repair the build on non-Darwin after #295 `uint` is a typedef that is made available on Darwin targets. The Swift spelling for this type is `UInt`. Adjust it to repair the build on Windows.

view details

Owen Voorhees

commit sha 2e57d7e812b294cff5ef1a53f36ba92421944ca5

Merge pull request #286 from owenv/index-file Pass -index-file-path as a primary file input

view details

Owen Voorhees

commit sha 4a01f8f067648a2ecdbe7483a945773c86e24184

Merge pull request #300 from compnerd/uint SwiftDriver: repair the build on non-Darwin after #295

view details

Owen Voorhees

commit sha fdd6f994f62124de6b55c2ee04776aa533d94a97

Return the compiler resource directory as a VirtualPath and fixup clients

view details

Owen Voorhees

commit sha 63c8282e25d711182f8b16f38b8bf62d6f641c44

Merge pull request #301 from owenv/virtual-resource-dir Return the compiler resource directory as a VirtualPath and fixup clients

view details

push time in 2 days

pull request commentapple/swift-tools-support-core

Introduce a new visitor-based API for reading LLVM bitstreams

@swift-ci please test

owenv

comment created time in 3 days

pull request commentapple/swift-tools-support-core

Introduce a new visitor-based API for reading LLVM bitstreams

Since the types related to the bitstream container format are now public types, as of this PR, I wonder if it would be worth also including a doc comment with the URL https://llvm.org/docs/BitCodeFormat.html#bitstream-container-format (or wherever the official version is). It might help people looking at this for the first time understand the structure.

Good suggestion, I linked the reference and added a few more doc comments to some of the public members. I'd appreciate it if you could merge this (assuming tests still pass). Thanks!

owenv

comment created time in 3 days

push eventowenv/swift-tools-support-core

Owen Voorhees

commit sha d8d46f3b5a758852fc35137e58db1c7b539677e0

Document some of the new public bitstream APIs

view details

push time in 3 days

push eventapple/swift-driver

Owen Voorhees

commit sha 7a502fd55b910c91182bfd63642effa20e24090a

Emit warning when -dump-ast overrides -wmo or -index-file

view details

Owen Voorhees

commit sha 223549bac9d72c9837ef9ba9df3490a3d076fdea

Merge pull request #316 from owenv/dump-ast-override -dump-ast overrides -wmo and -index-file

view details

push time in 4 days

PR merged apple/swift-driver

-dump-ast overrides -wmo and -index-file

This fixes the Driver/ast_dump_with_WMO.swift test, and expands the override to cover -index-file as well based on a FIXME in the C++ source. If both are specified, a warning is emitted: ignoring '-wmo' because '-dump-ast' was also specified

+55 -0

1 comment

3 changed files

owenv

pr closed time in 4 days

pull request commentapple/swift-driver

-dump-ast overrides -wmo and -index-file

@swift-ci please test

owenv

comment created time in 4 days

PullRequestReviewEvent

Pull request review commentapple/swift-driver

Properly set up jobs when -lto is set

 extension Driver {       return (linkerOutputType == nil)     case .swiftModule:       return compilerMode.isSingleCompilation && moduleOutputInfo.output?.isTopLevel ?? false-    case .llvmBitcode:-      return compilerOutputType == type

Looks good to me, thanks!

nkcsgexi

comment created time in 4 days

PullRequestReviewEvent

push eventapple/swift-driver

Owen Voorhees

commit sha ae9e0ed3a1fb86c2c352b0c69c55d8db0fea2620

Add initial WebAssembly toolchain implementation

view details

Owen Voorhees

commit sha 6dc8b169755ffb9ad7cac915d79131b103868a48

Merge pull request #315 from owenv/webassembly Add initial WebAssembly toolchain implementation

view details

push time in 5 days

PR merged apple/swift-driver

Reviewers
Add initial WebAssembly toolchain implementation

This is an initial implementation of a WebAssembly toolchain. It shares a lot of similarities with the GenericUnixToolchain, but it doesn't support dynamic libraries and other features like sanitizers, profiling, etc. Overall, there are enough differences that trying to subclass GenericUnixToolchain seemed potentially error-prone.

The functionality in this PR goes a bit beyond the current Wasm support in the main Swift repo. I tested this change by installing swift-driver into a toolchain snapshot from the SwiftWasm fork and then verifying I could compile a basic working program.

+414 -17

5 comments

8 changed files

owenv

pr closed time in 5 days

pull request commentapple/swift-driver

Add initial WebAssembly toolchain implementation

The latest push fixes a small merge conflict, but otherwise there aren't any changes

@swift-ci please test

owenv

comment created time in 5 days

push eventowenv/swift-driver

David Ungar

commit sha 25e4b14587a01bc9f84510e178d7896b91aea8e8

show job lifecycle etc

view details

David Ungar

commit sha aab6ab011824f2fbbce52ed31cc7fd6b36079ba5

added simple test

view details

David Ungar

commit sha da72836c59a26d6e924bec2fccd3689984ca70f2

refine tests

view details

David Ungar

commit sha fbd3e4f629718b80b7bfa95640a6a06f0c810c60

Handle autolink-extracting platforms

view details

Saleem Abdulrasool

commit sha c237311a9a99ae7f792949cb384d66d84bc72d85

SwiftDriver: use `ucrt` instead of `MSVCRT` There is nothing that requires the use of `MSVCRT` (i.e. `stderr`, `stdout`, or the overloaded math routines). This eases the removal of the `visualc` module from the Swift standard library.

view details

Owen Voorhees

commit sha 9dd479c557cefdb1ee22752666feb0f05dc1b93c

Merge pull request #318 from compnerd/ucrt SwiftDriver: use `ucrt` instead of `MSVCRT`

view details

David Ungar

commit sha 750869db76f1d1603788e238be97d9c3086008b6

Merge pull request #311 from davidungar/incremental-10-16-show [Incremental] Testable debugging outputs & tests

view details

Owen Voorhees

commit sha ae9e0ed3a1fb86c2c352b0c69c55d8db0fea2620

Add initial WebAssembly toolchain implementation

view details

push time in 5 days

push eventapple/swift-driver

Saleem Abdulrasool

commit sha c237311a9a99ae7f792949cb384d66d84bc72d85

SwiftDriver: use `ucrt` instead of `MSVCRT` There is nothing that requires the use of `MSVCRT` (i.e. `stderr`, `stdout`, or the overloaded math routines). This eases the removal of the `visualc` module from the Swift standard library.

view details

Owen Voorhees

commit sha 9dd479c557cefdb1ee22752666feb0f05dc1b93c

Merge pull request #318 from compnerd/ucrt SwiftDriver: use `ucrt` instead of `MSVCRT`

view details

push time in 5 days

PR merged apple/swift-driver

SwiftDriver: use `ucrt` instead of `MSVCRT`

There is nothing that requires the use of MSVCRT (i.e. stderr, stdout, or the overloaded math routines). This eases the removal of the visualc module from the Swift standard library.

+1 -1

3 comments

1 changed file

compnerd

pr closed time in 5 days

pull request commentapple/swift-driver

SwiftDriver: use `ucrt` instead of `MSVCRT`

Sure, no problem!

compnerd

comment created time in 5 days

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentapple/swift-driver

Properly set up jobs when -lto is set

 extension Driver {       return (linkerOutputType == nil)     case .swiftModule:       return compilerMode.isSingleCompilation && moduleOutputInfo.output?.isTopLevel ?? false-    case .llvmBitcode:-      return compilerOutputType == type

It looks like this change breaks the reproducible-builds/swiftc-emit-bc.swift test, because bitcode can be a top level output if the command line is something like swiftc -emit-bc foo.swift -o foo.bc.

nkcsgexi

comment created time in 5 days

PullRequestReviewEvent

pull request commentapple/swift-driver

Add initial WebAssembly toolchain implementation

@swift-ci please test

owenv

comment created time in 5 days

push eventowenv/swift-driver

Owen Voorhees

commit sha a283a7df924add619377a730ff1c7a4c8e5495d9

Add initial WebAssembly toolchain implementation

view details

push time in 5 days

pull request commentapple/swift-driver

Add initial WebAssembly toolchain implementation

@swift-ci please test

owenv

comment created time in 5 days

PR opened apple/swift-driver

-dump-ast overrides -wmo and -index-file

This fixes the Driver/ast_dump_with_WMO.swift test, and expands the override to cover -index-file as well based on a FIXME in the C++ source. If both are specified, a warning is emitted: ignoring '-wmo' because '-dump-ast' was also specified

+55 -0

0 comment

3 changed files

pr created time in 5 days

push eventowenv/swift-driver

Owen Voorhees

commit sha 7a502fd55b910c91182bfd63642effa20e24090a

Emit warning when -dump-ast overrides -wmo or -index-file

view details

push time in 5 days

create barnchowenv/swift-driver

branch : dump-ast-override

created branch time in 5 days

Pull request review commentapple/swift-driver

Add initial WebAssembly toolchain implementation

+//===-------- WebAssemblyToolchain.swift - Swift WASM Toolchain -----------===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2020 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//+import TSCBasic+import SwiftOptions++/// Toolchain for WebAssembly-based systems.+@_spi(Testing) public final class WebAssemblyToolchain: Toolchain {+  @_spi(Testing) public enum Error: Swift.Error, DiagnosticData {+    case interactiveModeUnsupportedForTarget(String)+    case dynamicLibrariesUnsupportedForTarget(String)+    case sanitizersUnsupportedForTarget(String)+    case profilingUnsupportedForTarget(String)++    public var description: String {+      switch self {+      case .interactiveModeUnsupportedForTarget(let triple):+        return "interactive mode is unsupported for target '\(triple)'; use 'swiftc' instead"+      case .dynamicLibrariesUnsupportedForTarget(let triple):+        return "dynamic libraries are unsupported for target '\(triple)'"+      case .sanitizersUnsupportedForTarget(let triple):+        return "sanitizers are unsupported for target '\(triple)'"+      case .profilingUnsupportedForTarget(let triple):+        return "profiling is unsupported for target '\(triple)'"+      }+    }+  }++  public let env: [String: String]++  /// The executor used to run processes used to find tools and retrieve target info.+  public let executor: DriverExecutor++  /// The file system to use for queries.+  public let fileSystem: FileSystem++  /// Doubles as path cache and point for overriding normal lookup+  private var toolPaths = [Tool: AbsolutePath]()++  public let toolDirectory: AbsolutePath?++  public init(env: [String: String], executor: DriverExecutor, fileSystem: FileSystem = localFileSystem, toolDirectory: AbsolutePath? = nil) {+    self.env = env+    self.executor = executor+    self.fileSystem = fileSystem+    self.toolDirectory = toolDirectory+  }++  public func makeLinkerOutputFilename(moduleName: String, type: LinkOutputType) -> String {+    switch type {+    case .executable:+      return moduleName+    case .dynamicLibrary:+      // WASM doesn't support dynamic libraries yet, but we'll report the error later.+      return ""+    case .staticLibrary:+      return "lib\(moduleName).a"

great, thanks for confirming!

owenv

comment created time in 6 days

PullRequestReviewEvent

pull request commentapple/swift-driver

Add initial WebAssembly toolchain implementation

cc @kateinoigakukun and @MaxDesiatov too

owenv

comment created time in 6 days

Pull request review commentapple/swift-driver

Add initial WebAssembly toolchain implementation

+//===-------- WebAssemblyToolchain.swift - Swift WASM Toolchain -----------===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2020 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//+import TSCBasic+import SwiftOptions++/// Toolchain for WebAssembly-based systems.+@_spi(Testing) public final class WebAssemblyToolchain: Toolchain {+  @_spi(Testing) public enum Error: Swift.Error, DiagnosticData {+    case interactiveModeUnsupportedForTarget(String)+    case dynamicLibrariesUnsupportedForTarget(String)+    case sanitizersUnsupportedForTarget(String)+    case profilingUnsupportedForTarget(String)++    public var description: String {+      switch self {+      case .interactiveModeUnsupportedForTarget(let triple):+        return "interactive mode is unsupported for target '\(triple)'; use 'swiftc' instead"+      case .dynamicLibrariesUnsupportedForTarget(let triple):+        return "dynamic libraries are unsupported for target '\(triple)'"+      case .sanitizersUnsupportedForTarget(let triple):+        return "sanitizers are unsupported for target '\(triple)'"+      case .profilingUnsupportedForTarget(let triple):+        return "profiling is unsupported for target '\(triple)'"+      }+    }+  }++  public let env: [String: String]++  /// The executor used to run processes used to find tools and retrieve target info.+  public let executor: DriverExecutor++  /// The file system to use for queries.+  public let fileSystem: FileSystem++  /// Doubles as path cache and point for overriding normal lookup+  private var toolPaths = [Tool: AbsolutePath]()++  public let toolDirectory: AbsolutePath?++  public init(env: [String: String], executor: DriverExecutor, fileSystem: FileSystem = localFileSystem, toolDirectory: AbsolutePath? = nil) {+    self.env = env+    self.executor = executor+    self.fileSystem = fileSystem+    self.toolDirectory = toolDirectory+  }++  public func makeLinkerOutputFilename(moduleName: String, type: LinkOutputType) -> String {+    switch type {+    case .executable:+      return moduleName+    case .dynamicLibrary:+      // WASM doesn't support dynamic libraries yet, but we'll report the error later.+      return ""+    case .staticLibrary:+      return "lib\(moduleName).a"

not sure if this naming convention is correct

owenv

comment created time in 6 days

PullRequestReviewEvent

Pull request review commentapple/swift-driver

Add initial WebAssembly toolchain implementation

+//===-------- WebAssemblyToolchain.swift - Swift WASM Toolchain -----------===//+//+// This source file is part of the Swift.org open source project+//+// Copyright (c) 2020 Apple Inc. and the Swift project authors+// Licensed under Apache License v2.0 with Runtime Library Exception+//+// See https://swift.org/LICENSE.txt for license information+// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors+//+//===----------------------------------------------------------------------===//+import TSCBasic+import SwiftOptions++/// Toolchain for WebAssembly-based systems.+@_spi(Testing) public final class WebAssemblyToolchain: Toolchain {+  @_spi(Testing) public enum Error: Swift.Error, DiagnosticData {+    case interactiveModeUnsupportedForTarget(String)+    case dynamicLibrariesUnsupportedForTarget(String)+    case sanitizersUnsupportedForTarget(String)+    case profilingUnsupportedForTarget(String)++    public var description: String {+      switch self {+      case .interactiveModeUnsupportedForTarget(let triple):+        return "interactive mode is unsupported for target '\(triple)'; use 'swiftc' instead"+      case .dynamicLibrariesUnsupportedForTarget(let triple):+        return "dynamic libraries are unsupported for target '\(triple)'"+      case .sanitizersUnsupportedForTarget(let triple):+        return "sanitizers are unsupported for target '\(triple)'"+      case .profilingUnsupportedForTarget(let triple):+        return "profiling is unsupported for target '\(triple)'"+      }+    }+  }++  public let env: [String: String]++  /// The executor used to run processes used to find tools and retrieve target info.+  public let executor: DriverExecutor++  /// The file system to use for queries.+  public let fileSystem: FileSystem++  /// Doubles as path cache and point for overriding normal lookup+  private var toolPaths = [Tool: AbsolutePath]()++  public let toolDirectory: AbsolutePath?++  public init(env: [String: String], executor: DriverExecutor, fileSystem: FileSystem = localFileSystem, toolDirectory: AbsolutePath? = nil) {+    self.env = env+    self.executor = executor+    self.fileSystem = fileSystem+    self.toolDirectory = toolDirectory+  }++  public func makeLinkerOutputFilename(moduleName: String, type: LinkOutputType) -> String {+    switch type {+    case .executable:+      return moduleName

not sure if this should always have the .wasm extension

owenv

comment created time in 6 days

PullRequestReviewEvent

Pull request review commentapple/swift-driver

Add initial WebAssembly toolchain implementation

 import TSCBasic  extension Driver {   mutating func autolinkExtractJob(inputs: [TypedVirtualPath]) throws -> Job? {-    // On ELF platforms there's no built in autolinking mechanism, so we+    // On ELF/WASM platforms there's no built in autolinking mechanism, so we     // pull the info we need from the .o files directly and pass them as an     // argument input file to the linker.     // FIXME: Also handle Cygwin and MinGW-    guard inputs.count > 0 && targetTriple.objectFormat == .elf && lto == nil else {+    guard inputs.count > 0 &&+            [.elf, .wasm].contains(targetTriple.objectFormat) &&+            lto == nil else {

From what I understand we probably won't need autolink-extract for Wasm long-term, but this is pretty harmless in the meantime

owenv

comment created time in 6 days

PullRequestReviewEvent

pull request commentapple/swift-driver

Add initial WebAssembly toolchain implementation

@swift-ci please test

owenv

comment created time in 6 days

PR opened apple/swift-driver

Add initial WebAssembly toolchain implementation

This is an initial implementation of a WebAssembly toolchain. It shares a lot of similarities with the GenericUnixToolchain, but it doesn't support dynamic libraries and other features like sanitizers, profiling, etc. Overall, there are enough differences that trying to subclass GenericUnixToolchain seemed potentially error-prone.

The functionality in this PR goes a bit beyond the current Wasm support in the main Swift repo. I tested this change by installing swift-driver into a toolchain snapshot from the SwiftWasm fork and then verifying I could compile a basic working program.

+414 -17

0 comment

8 changed files

pr created time in 6 days

push eventowenv/swift-driver

Owen Voorhees

commit sha 2bdf795cfa986a21b1fc6fb0d1dba27b256583c3

Add initial WebAssembly toolchain implementation

view details

push time in 6 days

create barnchowenv/swift-driver

branch : webassembly

created branch time in 6 days

push eventapple/swift-driver

Owen Voorhees

commit sha f9229d210b0f6c7d2c10307dd9cce77b596b9029

Add the module interface input to the command line of a verification job

view details

Owen Voorhees

commit sha 9bb7cbe0dea8891e56c227f29bf58447fdc2a0a0

Merge pull request #314 from owenv/fix-interface-verification Add the module interface input to the command line of a verification job

view details

push time in 6 days

PR merged apple/swift-driver

Reviewers
Add the module interface input to the command line of a verification job

This fixes the ModuleInterface/verify-module-interfaces.swift test. Previously, the module interface was correctly being added as a job input, but it wasn't added to the command line.

+5 -3

1 comment

2 changed files

owenv

pr closed time in 6 days

push eventapple/swift-driver

Owen Voorhees

commit sha b6215b4e249c133dd321316e500116e30b51e52c

Warn when a target environment is inferred to be a simulator

view details

Owen Voorhees

commit sha c95c830a9cf98f5e081a2a6d3421d3f15600d54e

Merge pull request #313 from owenv/inference-is-bad Warn when a target environment is inferred to be a simulator

view details

push time in 6 days

PR merged apple/swift-driver

Reviewers
Warn when a target environment is inferred to be a simulator

The frontend takes care of the actual inference, so here I just check if we're in a situation where the explicit triple does not have the simulator environment but the frontend target info one does.

+21 -0

1 comment

3 changed files

owenv

pr closed time in 6 days

pull request commentapple/swift-driver

Add the module interface input to the command line of a verification job

@swift-ci please test

owenv

comment created time in 6 days

PR opened apple/swift-driver

Reviewers
Add the module interface input to the command line of a verification job

This fixes the ModuleInterface/verify-module-interfaces.swift test. Previously, the module interface was correctly being added as a job input, but it wasn't added to the command line.

+5 -3

0 comment

2 changed files

pr created time in 6 days

create barnchowenv/swift-driver

branch : fix-interface-verification

created branch time in 6 days

PullRequestReviewEvent

pull request commentapple/swift-driver

Warn when a target environment is inferred to be a simulator

@swift-ci test

owenv

comment created time in 6 days

PR opened apple/swift-driver

Warn when a target environment is inferred to be a simulator

The frontend takes care of the actual inference, so here I just check if we're in a situation where the explicit triple does not have the simulator environment but the frontend target info one does.

+21 -0

0 comment

3 changed files

pr created time in 6 days

push eventowenv/swift-driver

Owen Voorhees

commit sha b6215b4e249c133dd321316e500116e30b51e52c

Warn when a target environment is inferred to be a simulator

view details

push time in 6 days

create barnchowenv/swift-driver

branch : inference-is-bad

created branch time in 6 days

PR closed apple/swift

[Experiment/DNM] @package imports found via fast dependency scanning

This is just an experiment to see if the dependency scanner + explicit module builds is a good approach for package imports by way of an @package attribute.

+298 -11

9 comments

15 changed files

owenv

pr closed time in 7 days

PR closed apple/swift

[DNM] swift-driver testing PR

<!-- What's in this pull request? --> Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: --> Resolves SR-NNNN.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+1 -1

2 comments

1 changed file

owenv

pr closed time in 7 days

push eventapple/swift-driver

Owen Voorhees

commit sha 7e5a68b9b51bcde5b59bdf8e7134bc3a548b1ef8

Remove the fileSystem in ExplicitModuleBuildHandler Instead, this commit introduces a new VirtualPath case, temporaryFileWithKnownContents. This allows the ExplicitModuleBuildHandler to indirectly delegate writing artifact info temporary files to the ArgsResolver.

view details

Owen Voorhees

commit sha 15364302e071ce08bb38f26b9d32ccf504aa8d16

Merge pull request #288 from owenv/remove-fs-2 Remove the fileSystem in ExplicitModuleBuildHandler

view details

push time in 7 days

PR merged apple/swift-driver

Remove the fileSystem in ExplicitModuleBuildHandler

I forgot to change the base branch on this so I had to reopen it to fix a merge conflict. Once https://github.com/apple/swift-package-manager/pull/2962 is merged I should be able to merge this without breaking the build.

This commit introduces a new VirtualPath case, temporaryFileWithKnownContents. This allows the ExplicitModuleBuildHandler to indirectly delegate writing artifact info temporary files to the ArgsResolver.

+83 -63

2 comments

8 changed files

owenv

pr closed time in 7 days

pull request commentapple/swift-driver

Remove the fileSystem in ExplicitModuleBuildHandler

@swift-ci test

owenv

comment created time in 7 days

pull request commentapple/swift-driver

Remove the fileSystem in ExplicitModuleBuildHandler

Full swift-ci run: https://github.com/apple/swift/pull/34317

owenv

comment created time in 7 days

pull request commentapple/swift

[DNM] swift-driver testing PR

apple/swift-driver#288

@swift-ci please test Windows

owenv

comment created time in 7 days

pull request commentapple/swift

[DNM] swift-driver testing PR

https://github.com/apple/swift-driver/pull/288

@swift-ci please smoke test

owenv

comment created time in 8 days

PR opened apple/swift

[DNM] swift-driver testing PR

<!-- What's in this pull request? --> Replace this paragraph with a description of your changes and rationale. Provide links to external references/discussions if appropriate.

<!-- If this pull request resolves any bugs in the Swift bug tracker, provide a link: --> Resolves SR-NNNN.

<!-- Before merging this pull request, you must run the Swift continuous integration tests. For information about triggering CI builds via @swift-ci, see: https://github.com/apple/swift/blob/master/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift! -->

+1 -1

0 comment

1 changed file

pr created time in 8 days

PullRequestReviewEvent

pull request commentapple/swift-package-manager

Avoid switching over SwiftDriver.VirtualPath

@DougGregor No, I've just been busy and never got around to following up on this, sorry! This can be merged at any time, it doesn't have any dependencies

owenv

comment created time in 9 days

Pull request review commentapple/swift

[Diagnostics] Localization support for educational notes

 void DiagnosticEngine::emitDiagnostic(const Diagnostic &diagnostic) {          SmallVector<std::string, 1> educationalNotePaths; -    auto associatedNotes = educationalNotes[(uint32_t)diagnostic.getID()];-    while (associatedNotes && *associatedNotes) {+    auto associatedNote = educationalNotes[(uint32_t)diagnostic.getID()];++    if (associatedNote) {       SmallString<128> notePath(getDiagnosticDocumentationPath());-      llvm::sys::path::append(notePath, *associatedNotes);-      educationalNotePaths.push_back(notePath.str().str());-      ++associatedNotes;+      if (!locale.empty() && locale != "en" &&+          haveTranslationForEducationalNote(diagnostic.getID(), locale,+                                            educationalNoteTranslations)) {

yeah, I think that makes the most sense long-term. I'm going to hold off on merging this PR for now until I've had a chance to look into that more in case it significantly changes the approach.

owenv

comment created time in 10 days

PullRequestReviewEvent

pull request commentapple/swift

[Diagnostics] Localization support for educational notes

@swift-ci please smoke test

owenv

comment created time in 11 days

Pull request review commentapple/swift

[Diagnostics] Localization support for educational notes

 static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,     // Check if the locale code is available.     if (llvm::none_of(localeCodes, [&](const char *locale) {           return localeCode == locale;-        })) {+        }) && localeCode != "test") {

good idea, added

owenv

comment created time in 11 days

PullRequestReviewEvent

push eventowenv/swift

Owen Voorhees

commit sha 278265fcd8317094c0139c6236ee318a19573636

Add comment explaining temporary -locale test option

view details

push time in 11 days

Pull request review commentapple/swift

[Diagnostics] Localization support for educational notes

 static bool ParseDiagnosticArgs(DiagnosticOptions &Opts, ArgList &Args,     // Check if the locale code is available.     if (llvm::none_of(localeCodes, [&](const char *locale) {           return localeCode == locale;-        })) {+        }) && localeCode != "test") {

This is an unfortunate, but temporary hack to allow testing with -locale test since there aren't any real translations yet. EducationalNotes.def registers one note as having a translation for the "test" language so the tests can verify the changes work properly without adding a real translation. Once there's at least one, we can update the tests to use that instead and remove this.

owenv

comment created time in 11 days

PullRequestReviewEvent

pull request commentapple/swift

[Diagnostics] Localization support for educational notes

cc @HassanElDesouky

owenv

comment created time in 11 days

Pull request review commentapple/swift-driver

[Incremental] Write build record & test

+//===--------------- BuildRecordInfo.swift --------------------------------===//

This will need a new entry in CMakeLists.txt

davidungar

comment created time in 12 days

Pull request review commentapple/swift-driver

[Incremental] Write build record & test

+//===--------------- BuildRecord.swift - Swift Input File Info Map -------===//

The CMakeLists.txt entry for InputInfoMap will need to be renamed to BuildRecord

davidungar

comment created time in 12 days

PullRequestReviewEvent
more