Comments (8)
Shorter — swiftc -emit-module -enable-batch-mode Dupe.swift
where Dupe.swift
contains anything that must not parse, e.g. let
. The culprit is -enable-batch-mode
and the duplication does not reproduce with the old driver.
@hamishknight Please see to the transfer.
from swift-driver.
Interesting, we appear to be creating two -emit-module
jobs, one of them seems like an intermediate output that would have previously been used for merge-modules (or I guess maybe it's still required to ensure we type-check function bodies?):
❯ ./swiftc -emit-module -enable-batch-mode ~/src/swift-test-arena/swift-test-arena/main.swift -###
/Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-frontend -frontend -emit-module -primary-file /Users/hamish/src/swift-test-arena/swift-test-arena/main.swift -target x86_64-apple-macosx13.0 -warn-on-potentially-unavailable-enum-case -enable-objc-interop -color-diagnostics -new-driver-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift -module-name main -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift/host/plugins -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/local/lib/swift/host/plugins -o /var/folders/3m/l5fbv4dn6wz112cw2nhjq69h0000gn/T/TemporaryDirectory.jKvDlg/main-2.swiftmodule
/Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /Users/hamish/src/swift-test-arena/swift-test-arena/main.swift -target x86_64-apple-macosx13.0 -warn-on-potentially-unavailable-enum-case -enable-objc-interop -color-diagnostics -new-driver-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift -module-name main -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift/host/plugins -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/local/lib/swift/host/plugins -emit-module-doc-path main.swiftdoc -emit-module-source-info-path main.swiftsourceinfo -o main.swiftmodule -emit-abi-descriptor-path main.abi.json
❯ ./swiftc -enable-batch-mode -emit-module ~/src/swift-test-arena/swift-test-arena/main.swift -v
Swift version 5.9-dev (LLVM dcb09f599ae5aa9, Swift edc003ac9278d7c)
Target: x86_64-apple-macosx13.0
/Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-frontend -frontend -emit-module -primary-file /Users/hamish/src/swift-test-arena/swift-test-arena/main.swift -target x86_64-apple-macosx13.0 -warn-on-potentially-unavailable-enum-case -enable-objc-interop -color-diagnostics -new-driver-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift -module-name main -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift/host/plugins -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/local/lib/swift/host/plugins -o /var/folders/3m/l5fbv4dn6wz112cw2nhjq69h0000gn/T/TemporaryDirectory.lfL6bi/main-2.swiftmodule
/Users/hamish/src/swift-test-arena/swift-test-arena/main.swift:2365:4: error: expected pattern
var
^
/Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /Users/hamish/src/swift-test-arena/swift-test-arena/main.swift -target x86_64-apple-macosx13.0 -warn-on-potentially-unavailable-enum-case -enable-objc-interop -color-diagnostics -new-driver-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift -module-name main -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift/host/plugins -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/local/lib/swift/host/plugins -emit-module-doc-path main.swiftdoc -emit-module-source-info-path main.swiftsourceinfo -o main.swiftmodule -emit-abi-descriptor-path main.abi.json
error: emit-module command failed with exit code 1 (use -v to see invocation)
/Users/hamish/src/swift-test-arena/swift-test-arena/main.swift:2365:4: error: expected pattern
var
^
error: fatalError
Without -enable-batch-mode
, we appear to do the same thing, but the jobs are the other way around, and we appear to bail after the first failure:
❯ ./swiftc -emit-module ~/src/swift-test-arena/swift-test-arena/main.swift -###
/Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /Users/hamish/src/swift-test-arena/swift-test-arena/main.swift -target x86_64-apple-macosx13.0 -warn-on-potentially-unavailable-enum-case -enable-objc-interop -color-diagnostics -new-driver-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift -module-name main -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift/host/plugins -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/local/lib/swift/host/plugins -emit-module-doc-path main.swiftdoc -emit-module-source-info-path main.swiftsourceinfo -o main.swiftmodule -emit-abi-descriptor-path main.abi.json
/Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-frontend -frontend -emit-module -primary-file /Users/hamish/src/swift-test-arena/swift-test-arena/main.swift -target x86_64-apple-macosx13.0 -warn-on-potentially-unavailable-enum-case -enable-objc-interop -color-diagnostics -new-driver-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift -module-name main -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift/host/plugins -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/local/lib/swift/host/plugins -o /var/folders/3m/l5fbv4dn6wz112cw2nhjq69h0000gn/T/TemporaryDirectory.TqvOsn/main-1.swiftmodule
❯ ./swiftc -emit-module ~/src/swift-test-arena/swift-test-arena/main.swift -v
Swift version 5.9-dev (LLVM dcb09f599ae5aa9, Swift edc003ac9278d7c)
Target: x86_64-apple-macosx13.0
/Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /Users/hamish/src/swift-test-arena/swift-test-arena/main.swift -target x86_64-apple-macosx13.0 -warn-on-potentially-unavailable-enum-case -enable-objc-interop -color-diagnostics -new-driver-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/bin/swift-driver -empty-abi-descriptor -resource-dir /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift -module-name main -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/lib/swift/host/plugins -plugin-path /Users/hamish/src/swift-dev/build/Release/swift-macosx-x86_64/local/lib/swift/host/plugins -emit-module-doc-path main.swiftdoc -emit-module-source-info-path main.swiftsourceinfo -o main.swiftmodule -emit-abi-descriptor-path main.abi.json
error: emit-module command failed with exit code 1 (use -v to see invocation)
/Users/hamish/src/swift-test-arena/swift-test-arena/main.swift:2365:4: error: expected pattern
var
^
error: fatalError
from swift-driver.
Ugh.
https://github.com/apple/swift-driver/blob/main/Sources/SwiftDriver/Jobs/Planning.swift#L456
from swift-driver.
Hi @artemcm. I'm seeing a similar issue with xcodebuild and an Xcode project. Is this likely the same issue? Should I file a separate GitHub issue? I already filed a TSI and FB report with the logs for reference.
from swift-driver.
@cpisciotta could you please post the FB number here?
from swift-driver.
@artemcm FB12568959
from swift-driver.
Hey, @artemcm! Just checking in...
- Should I assume the root cause of this issue is the same as the one I see with xcodebuild? If not, should I create a new GitHub issue?
- Is there any additional context I can provide to help investigate a fix for this issue?
from swift-driver.
Hey, @artemcm. Checking in on this again...
Is there any progress or update on this issue? It's causing some issues for my team when we use xcodebuild
. It'd be helpful to set expectations about the priority and timeline for a possible fix.
from swift-driver.
Related Issues (20)
- [SR-12129] swift-driver fails to diagnose a lack of input files HOT 1
- Driver diagnostics (such as remarks and errors) don't obey `-parseable-output` HOT 7
- [SR-11900] 'swift help' doesn't work HOT 8
- SwiftDriver compilation error: com.apple.xcode.tools.swift.compiler is not absolute HOT 23
- Group CLI options for easier navigation HOT 1
- Cargo Termizi
- Crash due to an assertion in libswiftCore
- Xcode 14.3 RC 2 (14E222b) not pass '-strict-implicit-module-context' flag to swift-frontend
- `Process.findExecutable(arguments[0])` gives an unexpected result HOT 5
- Windows builds broken when querying target-info from libSwiftScan HOT 2
- Swift Potentially Uses the Wrong Swift Driver HOT 15
- iOS get error Dependency for P1: Debug:SwiftDriver Compilation Requirements app normal arm64 com.apple.xcode.tools.swift.compiler is not absolute
- swift help build doesn't work when it's documented to
- Test suite broken on Windows due to CAS HOT 1
- SPM doesn't enumerate source files properly in different configurations HOT 6
- tests crash on windows HOT 1
- `swift run` usage suggestion should be fixed HOT 1
- Program is several times slower when compiled with swiftc than when compiled with XCode due to retain&release calls HOT 1
- “swift ./-” does the same as “swift -” HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swift-driver.