Skip to content

s/build-path/scratch-path #61865

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

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/scripts/build_script_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument("--verbose", "-v", action="store_true")
parser.add_argument("--package-path", type=str, required=True)
parser.add_argument("--build-path", type=str, required=True)
parser.add_argument("--scratch-path", type=str, required=True)
parser.add_argument("--toolchain", type=str, required=True)

args = parser.parse_args()
Expand Down
12 changes: 6 additions & 6 deletions docs/DebuggingTheCompiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -905,14 +905,14 @@ example:
$ utils/build-script --release-debuginfo --dry-run
+ mkdir -p /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert
--- Building earlyswiftdriver ---
+ /SwiftWorkspace/swift-driver/Utilities/build-script-helper.py build --package-path /SwiftWorkspace/swift-driver --build-path /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/earlyswiftdriver-macosx-x86_64 --configuration release --toolchain /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr --ninja-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/ninja --cmake-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/cmake --local_compiler_build
+ /SwiftWorkspace/swift-driver/Utilities/build-script-helper.py build --package-path /SwiftWorkspace/swift-driver --scratch-path /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/earlyswiftdriver-macosx-x86_64 --configuration release --toolchain /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr --ninja-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/ninja --cmake-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/cmake --local_compiler_build
Building the standard library for: swift-test-stdlib-macosx-x86_64
...
```
One of the first steps is an invocation of the driver's
`build-script-helper.py` script which specifies that the driver us to be built
(`build`) using the host toolchain (`--toolchain`) to a specified location
(`--build-path`).
(`--scratch-path`).

## Installing the Compiler Driver
In order to create a Swift compiler installation (`--install-swift`), the
Expand All @@ -931,16 +931,16 @@ a standalone build product:
$ utils/build-script --release-debuginfo --dry-run --swift-driver --install-swift-driver
...
--- Cleaning swiftdriver ---
+ /SwiftWorkspace/swift-driver/Utilities/build-script-helper.py clean --package-path /SwiftWorkspace/swift-driver --build-path /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/swiftdriver-macosx-x86_64 --configuration release --toolchain /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/toolchain-macosx-x86_64/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr --ninja-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/ninja --cmake-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/cmake
+ /SwiftWorkspace/swift-driver/Utilities/build-script-helper.py clean --package-path /SwiftWorkspace/swift-driver --scratch-path /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/swiftdriver-macosx-x86_64 --configuration release --toolchain /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/toolchain-macosx-x86_64/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr --ninja-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/ninja --cmake-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/cmake
--- Building swiftdriver ---
+ /SwiftWorkspace/swift-driver/Utilities/build-script-helper.py build --package-path /SwiftWorkspace/swift-driver --build-path /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/swiftdriver-macosx-x86_64 --configuration release --toolchain /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/toolchain-macosx-x86_64/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr --ninja-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/ninja --cmake-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/cmake
+ /SwiftWorkspace/swift-driver/Utilities/build-script-helper.py build --package-path /SwiftWorkspace/swift-driver --scratch-path /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/swiftdriver-macosx-x86_64 --configuration release --toolchain /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/toolchain-macosx-x86_64/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr --ninja-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/ninja --cmake-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/cmake
--- Installing swiftdriver ---
+ /SwiftWorkspace/swift-driver/Utilities/build-script-helper.py install --package-path /SwiftWorkspace/swift-driver --build-path /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/swiftdriver-macosx-x
+ /SwiftWorkspace/swift-driver/Utilities/build-script-helper.py install --package-path /SwiftWorkspace/swift-driver --scratch-path /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/swiftdriver-macosx-x
86_64 --configuration release --toolchain /SwiftWorkspace/build/Ninja-RelWithDebInfoAssert/toolchain-macosx-x86_64/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr --ninja-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/ninja --cmake-bin /Applications/Xcode.app/Contents/Developer/usr/local/bin/cmake
```
These invocations of the driver's `build-script-helper.py` script specify the
individual build actions (`clean`, `build`, `install`), the product build path
(`--build-path`), and the *just-built* toolchain which should be used
(`--scratch-path`), and the *just-built* toolchain which should be used
(`--toolchain`).

# Debugging Swift Executables
Expand Down
4 changes: 2 additions & 2 deletions tools/swift-inspect/build_script_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def perform_build(args, swiftbuild_path):
swiftbuild_path,
"--package-path",
args.package_path,
"--build-path",
"--scratch-path",
args.build_path,
"--configuration",
args.configuration,
Expand All @@ -35,7 +35,7 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument("--verbose", "-v", action="store_true")
parser.add_argument("--package-path", type=str, required=True)
parser.add_argument("--build-path", type=str, required=True)
parser.add_argument("--scratch-path", type=str, required=True)
parser.add_argument("--toolchain", type=str, required=True)
parser.add_argument("--configuration", type=str, choices=['debug', 'release'],
default='release')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def run_build_script_helper(host_target, product, args):
helper_path,
'--verbose',
'--package-path', package_path,
'--build-path', product.build_dir,
'--scratch-path', product.build_dir,
'--toolchain', toolchain_path,
]
shell.call(build_cmd)
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def run_build_script_helper(action, host_target, product, args):
script_path,
action,
'--package-path', product.source_dir,
'--build-path', product.build_dir,
'--scratch-path', product.build_dir,
'--configuration', configuration,
'--toolchain', toolchain_path,
'--ninja-bin', product.toolchain.ninja,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def run_build_script_helper(action, host_target, product, args,
script_path,
action,
'--package-path', product.source_dir,
'--build-path', product.build_dir,
'--scratch-path', product.build_dir,
'--configuration', configuration,
'--toolchain', toolchain_path,
'--ninja-bin', product.toolchain.ninja,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def run_build_script_helper(action, host_target, product, args):
script_path,
action,
'--package-path', product.source_dir,
'--build-path', product.build_dir,
'--scratch-path', product.build_dir,
'--configuration', configuration,
'--toolchain', toolchain_path,
'--ninja-bin', product.toolchain.ninja,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def run_build_script_helper(self, action, host_target, additional_params=[]):
action,
'--toolchain', self.install_toolchain_path(host_target),
'--configuration', configuration,
'--build-path', self.build_dir,
'--scratch-path', self.build_dir,
'--multiroot-data-file', MULTIROOT_DATA_FILE_PATH,
# There might have been a Package.resolved created by other builds
# or by the package being opened using Xcode. Discard that and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def run_build_script_helper(host_target, product, args):
helper_path,
'--verbose',
'--package-path', package_path,
'--build-path', product.build_dir,
'--scratch-path', product.build_dir,
'--toolchain', toolchain_path,
]
shell.call(build_cmd)