Skip to content

build-script: allow users to specify build-dir under the preset mode. #22065

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

Merged
merged 2 commits into from
Jan 23, 2019
Merged
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
1 change: 1 addition & 0 deletions utils/build-presets.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1778,3 +1778,4 @@ release
no-assertions
build-libparser-only
swiftsyntax
verbose-build
5 changes: 5 additions & 0 deletions utils/build-script
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,9 @@ def main_preset():
parser.add_argument(
"--swiftsyntax-install-prefix",
help="specify the directory to where SwiftSyntax should be installed")
parser.add_argument(
"--build-dir",
help="specify the directory where build artifact should be stored")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This already exists. build-subdir. Is that not sufficient?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was not accepted in the preset mode like utils/build-script --preset build_swiftsyntax_release --swiftsyntax-install-prefix /tmp/ --build-dir /tmp/build/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean when I combine this flag with a preset name, like ./utils/build-script --preset build_swiftsyntax_release --swiftsyntax-install-prefix /tmp/ --build-dir /tmp/build/

The flag --build-dir /tmp/build/ isn't recognized: build-script: error: unrecognized arguments: --build-dir

args = parser.parse_args()
if len(args.preset_file_names) == 0:
args.preset_file_names = [
Expand Down Expand Up @@ -1050,6 +1053,8 @@ def main_preset():
build_script_args += ["--install-swiftsyntax",
"--install-destdir",
args.swiftsyntax_install_prefix]
if args.build_dir:
build_script_args += ["--build-dir", args.build_dir]

diagnostics.note('using preset "{}", which expands to \n\n{}\n'.format(
args.preset, shell.quote_command(build_script_args)))
Expand Down