Commit Graph

407 Commits

Author SHA1 Message Date
Mishal Shah
8c21aaf477 Merge pull request #41588 from rxwei/string-processing-swift-main
[update-checkout] Switch string processing to swift/main
2022-03-17 10:11:39 -07:00
Victoria Mitchell
455cdbc5a7 use swift-cmark/gfm instead of /main 2022-03-16 14:56:21 -06:00
Gwynne Raskind
69e97d2ed8 Merge branch 'main' into patch-1 2022-03-12 03:32:30 -06:00
Karoy Lorentey
e1c765abc7 [utils] Submit to the whims of the whitespace police 2022-03-11 16:38:33 -08:00
Karoy Lorentey
c1df51e6b6 [utils] update-checkout: Reduce environment variable noise 2022-03-10 16:50:13 -08:00
Karoy Lorentey
4f9cf1da04 [utils] update_checkout: During parallel execution, prefix each printed line with the repo name 2022-03-08 20:08:14 -08:00
Karoy Lorentey
bcddc9b7b9 [utils] Force subprocess output to be read in text mode
In Python 3, subprocess output is read as binary data by default, which isn’t what we want.

Instead of reading process output as byte strings, then manually decoding them into strings, simply pass `text=True` to functions in the `subprocess` module, so that we get properly decoded strings right out the box.

This fixes places that forget to do the decoding step — most especially, the `update-checkout` script. That script prints Git output as byte strings, which leads to unreadable results.

Additionally, in shell.run, use the same pipe for capturing both stdout and stderr. The distinction is pretty pointless in this use case; however, keeping the two channels separate means that we lose the original ordering of printed messages, which does matter.
2022-03-07 16:59:36 -08:00
Richard Wei
9a82a8f2e9 [update-checkout] Switch string processing to swift/main
Switch to using swift/main as the integration branch for apple/swift-experimental-string-processing.

Integration process documentation: apple/swift-experimental-string-processing#170
Friend PR: apple/swift-experimental-string-processing#192
2022-02-28 12:37:21 -08:00
Mishal Shah
b2943e6521 Merge pull request #41430 from hamishknight/choose-your-delimiter
Update regex literal delimiters
2022-02-28 10:19:51 -08:00
Hamish Knight
611fd33f58 Update regex literal delimiters
Update the lexing code for the replacement of the
`'/.../'` and `'|...|'` delimiters with `#/.../#`
and `#|...|#` respectively, in addition to
allowing the `re'...'` delimiter.
2022-02-24 17:37:16 -08:00
Saleem Abdulrasool
51b9ff4841 update_checkout: bump Yams to 5.0.0 2022-02-19 10:49:06 -08:00
Richard Wei
1b83efb512 Revert "Revert "[Regex] Switch regex match to Swift tuples."" 2022-02-11 01:32:45 -08:00
Mishal Shah
dcd9e8e84e Revert "[Regex] Switch regex match to Swift tuples." 2022-02-10 15:21:53 -08:00
Richard Wei
7179a8d4ba Merge pull request #41275 from rxwei/regex-update-dev-6
[Regex] Switch regex match to Swift tuples.
2022-02-10 11:19:54 -08:00
Richard Wei
cf8e0fea12 [Regex] Switch regex match to Swift tuples.
Typed captures no longer use ad-hoc nominal tuples. We use Swift native tuples instead. See apple/swift-experimental-string-processing#127.

Update checkout tag to dev/6.
2022-02-09 16:21:57 -08:00
Anders Bertelrud
182e194b7e Bump SwiftArgumentParser checkout to 1.0.3. 2022-01-31 21:49:12 -08:00
Max Desiatov
53d8c59cd0 Fix formatting in update-checkout-config.json
3-spaces formatting is inconsistently used for some keys instead of 4 spaces. This change makes the formatting consistent in `update-checkout-config.json`.
2022-01-20 10:17:29 +00:00
Mishal Shah
070fb8f1c7 Update the main scheme llvm-project branch to stable/20211026 2022-01-18 19:23:21 -08:00
Mishal Shah
ee3e72f0d6 Update the branch for swift-installer-scripts to release/5.6 2022-01-17 14:13:08 -08:00
Pavel Yaskevich
4eabfa9354 [update-checkout] Fetch if the local branch/tag doesn't exist
Dependencies are usually updated to a different branch/tag name
when new versions get new released, but local checkout might not
have that fetched yet, so if initial checkout fails, let's fetch
before attempting to checkout.
2022-01-12 13:06:54 -08:00
Richard Wei
e5175d595e [Regex] Infer 'Match' type of regex literals.
Applies swift-experimental-string-processing#68 in regex literal type inference. Regex literals with captures will have type `Regex<Tuple{n}<Substring, {Captures...}>>`. This is a temporary thing that allows us to define generic constraints on captures. We will switch back to native tuples once we have variadic generics.
2022-01-06 10:54:10 -08:00
Richard Wei
1b3c0b7a73 [Regex] Infer capture types of regex literals.
When parsing a regular expression literal, accept a serialized capture structure from the regex parser. During type checking, decode it and form Swift types.

Examples:
```swift
'/(.)(.)/' // ==> `Regex<(Substring, Substring)>`
'/(?<label>.)(.)/' // ==> `Regex<(label: Substring, Substring)`
'/((.))*((.)?)/' //==> `Regex<([Substring], [Substring], Substring, Substring?)>`
```

Also:
- Fix a bug where a regex literal parsing error is not returning an error parser result.

Note:
- This needs to land after apple/swift-experimental-string-processing#92 and after `dev/4` tag has been created.
- See apple/swift-experimental-string-processing#92 for regex parser changes and the capture structure encoding.
- The `RegexLiteralParsingFn` `CaptureStructureOut` pointer type change from `char *` to `void *` will not break builds due to implicit pointer conversion (SE-0324) and unchanged ABI.

Resolves rdar://83253511.
2021-12-22 02:58:21 -08:00
Hamish Knight
128f5d4bc6 Update regex literal lexing and emission
Update the lexing implementation to defer to the
regex library, which will pass back the pointer
from to resume lexing, and update the emission to
call the new `Regex(_regexString:version:)`
overload, that will accept the regex string with
delimiters.

Because this uses the library's lexing
implementation, the delimiters are now `'/.../'`
and `'|...|'` instead of plain `'...'`.
2021-12-17 18:05:31 +00:00
Richard Wei
300cbaba31 Integrate experimental string processing modules and enable end-to-end regex.
- Checkout apple/swift-experimental-string-processing using a tag.
- Build `_MatchingEngine` as part of libswift (`ExperimentalRegex`) using sources from the package.
- Parse regex literals using the parser from `_MatchingEngine`.
- Build both `_MatchingEngine` and `_StringProcessing` as part of core libs using sources from the package.
- Use `Regex<DynamicCaptures>` as the default regex type until we finalize apple/swift-experimental-string-processing#68.
2021-12-17 10:33:07 +00:00
Mishal Shah
b799e47724 Add support for Swift 5.6 branch 2021-12-07 19:04:23 -08:00
Mishal Shah
5fa7324618 Merge pull request #40381 from apple/tomerd-patch-1
update swift-system to 1.1.1
2021-12-06 09:51:09 -08:00
Richard Wei
5ca95ef291 Revert "[update-checkout] Clone experimental string processing package" 2021-12-02 16:55:48 -08:00
tomer doron
3c7e0bd10f update swift-system to 1.1.1 2021-12-02 14:32:37 -08:00
Richard Wei
81631685c0 Merge pull request #40352 from rxwei/update-checkout-string-processing
[update-checkout] Clone experimental string processing package
2021-12-01 20:40:48 -08:00
Mishal Shah
63230ea842 Merge pull request #40349 from apple/tomerd-patch-1
update swift-system to 1.1.0
2021-12-01 15:49:50 -08:00
Richard Wei
a0825f4fdf [update-checkout] Clone experimental string processing package
Clone apple/swift-experimental-string-processing as part of the checkout. We'll use the main branch for now and will version it as needed.
2021-12-01 00:06:40 -08:00
tomer doron
d433f32926 update swift-system to 1.1.0 2021-11-30 21:15:50 -08:00
Alex Hoppen
02d2978184 [update-checkout] Decode stderr from failed update command
Otherwise, the error message gets printed as a Python binary string, e.g. you see
```
b'error: Your local changes to the following files would be overwritten by checkout:\n\tinclude/swift/IDE/CodeCompletion.h\n\tutils/update_checkout/update_checkout/update_checkout.py\nPlease commit your changes or stash them before you switch branches.\nAborting\n'
```
instead of
```
error: Your local changes to the following files would be overwritten by checkout:
	include/swift/IDE/CodeCompletion.h
	utils/update_checkout/update_checkout/update_checkout.py
Please commit your changes or stash them before you switch branches.
Aborting
```
2021-11-29 12:40:03 +01:00
Gwynne Raskind
27e011498f Turns out, if you actually pass the environment, it doesn't like it because 0 isn't a string! 2021-11-26 12:11:58 -06:00
Mishal Shah
eb77eaa4f2 Merge pull request #40129 from jorng/fix_update_checkout_tests
update_checkout (tests): Use 'main' for test branch
2021-11-12 08:54:19 -08:00
Rob Prentiss
1b344b3271 Update call_quietly to show output on failure
If 'call_quietly' fails, there is no indication as to what the failure
was, except for the exit/status code from the subprocess. This adds a
new exception type that will print out stdout/stderr from the subprocess
2021-11-11 11:46:55 -08:00
Rob Prentiss
7f7758bcaa update_checkout: Use 'main' for test branch
In addition to following current best practices for inclusive terms,
this also fixes an issue that occurs if a user has customized their
local git config to use an alternate default branch name (using
'init.defaultBranch').

If a user has set 'init.defaultBranch' in their git config to anything
other than master, the update_checkout tests fail. By setting the
sybolic-ref for HEAD after initializing the bare repo, the user's
setting will not affect the test.
2021-11-11 11:46:54 -08:00
Rob Prentiss
0f44c0c91d update-checkout: Explicitly use python3
This changes the shebangs for the update_checkout executable files to
specifically call Python 3. The code is already compatible and
functional with python3, so this removes any implied backward
compatibility, and removes any ambiguity based on the user's current
environment, especially since some systems, like macOS, still link
'python' to Python 2.

This also removes the now unnecessary 'from __future__' imports.
2021-11-10 15:29:38 -08:00
Mishal Shah
2ff10a57f4 Update the branch for swift-format to swift-5.5-branch 2021-11-10 09:32:29 -08:00
Jake Petroules
ffbb63c519 Update swift-argument-parser 2021-11-09 13:38:40 -08:00
Franklin Schrans
0a04ccec1b Merge pull request #39723 from d-ronnqvist/add-docc-in-build-script
[BuildScript] Add products for Swift-DocC and Swift-DocC-Render
2021-11-02 09:55:17 +00:00
Mishal Shah
0a7272b466 Add support for new rebranch 2021-10-26 23:08:49 -07:00
Ethan Kusters
6fff54d215 Use swift-docc-render-artifact instead of building swift-docc-render 2021-10-19 17:26:02 -07:00
David Rönnqvist
f662d50684 Add build script products for Swift-DocC and Swift-DocC-Render
(rdar://79703353)
2021-10-13 12:36:28 -07:00
Mishal Shah
6c252d06e4 Clean up update-checkout json file 2021-10-11 10:01:31 -07:00
swift-ci
c51550f30e Merge remote-tracking branch 'origin/main' into rebranch 2021-09-30 15:11:41 -07:00
tomer doron
10c9b67f96 Update update-checkout-config.json 2021-09-29 16:38:29 -07:00
Mishal Shah
9d3b7590ef Update llvm-project branch to stable/20210726 2021-09-27 15:57:14 -07:00
tomer doron
54b015b687 update versions of stdlib libraries
update versions of stdlib libraries

swift-atomics -> 1.0.1
swift-collections -> 1.0.0
swift-numerics -> 1.0.1
swift-system -> 1.0.0
2021-09-13 10:51:41 -07:00
tomer doron
398e5f6c4a update swift-collections to 0.0.5 2021-08-13 21:26:10 -07:00