Commit Graph

6519 Commits

Author SHA1 Message Date
Kavon Farvardin
e9ba998723 emit a message when falling-back to xcrun dyldinfo 2022-09-15 15:36:30 -07:00
Hamish Knight
a7e5f286ea Merge pull request #61096 from hamishknight/explicit-lit 2022-09-15 17:56:52 +01:00
Hamish Knight
cfda4b1764 [build-script] Allow specifying the number of lit workers
Allow tests to run with a different number of
workers than build jobs if desired.
2022-09-14 14:01:49 +01:00
Egor Zhdan
84a1ffcb33 [Shims] Include SwiftShims headers without ../
This replaces a number of `#include`-s like this:
```
#include "../../../stdlib/public/SwiftShims/Visibility.h"
```
with this:
```
#include "swift/shims/Visibility.h"
```

This is needed to allow SwiftCompilerSources to use C++ headers which include SwiftShims headers. Currently trying to do that results in errors:
```
swift/swift/include/swift/Demangling/../../../stdlib/public/SwiftShims/module.modulemap:1:8: error: redefinition of module 'SwiftShims'
module SwiftShims {
       ^
Builds.noindex/swift/swift/bootstrapping0/lib/swift/shims/module.modulemap:1:8: note: previously defined here
module SwiftShims {
       ^
```
This happens because the headers in both the source dir and the build dir refer to SwiftShims headers by relative path, and both the source root and the build root contain SwiftShims headers (which are equivalent, but since they are located in different dirs, Clang treats them as different modules).
2022-09-14 11:14:50 +01:00
Mishal Shah
bba1a0081a Add no-assertions preset for Linux
(cherry picked from commit 581a49f37e)
2022-09-10 13:39:09 -07:00
Mishal Shah
7b08297cdc Add preset with no_assertions and no_test for Linux
(cherry picked from commit a7cc57a7c6)
2022-09-10 13:39:09 -07:00
Keith Smiley
03861d3c6b Add Xcode 14 14A309 to supported build versions 2022-09-08 16:31:59 -07:00
Eric Miotto
ba2a88a33a Rely on macOS deployment target set by compiler-rt for sanitizers
Using newer targets can lead to build failures, see

41c52889b9
b87fc09dce

This has no effect currently, it is meant to support the switch
to `LLVM_ENABLE_RUNTIMES` to build compiler-rt -- #58465

Addresses rdar://99140817
2022-09-07 01:30:52 -07:00
Doug Gregor
5f49ba1887 Merge pull request #60888 from DougGregor/round-trip-new-swift-parser
Optional support for round-trip testing the new Swift parser.
2022-09-01 21:11:27 -07:00
Doug Gregor
3f9f16f4d2 [Build] Work around build-scripts single-root requirement.
Replace the correct Swift -> EarlySwiftSyntax dependency with an
EarlySwiftDriver -> EarlySwiftSyntax dependency, to keep a linear
dependency order in this part of the build graph.
2022-09-01 11:45:16 -07:00
YR Chen
bb2dcef639 [build-windows] Minor cleanup 2022-09-02 00:54:45 +08:00
YR Chen
f7542aeb5a [build-windows-toolchain] Fix SwiftSyntax dependency 2022-09-02 00:54:11 +08:00
Doug Gregor
6854355b08 Address Python lint and testing issues 2022-09-01 08:56:22 -07:00
Doug Gregor
5ea5f3b45d Optional support for round-trip testing the new Swift parser.
When enabled, compile in support for round-trip testing the new
SwiftSyntax-provided Swift parser alongside the existing parser. Right
now, this means parsing every source file with the new parser and
ensuring that the resulting syntax tree can reproduce the input source
precisely. Over time, this is expected to grow.

Opt in to this behavior by passing the following to build-script:

    build-script --early-swiftsyntax --extra-cmake-options=-DSWIFT_SWIFT_PARSER_MODE:STRING=ROUNDTRIP
2022-09-01 08:56:22 -07:00
Robert Widmann
6f3cdb6c02 Update Windows Build Scripts 2022-08-31 13:53:52 -07:00
Robert Widmann
f9cff13604 Move All the Gyb Support for Syntax out of Swift
Make libSyntax depend on swift-syntax: the new home for all
of this infrastructure. This greatly simplifies the addition and
amending of syntax nodes as only the swift-syntax paired with a
swift checkout will need to be changed. This is in contrast to
the existing build flow where a paired PR to both repos must be
made to change anything here.

Note that a paired PR may still be required if the legacy parser
needs to be adjusted in response to syntax nodes changing, but I
anticipate this to be a much more infrequent event now that
the C++ end of libSyntax is deprecated.
2022-08-31 13:10:24 -07:00
Alex Hoppen
f54e9906a2 Merge pull request #60847 from ahoppen/ahoppen/node-name-for-diagnostics
[SwiftSyntax] Add a human readable name for diagnostics to all nodes
2022-08-31 20:11:23 +02:00
Saleem Abdulrasool
1eb294d95b Merge pull request #60823 from 3405691582/cross
Preliminary Linux-OpenBSD cross-compile support.
2022-08-31 08:28:02 -07:00
Alex Hoppen
a4bd91a57f [SwiftSyntax] Add a human readable name for diagnostics to all nodes 2022-08-30 09:58:29 +02:00
Eric Miotto
f7a11c7543 Tests all cases of infer-cross-compile-hosts-on-darwin at once (#60824)
The current implementation currently requires to have physical machine
for each architecture supported by macOS, which is not desirable.

To allow all cases to be tested on a random Mac machine, allow
to inject an arbitratry current architecture into the inference
of the cross compile hosts by means of an environment variable.

Addresses rdar://99096874
2022-08-30 00:10:40 -07:00
3405691582
3740a207bd Apply suggestions from code review
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2022-08-29 10:47:42 -04:00
3405691582
47ae4d9a53 Preliminary Linux-OpenBSD cross-compile support.
With a properly prepared sysroot and toolchain file, these changes permit
cross-compilation of Swift as well as LLVM, CMark, and Dispatch (picking,
as usual, apple/swift-corelibs-libdispatch#556) from a Linux host
generating OpenBSD binaries.

The toolchain file must be specified as an environment variable to
`build-script` and discussion on how to properly set up the sysroot and
toolchain file will be handled later.
2022-08-28 22:39:46 -04:00
Doug Gregor
98e50258b8 Merge pull request #60814 from DougGregor/build-early-swiftsyntax
[build-script] Support building "early" SwiftSyntax via `--early-swiftsyntax`
2022-08-27 23:01:25 -07:00
Doug Gregor
5ae31c0029 Address Python linting failures 2022-08-27 07:25:32 -07:00
Doug Gregor
e771660526 [build-script] Support building "early" SwiftSyntax via --early-swiftsyntax
Similar to the way the early Swift Driver is built, introduce a
build-script option `--early-swiftsyntax` that uses the host Swift and
CMake to build the parts of the swift-syntax package that are expected
to become be used in the compiler.

Note that this does not obviate the need for the `--swiftsyntax`
option, because that build product uses the just-built Swift compiler
and SwiftPM to build, test, and install everything from the
swift-syntax package.
2022-08-27 00:06:09 -07:00
YOCKOW
c1e154a9cb [Gardening] Remove trailing whitespaces in Python scripts. (W291)
That has been marked as 'FIXME' for three years.
This commit fixes it.
2022-08-25 16:08:36 +09:00
Doug Gregor
cf337a79b5 Merge pull request #60731 from rintaro/syntax-unresolved-as-is
[Syntax] Introduce UnresolvedIsExpr/UnresolvedAsExpr
2022-08-23 21:21:29 -07:00
Rintaro Ishizaki
ed34dfc637 [Syntax] Introduce UnresolvedIsExpr/UnresolvedAsExpr
SequenceExprSyntax should have odd number elements. Previously 'a as b'
was parsed like:
```
(sequence_expr
  (identifier_expr "a"),
  (as_expr
    'as'
    (typeidentifier "b")))
```
So it had even number elements. Now it's parsed
```
(sequence_expr
  (identifier_expr "a"),
  (unresolved_as_expr 'as')
  (type_expr
    (typeidentifier "b")))
```
2022-08-23 13:03:18 -07:00
Eric Miotto
67b23d7d45 Merge pull request #60664 from edymtt/infer-cross-compile-hosts-on-darwin
Add a flag to infer appropriate cross compile hosts on Darwin
2022-08-23 07:04:36 -07:00
swift-ci
ae9f355645 Merge pull request #60023 from keith/ks/build-add-swift-autolink-extract-to-macos-toolchains
[build] Add swift-autolink-extract to macOS toolchains
2022-08-22 14:43:48 -07:00
swift-ci
920c6deeb7 Merge pull request #60017 from keith/ks/build-ignore-.git-in-ninja-copy
[build] Ignore .git in ninja copy
2022-08-22 14:29:31 -07:00
Eric Miotto
778c7382a4 Infer automatically cross compile hosts for macOS package presets
Addresses rdar://98787335, apple#60348
2022-08-22 09:38:21 -07:00
Eric Miotto
c954130be0 Add a flag to infer appropriate cross compile hosts on Darwin
Addresses rdar://98787335, apple#60348
2022-08-22 09:37:52 -07:00
Saleem Abdulrasool
b31a955ada Merge pull request #60678 from stevapple/build-windows-cleanup
[build-windows] Minor cleanups
2022-08-22 07:46:35 -07:00
WeZZard
3a897fcdaa Makes build-script to support None and string object SystemExit.code 2022-08-22 15:18:57 +08:00
stevapple
16653c5182 [build-windows] Update dependency version
... to keep in sync with `build-windows-toolchain` and CI environment.
2022-08-21 15:23:28 +08:00
stevapple
4e61c08796 [build-windows] Fix typo 2022-08-21 15:16:02 +08:00
YOCKOW
d10381557b [NFC] Python Lint: Fix E275(missing whitespace after keyword) issues. 2022-08-21 16:07:07 +09:00
YR Chen
92c85a062c [build-windows] Remove hard-coded C:
.. and use `%SystemDrive%` instead to enhance robustness.
2022-08-20 23:43:08 +08:00
YR Chen
05b61be2a6 [build-windows] Don't download ICU
...until we want to build Foundation.
2022-08-20 23:43:07 +08:00
Alex Hoppen
a850a0171c Merge pull request #60635 from ahoppen/pr/rawsyntax-split
[SwiftSyntax] Adjustment for changed RawSyntax API
2022-08-19 12:24:18 +02:00
YOCKOW
c615c5ab5b Merge pull request #60618 from YOCKOW/neatness
[build-script] Omit "Build Script Analyzer" when `SystemExit` is caught.
2022-08-19 16:29:13 +09:00
Alex Hoppen
613ef8cd47 [SwiftSyntax] Adjustment for changed RawSyntax API 2022-08-19 08:35:23 +02:00
Rintaro Ishizaki
c09ef05433 [Syntax] Add 'UnresolvedTernaryExpr'
that resembles `IfExpr` before folding in AST parsing.
2022-08-18 10:37:18 -07:00
YOCKOW
1cc4054600 [build-script] Omit "Build Script Analyzer" when SystemExit is caught.
The content of ".build_script_log" file may be debris when `SystemExit` is thrown; e.g. `--help` is passed.

Resolves https://github.com/apple/swift/issues/60567
2022-08-18 12:42:34 +09:00
Rintaro Ishizaki
85ea21cf2b Merge pull request #60563 from rintaro/no-garbage-in-swift
Terminology change: 'garbage' -> 'unexpected'
2022-08-15 17:18:42 -07:00
Mishal Shah
91b2abe996 Merge pull request #60531 from apple/pull-request-rebranch
Merge `rebranch` into  `main` to support llvm-project `stable/20220421`
2022-08-15 17:10:56 -07:00
Rintaro Ishizaki
a673043737 Terminology change: 'garbage' -> 'unexpected'
There are no "garbage" characters in Swift code. They are just
"unexpected."
2022-08-15 14:32:28 -07:00
Dario Rexin
de91842938 [Build] Update scripts to use dyld_info (#60532)
* [Build] Update scripts to use dyld_info

dyldinfo has been deprecated and will no longer be available on newer Xcode releases. It has been replaced with dyld_info. To stay compatible with older releases, we are still falling back to dyldinfo, if dyld_info is not available.

rdar://98570807

* Apply suggestions from code review

Co-authored-by: Guillaume Lessard <glessard@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Guillaume Lessard <glessard@users.noreply.github.com>
2022-08-12 17:48:05 -07:00
Mishal Shah
59db203890 Update the llvm-project branch for main to stable/20220421 2022-08-12 08:56:12 -07:00