Repository navigation
Conversation
An implicit build passes -pch-output-dir to the frontend, which creates the directory. An explicit build names the PCH itself and passes it with -o, and the frontend opens that path without creating its directory, so a build whose -pch-output-dir does not exist yet failed to emit the bridging PCH. Create the directory just before the jobs run, so planning alone still leaves the file system untouched.
With `-o -` the compile job writes its product to standard output. A lone job runs in place of the driver and writes there directly, but the module jobs of an explicit build make the compile a child of the driver, which sent its output to standard error, and dropped it when it was not valid UTF-8. Pass the product's bytes through to standard output unchanged.
The dependency scanner rejects `-dump-ast-format`, so with explicit module builds on by default, `-dump-ast -dump-ast-format json` failed in the scan. Only the job that dumps the AST takes the flag.
Contributor
Author
|
@swift-ci test |
Contributor
Author
|
@swift-ci test Windows |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix three issues exposed when running swiftc invocations under
-explicit-module-build:Create the
-pch-output-dirdirectory before running PCH jobs: An implicit build passes-pch-output-dirto the frontend, which creates the directory itself. An explicit build resolves the PCH file path and passes it via-o, which the frontend opens without creating parent directories. Create the parent directory inperformTheBuildbefore executing jobs so planning remains side-effect-free.Relay standard-output job products (
-o -) to stdout: A single-job invocation runs in-place and writes directly to standard output, but an explicit build adds module precompile jobs and runs the compile job as a child process throughToolExecutionDelegate. Send the raw output bytes of jobs with a-output tostdoutStreaminstead of decoding them as UTF-8 and forwarding them tostderrStream.Forward
-dump-ast-formatonly to compile jobs:swift-frontend -scan-dependenciesrejects-dump-ast-format, causing-dump-ast -dump-ast-format jsonto fail during dependency scanning.