Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-5061] Assertion failed: (FD >= 0 && "File not yet open!") #4999

Closed
jpsim opened this issue May 31, 2017 · 16 comments
Closed

[SR-5061] Assertion failed: (FD >= 0 && "File not yet open!") #4999

jpsim opened this issue May 31, 2017 · 16 comments
Labels

Comments

@jpsim
Copy link
Contributor

jpsim commented May 31, 2017

Previous ID SR-5061
Radar None
Original Reporter @jpsim
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Latest Swift 4.0 snapshot on macOS: swift-4.0-DEVELOPMENT-SNAPSHOT-2017-05-29-a

Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels Bug, CompilerCrash, Driver
Assignee None
Priority Medium

md5: 1f743c1ee4fd96611a743da8334eb35b

is duplicated by:

  • SR-5491 LLVM ERROR: IO failure on output stream.
  • SR-5592 swift build fails on Xcode 9 beta 4

Issue Description:

$ TOOLCHAINS=org.swift.4020170529a swift build
Compile CYaml src/reader.c
Compile CYaml src/writer.c
Compile CYaml src/scanner.c
Compile CYaml src/parser.c
Compile CYaml src/loader.c
Compile CYaml src/emitter.c
Compile CYaml src/dumper.c
Compile CYaml src/api.c
Compile Swift Module 'SwiftyTextTable' (1 sources)
Compile Swift Module 'SWXMLHash' (2 sources)
Compile Swift Module 'Result' (2 sources)
Compile Swift Module 'Yams' (13 sources)
Compile Swift Module 'Commandant' (10 sources)
Compile Swift Module 'SourceKittenFramework' (34 sources)
Compile Swift Module 'SwiftLintFramework' (161 sources)
Assertion failed: (FD >= 0 && "File not yet open!"), function preferred_buffer_size, file /Users/buildnode/jenkins/workspace/oss-swift-4.0-package-osx/llvm/lib/Support/raw_ostream.cpp, line 624.
0  swiftc                   0x0000000110164158 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swiftc                   0x0000000110163126 llvm::sys::RunSignalHandlers() + 86
2  swiftc                   0x0000000110164719 SignalHandler(int) + 361
3  libsystem_platform.dylib 0x00007fffe3e2bb3a _sigtramp + 26
4  swiftc                   0x0000000110a58008 (anonymous namespace)::DarwinX86AsmBackend::getCompactUnwindRegNum(unsigned int) const::CU64BitRegs + 192958
5  libsystem_c.dylib        0x00007fffe3cb0420 abort + 129
6  libsystem_c.dylib        0x00007fffe3c77893 basename_r + 0
7  swiftc                   0x000000011014c9ca llvm::raw_fd_ostream::preferred_buffer_size() const + 122
8  swiftc                   0x000000011014ac80 llvm::raw_ostream::SetBuffered() + 16
9  swiftc                   0x000000011014b441 llvm::raw_ostream::write(char const*, unsigned long) + 33
10 swiftc                   0x000000010cf24b2c swift::driver::Compilation::performJobs() + 396
11 swiftc                   0x000000010cf17614 main + 2212
12 libdyld.dylib            0x00007fffe3c1c235 start + 1
Stack dump:
0.  Program arguments: /Library/Developer/Toolchains/swift-4.0-DEVELOPMENT-SNAPSHOT-2017-05-29-a.xctoolchain/usr/bin/swiftc -module-name SwiftLintFramework -incremental -emit-dependencies -emit-module -emit-module-path /Users/jp/Downloads/SwiftLint/.build/debug/SwiftLintFramework.swiftmodule -output-file-map /Users/jp/Downloads/SwiftLint/.build/debug/SwiftLintFramework.build/output-file-map.json -parse-as-library -num-threads 8 -c /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/Array+SwiftLint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/CharacterSet+LinuxHack.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/Dictionary+SwiftLint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/File+Cache.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/File+SwiftLint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/NSFileManager+SwiftLint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/NSRange+SwiftLint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/NSRegularExpression+SwiftLint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/QueuedPrint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/String+SwiftLint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/String+XML.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/Structure+SwiftLint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/SwiftDeclarationKind+SwiftLint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/SwiftExpressionKind.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/SyntaxKind+SwiftLint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Extensions/SyntaxMap+SwiftLint.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Helpers/RegexHelpers.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/AccessControlLevel.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/Command.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/Configuration+Cache.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/Configuration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/ConfigurationError.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/Correction.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/Linter.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/LinterCache.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/Location.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/MasterRuleList.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/Region.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/RuleDescription.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/RuleParameter.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/StyleViolation.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/SwiftVersion.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/Version.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/ViolationSeverity.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Models/YamlParser.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Protocols/ASTRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Protocols/CacheDescriptionProvider.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Protocols/Reporter.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Protocols/Rule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Protocols/RuleConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Reporters/CSVReporter.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Reporters/CheckstyleReporter.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Reporters/EmojiReporter.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Reporters/HTMLReporter.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Reporters/JSONReporter.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Reporters/JUnitReporter.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Reporters/XcodeReporter.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/AttributesRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/AttributesRulesExamples.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ClassDelegateProtocolRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ClosingBraceRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ClosureEndIndentationRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ClosureParameterPositionRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ClosureSpacingRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ColonRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/CommaRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/CompilerProtocolInitRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ConditionalReturnsOnNewlineRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ControlStatementRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/CustomRules.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/CyclomaticComplexityRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/DiscardedNotificationCenterObserverRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/DynamicInlineRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/EmptyCountRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/EmptyEnumArgumentsRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/EmptyParametersRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/EmptyParenthesesWithTrailingClosureRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ExplicitInitRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ExplicitTopLevelACLRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ExplicitTypeInterfaceRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/FatalErrorMessageRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/FileHeaderRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/FileLengthRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/FirstWhereRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ForWhereRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ForceCastRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ForceTryRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ForceUnwrappingRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/FunctionBodyLengthRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/FunctionParameterCountRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/GenericTypeNameRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/IdentifierNameRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/IdentifierNameRuleExamples.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ImplicitGetterRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ImplicitReturnRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ImplicitlyUnwrappedOptionalRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/LargeTupleRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/LeadingWhitespaceRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/LegacyCGGeometryFunctionsRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/LegacyConstantRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/LegacyConstantRuleExamples.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/LegacyConstructorRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/LegacyNSGeometryFunctionsRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/LineLengthRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/MarkRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/MultilineParametersRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/MultilineParametersRuleExamples.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/NestingRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/NimbleOperatorRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/NoExtensionAccessModifier.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/NotificationCenterDetachmentRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/NotificationCenterDetachmentRuleExamples.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/NumberSeparatorRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/NumberSeparatorRuleExamples.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ObjectLiteralRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/OpeningBraceRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/OperatorFunctionWhitespaceRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/OperatorUsageWhitespaceRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/OverriddenSuperCallRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/PrivateOutletRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/PrivateUnitTestRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ProhibitedSuperRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ProtocolPropertyAccessorsOrderRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RedundantDiscardableLetRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RedundantNilCoalescingRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RedundantOptionalInitializationRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RedundantStringEnumValueRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RedundantVoidReturnRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ReturnArrowWhitespaceRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/AttributesConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/ColonConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/CyclomaticComplexityConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/FileHeaderConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/ImplicitlyUnwrappedOptionalConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/LineLengthConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/NameConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/NestingConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/NumberSeparatorConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/OverridenSuperCallConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/PrivateOutletRuleConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/PrivateUnitTestConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/ProhibitedSuperConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/RegexConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/SeverityConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/SeverityLevelsConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/StatementPositionConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/TrailingCommaConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/TrailingWhitespaceConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/UnusedOptionalBindingConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/VerticalWhitespaceConfiguration.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ShorthandOperatorRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/SortedImportsRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/StatementPositionRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/SwitchCaseOnNewlineRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/SyntacticSugarRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/TodoRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/TrailingCommaRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/TrailingNewlineRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/TrailingSemicolonRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/TrailingWhitespaceRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/TypeBodyLengthRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/TypeNameRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/TypeNameRuleExamples.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/UnusedClosureParameterRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/UnusedEnumeratedRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/UnusedOptionalBindingRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/ValidIBInspectableRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/VerticalParameterAlignmentRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/VerticalWhitespaceRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/VoidReturnRule.swift /Users/jp/Downloads/SwiftLint/Source/SwiftLintFramework/Rules/WeakDelegateRule.swift -I /Users/jp/Downloads/SwiftLint/.build/debug -swift-version 4 -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode-8.3.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -F /Applications/Xcode-8.3.2.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Onone -g -enable-testing -j8 -DSWIFT_PACKAGE -Xcc -fmodule-map-file=/Users/jp/Downloads/SwiftLint/.build/debug/CYaml.build/module.modulemap -I /Users/jp/Downloads/SwiftLint/.build/checkouts/Yams.git-8068124914099325722/Sources/CYaml/include -Xcc -fmodule-map-file=/Users/jp/Downloads/SwiftLint/.build/checkouts/SourceKit.git-6033254968535974678/module.modulemap -Xcc -fmodule-map-file=/Users/jp/Downloads/SwiftLint/.build/checkouts/Clang_C.git-5715122005051714050/module.modulemap -module-cache-path /Users/jp/Downloads/SwiftLint/.build/debug/ModuleCache 
error: terminated(1): /Library/Developer/Toolchains/swift-4.0-DEVELOPMENT-SNAPSHOT-2017-05-29-a.xctoolchain/usr/bin/swift-build-tool -f /Users/jp/Downloads/SwiftLint/.build/debug.yaml
@jpsim
Copy link
Contributor Author

jpsim commented May 31, 2017

I should also share that the same snapshot on Linux 16.10 builds fine and doesn't hit this issue.

@belkadan
Copy link

belkadan commented Jun 1, 2017

All uses of raw_fd_ostream in performJobs seem to be properly guarded except those referring to llvm::errs (or outs). @aciidb0mb3r, does the package manager do anything special with stderr?

@aciidgh
Copy link
Member

aciidgh commented Jun 1, 2017

SwiftPM just invokes llbuild without redirecting any output. I don't think llbuild does anything special either. /cc @ddunbar

@aciidgh
Copy link
Member

aciidgh commented Jun 1, 2017

@jpsim can you try invoking swift-build-tool directly?

$ swift build-tool -f /Users/jp/Downloads/SwiftLint/.build/debug.yaml

@jpsim
Copy link
Contributor Author

jpsim commented Jun 1, 2017

Invoking `swift-build-tool` directly works (must be run after `swift build` runs and fails so that debug.yaml is created). Thanks for the tip!

@ddunbar
Copy link
Member

ddunbar commented Jun 1, 2017

llbuild just manages using a (shared) pipe for stdout/stderr, we shouldn't ever launch swiftc without a valid one attached.

@aciidgh
Copy link
Member

aciidgh commented Jun 1, 2017

Sounds like SwiftPM may be doing something. I'll investigate (most likely post WWDC).

@belkadan
Copy link

belkadan commented Jun 1, 2017

Mark just hit this on an unrelated PR, and David said it could be the result of a not-yet-created output directory. I still don't see where we would be unconditionally writing to something, though.

@ddunbar
Copy link
Member

ddunbar commented Jun 1, 2017

@belkadan did Mark hit it on a pure swiftc test case, or something running under SwiftPM?

@belkadan
Copy link

belkadan commented Jun 1, 2017

I think it was a migrator test case, so not SwiftPM. @rudkx?

@rudkx
Copy link
Member

rudkx commented Jun 1, 2017

@jpsim
Copy link
Contributor Author

jpsim commented Jul 18, 2017

This is still an issue on macOS with the latest toolchain (after updating Swift sources for language changes):

$ TOOLCHAINS=org.swift.4020170713a swift build                                                                         
Compile Swift Module 'SourceKittenFramework' (34 sources)
Compile Swift Module 'sourcekitten' (10 sources)
Linking ./.build/debug/sourcekitten
Compile Swift Module 'SwiftLintFramework' (172 sources)
Assertion failed: (FD >= 0 && "File not yet open!"), function preferred_buffer_size, file /Users/buildnode/jenkins/workspace/oss-swift-4.0-package-osx/llvm/lib/Support/raw_ostream.cpp, line 624.
0  swiftc                   0x000000010b093968 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40
1  swiftc                   0x000000010b0928c6 llvm::sys::RunSignalHandlers() + 86
2  swiftc                   0x000000010b093f2e SignalHandler(int) + 366
3  libsystem_platform.dylib 0x00007fff94531b3a _sigtramp + 26
4  libsystem_platform.dylib 0x0100000000000005 _sigtramp + 1806492901
5  libsystem_c.dylib        0x00007fff943b6420 abort + 129
6  libsystem_c.dylib        0x00007fff9437d893 basename_r + 0
7  swiftc                   0x000000010b07dcda llvm::raw_fd_ostream::preferred_buffer_size() const + 122
8  swiftc                   0x000000010b07bfe0 llvm::raw_ostream::SetBuffered() + 16
9  swiftc                   0x000000010b07c7a1 llvm::raw_ostream::write(char const*, unsigned long) + 33
10 swiftc                   0x00000001080048e2 swift::driver::Compilation::performJobs() + 386
11 swiftc                   0x0000000107ff73ad main + 2189
12 libdyld.dylib            0x00007fff94322235 start + 1
Stack dump:
0.  Program arguments: /Library/Developer/Toolchains/swift-4.0-DEVELOPMENT-SNAPSHOT-2017-07-13-a.xctoolchain/usr/bin/swiftc -module-name SwiftLintFramework -incremental -emit-dependencies -emit-module -emit-module-path /Users/jp/Projects/SwiftLint/.build/debug/SwiftLintFramework.swiftmodule -output-file-map /Users/jp/Projects/SwiftLint/.build/debug/SwiftLintFramework.build/output-file-map.json -parse-as-library -num-threads 8 -c /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/Array+SwiftLint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/CharacterSet+LinuxHack.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/Configuration+Cache.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/Configuration+LintableFiles.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/Configuration+Merging.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/Configuration+Parsing.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/Dictionary+SwiftLint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/File+Cache.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/File+SwiftLint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/NSFileManager+SwiftLint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/NSRange+SwiftLint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/NSRegularExpression+SwiftLint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/QueuedPrint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/String+SwiftLint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/String+XML.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/Structure+SwiftLint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/SwiftDeclarationKind+SwiftLint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/SwiftExpressionKind.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/SyntaxKind+SwiftLint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Extensions/SyntaxMap+SwiftLint.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Helpers/RegexHelpers.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/AccessControlLevel.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/Command.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/Configuration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/ConfigurationError.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/Correction.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/Linter.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/LinterCache.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/Location.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/MasterRuleList.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/Region.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/RuleDescription.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/RuleKind.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/RuleList.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/RuleParameter.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/StyleViolation.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/SwiftVersion.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/Version.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/ViolationSeverity.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Models/YamlParser.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Protocols/ASTRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Protocols/CacheDescriptionProvider.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Protocols/Reporter.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Protocols/Rule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Protocols/RuleConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Reporters/CSVReporter.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Reporters/CheckstyleReporter.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Reporters/EmojiReporter.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Reporters/HTMLReporter.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Reporters/JSONReporter.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Reporters/JUnitReporter.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Reporters/XcodeReporter.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/AttributesRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/AttributesRulesExamples.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ClassDelegateProtocolRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ClosingBraceRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ClosureEndIndentationRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ClosureParameterPositionRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ClosureSpacingRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ColonRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/CommaRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/CompilerProtocolInitRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ConditionalReturnsOnNewlineRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ControlStatementRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/CustomRules.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/CyclomaticComplexityRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/DiscardedNotificationCenterObserverRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/DynamicInlineRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/EmptyCountRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/EmptyEnumArgumentsRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/EmptyParametersRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/EmptyParenthesesWithTrailingClosureRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ExplicitInitRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ExplicitTopLevelACLRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ExplicitTypeInterfaceRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ExtensionAccessModifierRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/FatalErrorMessageRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/FileHeaderRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/FileLengthRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/FirstWhereRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ForWhereRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ForceCastRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ForceTryRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ForceUnwrappingRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/FunctionBodyLengthRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/FunctionParameterCountRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/GenericTypeNameRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/IdentifierNameRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/IdentifierNameRuleExamples.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ImplicitGetterRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ImplicitReturnRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ImplicitlyUnwrappedOptionalRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/LargeTupleRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/LeadingWhitespaceRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/LegacyCGGeometryFunctionsRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/LegacyConstantRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/LegacyConstantRuleExamples.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/LegacyConstructorRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/LegacyNSGeometryFunctionsRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/LetVarWhitespaceRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/LineLengthRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/MarkRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/MultilineParametersRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/MultilineParametersRuleExamples.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/NestingRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/NimbleOperatorRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/NoExtensionAccessModifierRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/NotificationCenterDetachmentRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/NotificationCenterDetachmentRuleExamples.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/NumberSeparatorRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/NumberSeparatorRuleExamples.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ObjectLiteralRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/OpeningBraceRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/OperatorFunctionWhitespaceRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/OperatorUsageWhitespaceRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/OverriddenSuperCallRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/PrivateOutletRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/PrivateOverFilePrivateRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/PrivateUnitTestRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ProhibitedSuperRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ProtocolPropertyAccessorsOrderRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RedundantDiscardableLetRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RedundantNilCoalescingRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RedundantOptionalInitializationRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RedundantStringEnumValueRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RedundantVoidReturnRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ReturnArrowWhitespaceRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/AttributesConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/ColonConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/CyclomaticComplexityConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/FileHeaderConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/ImplicitlyUnwrappedOptionalConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/LineLengthConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/NameConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/NestingConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/NumberSeparatorConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/ObjectLiteralConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/OverridenSuperCallConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/PrivateOutletRuleConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/PrivateUnitTestConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/ProhibitedSuperConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/RegexConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/SeverityConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/SeverityLevelsConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/StatementPositionConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/TrailingCommaConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/TrailingWhitespaceConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/UnusedOptionalBindingConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/RuleConfigurations/VerticalWhitespaceConfiguration.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ShorthandOperatorRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/SortedImportsRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/StatementPositionRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/StrictFilePrivateRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/SwitchCaseOnNewlineRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/SyntacticSugarRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/TodoRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/TrailingCommaRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/TrailingNewlineRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/TrailingSemicolonRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/TrailingWhitespaceRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/TypeBodyLengthRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/TypeNameRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/TypeNameRuleExamples.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/UnusedClosureParameterRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/UnusedEnumeratedRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/UnusedOptionalBindingRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/ValidIBInspectableRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/VerticalParameterAlignmentOnCallRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/VerticalParameterAlignmentRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/VerticalWhitespaceRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/VoidReturnRule.swift /Users/jp/Projects/SwiftLint/Source/SwiftLintFramework/Rules/WeakDelegateRule.swift -I /Users/jp/Projects/SwiftLint/.build/debug -swift-version 3 -target x86_64-apple-macosx10.10 -sdk /Applications/Xcode-9.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -F /Applications/Xcode-9.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Onone -g -enable-testing -j8 -DSWIFT_PACKAGE -Xcc -fmodule-map-file=/Users/jp/Projects/SwiftLint/.build/debug/CYaml.build/module.modulemap -I /Users/jp/Projects/SwiftLint/.build/checkouts/Yams.git-8068124914099325722/Sources/CYaml/include -Xcc -fmodule-map-file=/Users/jp/Projects/SwiftLint/.build/checkouts/SourceKit.git-6033254968535974678/module.modulemap -Xcc -fmodule-map-file=/Users/jp/Projects/SwiftLint/.build/checkouts/Clang_C.git-5715122005051714050/module.modulemap -module-cache-path /Users/jp/Projects/SwiftLint/.build/debug/ModuleCache 
error: terminated(1): /Library/Developer/Toolchains/swift-4.0-DEVELOPMENT-SNAPSHOT-2017-07-13-a.xctoolchain/usr/bin/swift-build-tool -f /Users/jp/Projects/SwiftLint/.build/debug.yaml

@belkadan
Copy link

@aciidb0mb3r says:

bq. It looks like the compiler is trying to create these directories, so we'll need to allow that in the sandbox.

(allow file-write-create (path "/private/var/folders/98/0fcj8gms75z3x7_01g5v_m0h0000gn/T/sources-a9889d"))
(allow file-write-create (path "/private/var/folders/98/0fcj8gms75z3x7_01g5v_m0h0000gn/T/inputs-5c6452"))

Is this a new change? Are there more pattern that we should we aware of? These are the patterns we currently allow: https://github.com/apple/swift-package-manager/blob/master/Sources/Commands/SwiftTool.swift#L546

The compiler has always assumed TMPDIR is up for grabs. The "sources" and "inputs" files are for when you have so many files in a target that you might overflow the command line. (There's another one for object files in a WMO build if I recall correctly.) It also uses TMPDIR for atomic writes of files (by writing to a temp file first). There might be others I can't remember.

Fortunately, these all really do respect the TMPDIR environment variable, so you could make a subdirectory inside the real TMPDIR and use that if you're worried about cross-process contamination.

@aciidgh
Copy link
Member

aciidgh commented Jul 18, 2017

I see, the subdirectory trick sounds good. Thanks @belkadan!

@aciidgh
Copy link
Member

aciidgh commented Jul 19, 2017

#1277

@aciidgh
Copy link
Member

aciidgh commented Jul 19, 2017

Stardust bot update:
Repository: https://github.com/apple/swift-package-manager
Branch: master
Commit: 575bfb7

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants