Commit Graph

941 Commits

Author SHA1 Message Date
Doug Gregor
4a38f03c19 Fix Python lint warnings 2022-09-16 16:08:07 -07:00
Doug Gregor
78eb881a70 Pass the early SwiftSyntax build directory down to build-script-impl.
This gives LLDB's CMake build access to the build directory.
2022-09-16 16:08:00 -07:00
Josh Soref
de23580889 spelling: toolchain
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-09-15 19:43:37 -04:00
Josh Soref
f75688fc4f spelling: that
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-09-15 19:43:37 -04:00
Josh Soref
46eda2b2da spelling: equipped
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-09-15 19:43:37 -04: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
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
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
Saleem Abdulrasool
1eb294d95b Merge pull request #60823 from 3405691582/cross
Preliminary Linux-OpenBSD cross-compile support.
2022-08-31 08:28:02 -07: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
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
YOCKOW
d10381557b [NFC] Python Lint: Fix E275(missing whitespace after keyword) issues. 2022-08-21 16:07:07 +09:00
Alex Hoppen
059128feca Build indexstore-db and sourcekit-lsp in a unified build 2022-08-05 19:04:02 +02:00
Mishal Shah
196ee143c5 Xcode 14 beta 4 no longer supports iOS armv7, armv7s, and i386 architectures
> Building iOS projects with deployment targets for the armv7, armv7s, and i386 architectures is no longer supported. (92831716)
2022-08-02 20:42:08 -07:00
Alex Hoppen
c488f76075 Don’t cross-compile sourcekit-lsp and indexstore-db when running tests
Running swift test with `--test-product SourceKitLSPPackageTest` fails when cross-compiling with an error message like the following (rdar://97876450)
```
error: Could not find target named 'SourceKitLSPPackageTests_-6F17C3BE20775DA1_PackageProduct'
```

Since we don’t run the test on the cross-compile host anyway, just disable cross-compilation during testing.
2022-08-02 18:47:58 +02:00
Mishal Shah
caf9bf5d7b Merge pull request #41223 from apple/log-build-time
[Build System] Add support to log build times for each products
2022-07-28 10:39:29 -07:00
Mishal Shah
dbf9aca8b0 Only clean the log file if it exists 2022-07-15 01:39:50 -07:00
Keith Smiley
a61af54545 [build] Ignore .git in ninja copy
As part of the build the entire ninja source dir is copied to the build
dir and then built. When using git's fsmonitor feature the .git
directory contains a socket which causes the copytree to fail. With this
change .git is ignored entirely instead. Error:

```
Traceback (most recent call last):
  ...
  File "/Users/ksmiley/dev/oss-swift/swift/utils/swift_build_support/swift_build_support/build_script_invocation.py", line 69, in build_ninja
    ninja_build.build()
  File "/Users/ksmiley/dev/oss-swift/swift/utils/swift_build_support/swift_build_support/products/ninja.py", line 80, in build
    shell.copytree(self.source_dir, self.build_dir)
  File "/Users/ksmiley/dev/oss-swift/swift/utils/swift_build_support/swift_build_support/shell.py", line 193, in copytree
    shutil.copytree(src, dest)
  File "/Users/ksmiley/.pyenv/versions/3.10.2/lib/python3.10/shutil.py", line 556, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/Users/ksmiley/.pyenv/versions/3.10.2/lib/python3.10/shutil.py", line 512, in _copytree
    raise Error(errors)
shutil.Error: [('/Users/ksmiley/dev/oss-swift/ninja/.git/fsmonitor--daemon.ipc', '/Users/ksmiley/dev/oss-swift/build/buildbot_osx/ninja-build/.git/fsmonitor--daemon.ipc', "[Errno 102] Operation not supported on socket: '/Users/ksmiley/dev/oss-swift/ninja/.git/fsmonitor--daemon.ipc'")]
```
2022-07-12 08:37:49 -07:00
QuietMisdreavus
872d4ff12e tell CTest to print on failure for cmark tests (#59978) 2022-07-12 09:20:15 -06:00
Kim de Vos
adbeb8b4e9 [SwiftSyntax] Clean build script
https://github.com/apple/swift-syntax/pull/458
2022-06-26 21:19:51 +02:00
Mishal Shah
4c19ba404b Merge branch 'main' into log-build-time 2022-06-08 16:55:34 -07:00
Alex Hoppen
ed213004f2 Merge pull request #59046 from ahoppen/pr/fat-sourcekit-lsp
[build-script] Cross-compile sourcekit-lsp for arm64
2022-06-01 09:34:14 +02:00
Alex Hoppen
c1994b4ae3 [build-script] Cross-compile sourcekit-lsp for arm64
Currently, when building an open source toolchain, SourceKit-LSP is only built for x86_64. Copy the cross-compilation config from swiftpm.py to also produce a fat sourcekit-lsp executable for both x86_64 and arm64.

rdar://78039145
2022-05-27 10:30:34 +02:00
Alex Hoppen
e2012dddf3 Merge pull request #41314 from ahoppen/pr/build-lld
[build-script] Add option to build lld as part of LLVM
2022-05-25 07:58:54 +02:00
Alex Hoppen
7712387cd2 [Build System] Don't clean sourcekit-lsp prior to running tests
Previously, we were always cleaning the sourcekit-lsp build directory prior to running tests and installing. That’s a waste of time. Only clean prior to the first build.
2022-05-24 13:03:44 +02:00
Mishal Shah
d292a852d8 Merge pull request #40188 from apple/QuietMisdreavus/cmark
use swift-cmark/gfm instead of /main
2022-05-02 10:20:23 -07:00
Daniel Duan
3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
Alex Hoppen
e313df88ce [build-script] Add option to build lld as part of LLVM 2022-04-12 16:38:34 +02:00
Evan Wilde
ef8c14996d Add curl build product
Add libcurl as a build product. This is another piece required to build
foundation in a freestanding configuration.
2022-04-11 20:39:33 -07:00
Evan Wilde
d7184742de Add zlib build product
This patch adds a zlib and static-zlib build product, respectively
producing a dynamic and static zlib library. This is a dependency of
building Foundation.
2022-04-11 20:39:32 -07:00
Evan Wilde
91578162e1 Add libxml2 build product
This patch adds the libxml2 build product as a dependency of building
foundation.
2022-04-11 20:39:32 -07:00
Daniel Duan
025079466a [utils] Remove Python 2
The library `six` provides compatibility between Python 2, and 3. It's no
longer necessary once we migrate of Python 2 completely.

Also remove any custom logic for Python 2 (the ones referenced by
a commentanyways).

https://bugs.swift.org/browse/SR-16025
2022-03-20 13:22:04 -07:00
Victoria Mitchell
64cc4d032b set CMARK_THREADING in cmark-gfm 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
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
a11b8d9c18 [utils] shell.run: Flush stdout/stderr after printing 2022-03-08 19:26:35 -08:00
Karoy Lorentey
da265feaa1 [utils] shell.run: Stop printing the cwd to stdout before each command 2022-03-08 18:38:44 -08:00
Karoy Lorentey
d0e377e737 [utils] Use Python 2 compatible name for text=True 2022-03-08 12:03:56 -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
Robert Widmann
7cd3541c62 Merge pull request #41656 from MillerTechnologyPeru/feature/ppc32
[stdlib] Added PowerPC 32-bit support
2022-03-07 15:08:26 -08:00
Alsey Coleman Miller
b85e673a78 [stdlib] Added Armv5 support 2022-03-06 00:56:32 -05:00
Alsey Coleman Miller
0ab3eec987 Added PowerPC 32-bit support 2022-03-03 22:21:33 -05:00
Eric Miotto
e442511352 Don't include benchmarks when buildilng back deploy concurrency 2022-02-10 11:54:06 -08:00
Eric Miotto
f417630054 Add option to reduce build times when using ThinLTO and ld64 (#41058)
Internal configurations targeting Darwin employ ThinLTO to
improve compiler performance, however using it on all executable
causes build time to increase with no matching benefit.

To reduce build times in such configurations, we allow some
ancillary targets to opt out of LLVM IR optimizations when linking
ThinLTO with ld64 (e.g. tools used for bootstrapping or debugging the
Swift compiler) -- this behaviour is opt in through a new flag
`--swift-tools-ld64-lto-codegen-only-for-supporting-targets`.

Addresses rdar://76702687
2022-02-09 08:22:02 -08:00