Commit Graph

848 Commits

Author SHA1 Message Date
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
Mishal Shah
06a4040d62 Update the log timer to use context manager 2022-02-06 15:04:36 -08:00
Mishal Shah
d184322fc9 Add time summary at the end of the build 2022-02-05 12:20:05 -08:00
Mishal Shah
54c24dc7c6 [Build System] Add support to log build times for each products 2022-02-04 18:13:30 -08:00
Eric Miotto
339d49cf3c Amend path to compiler-rt sources 2022-02-03 12:59:07 -08:00
Eric Miotto
0537d209fd Invoke correct CMake when building tsan libdispatch
This should address a build failure on TSAN - libdispatch Linux bots

Addresses rdar://88339546
2022-02-01 12:57:48 -08:00
Ikko Ashimine
114e5d1deb [build] Fix typo in host_specific_configuration.py
seperate -> separate
2022-01-28 01:07:02 +09:00
Max Desiatov
28c92b61cc swift_build_support: fix build -> built typo 2022-01-25 11:39:49 +00:00
Butta
3e7717673d [build] Add a flag that allows disabling appending the host target's name to the install-destdir for a cross-compiled toolchain
This is useful if you're cross-compiling the toolchain for a single host and don't
want your specified install path modified.
2022-01-17 22:57:48 +05:30
Robert Widmann
9429514268 Merge pull request #40659 from buttaface/stdlib-remove-icu
[build] Remove last vestiges of ICU for anything other than Foundation
2022-01-07 00:36:13 -08:00
David Smith
a10d98e6fe Fix Python tests for new build flag 2022-01-05 12:40:06 -08:00
David Smith
48399afb03 Merge branch 'main' into unicodectomy 2022-01-03 22:57:37 -08:00
Butta
2890d15da7 [build] Remove last vestiges of ICU for anything other than Foundation 2021-12-25 21:16:34 +05:30
Saleem Abdulrasool
d1bb98b11e Merge pull request #40625 from buttaface/droid-remove-icu
[android] Remove ICU build flags since that requirement was dropped in #40340
2021-12-23 09:31:05 -06:00
Erik Eckstein
3d33f11e6c cmake/build-script: rename the libswift option to "bootstrapping"
In cmake, rename LIBSWIFT_BUILD_MODE to BOOTSTRAPPING_MODE.
Also, rename the lit feature "libswift" to "swift_in_compiler".
2021-12-22 11:31:52 +01:00
David Smith
f1a5e27821 Add a build flag to disable building Unicode support 2021-12-21 17:26:15 -08:00
Rob Prentiss
d39de7fa52 Merge pull request #40615 from jorng/swift_build_support_filter
Use list comprehension for filter in swift_build_support
2021-12-20 14:31:31 -08:00
Butta
a3ea28ff19 [android] Remove ICU build flags since that requirement was dropped in #40340 2021-12-20 12:06:13 +05:30
Michael Ilseman
7bff9da67d Revert "Revert "Merge pull request #40595 from hamishknight/straw-bales"" 2021-12-19 10:08:48 -07:00
Arnold Schwaighofer
9511994e52 Revert "Merge pull request #40595 from hamishknight/straw-bales"
This reverts commit a67a0436f7, reversing
changes made to 9965df76d0.

This commit or the earlier commit this commit is based on (#40531) broke the
incremental bot.
2021-12-18 11:02:37 -08:00
Rob Prentiss
ec6bc59509 Use list comprehension for filter
In python3, 'filter' returns an interable which doesn't support using
'len()'. This switches to a list comprehension, so that we can check the
length of 'enabled_pipeline'.

This is required to move build-script to Python3.
2021-12-17 12:14:02 -08: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
Eric Miotto
fb2ecaa8e2 Add an option to not build the private part of the Standard Library (#40548)
This can be useful to reduce build times in certain configurations (e.g.
when we don't run tests).

Addresses rdar://86474460
2021-12-16 15:37:45 -08:00
Michael Gottesman
1ba8317de9 Merge pull request #36917 from buttaface/swiftpm
[build] Allow cross-compiling build-script products for non-Darwin hosts too
2021-12-11 13:03:13 -08:00
Eric Miotto
403ccd4072 Extend freestanding to support targeting Darwin platforms (#40202)
* add an option to add freestanding to the Darwin platform, so that
  to get expected compile behaviours (e.g. setting the install name)
* rework testing configuration to relax assumptions about freestanding
* add a preset to test such configuration (at least for PR testing)

Addresses rdar://85465396
2021-12-08 07:09:44 -08:00
Butta
e9eb3b06c1 [build] Switch get_install_destdir() and other duplicated logic to the new host_install_destdir() 2021-12-08 13:52:29 +05:30
Butta
ec43ef1b37 [build] Allow cross-compiling build-script products for non-Darwin hosts too
To that end, move the --cross-compile-deps-path flag from build-script-impl to a
publicly documented build-script flag and use it for build-script products'
library dependencies too. Generate a SPM destination JSON file that can be used
both for cross-compiling these build-script products and by users for their own
Swift packages.

Also, add a native_toolchain_path() method, that uses a prebuilt toolchain if
available, and pass an install prefix in to swift-driver and sourcekit-lsp.
2021-12-08 13:52:28 +05:30
Mishal Shah
465f9690df Revert "build-swift: Explicitly use python3" 2021-12-03 14:29:36 -08:00
swift-ci
7b2eb1f821 Merge pull request #39987 from Catfish-Man/printf-in-this-economy 2021-12-03 05:23:56 -08:00
David Smith
fc3e718771 Initial support for compile-time generation of vprintf format strings, behind the SWIFT_STDLIB_STATIC_PRINT flag 2021-12-02 16:58:36 -08:00
Rob Prentiss
8e9e11c31d Use list comprehension for filter
In python3, 'filter' returns an interable which doesn't support using
'len()'. This switches to a list comprehension, so that we can check the
length of 'enabled_pipeline'.

This is required to move build-swift to Python3.
2021-12-01 10:56:56 -08:00
Gwynne Raskind
00b95911fe While we're at it, when echoing output from shell.run(), echo the command that's running _before_ executing it instead of after so the user can actually see what's going on instead of getting confused by the ordering of the output after the fact. 2021-11-26 12:11:58 -06:00
Gwynne Raskind
900a8e27b1 Fix input environment not being respected by shell.run() 2021-11-26 11:45:06 -06:00
Richard Wei
65bffd7ad7 Add _MatchingEngine and _StringProcessing modules.
These modules are part of the experimental declarative string processing feature. If accepted to the Standard Library, _StringProcessing will be available via implicit import just like _Concurrency, though _MatchingEngine will still be hidden as an implementation detail.

`_MatchingEngine` will contain the general-purpose pattern matching engine ISA, bytecode, and executor. `_StringProcessing` will contain regular expression and pattern matching APIs whose implementation depends on the matching engine..

Also consolidates frontend flag `-enable-experimental-regex` as `-enable-experimental-string-processing`.

Resolves rdar://85478647.
2021-11-19 09:27:33 -08:00
buttaface
30c292ca87 [android] Update to NDK 23b (#39921)
The latest Long Term Support NDK finally removed binutils, including the bfd/gold
linkers and libgcc. This simplifies our Android support, including making lld the
default linker for Android. Disable three reflection tests that now fail, likely
related to issues with swift-reflection-dump and switching to lld.
2021-11-17 20:58:42 -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
Ethan Kusters
4d7383366b Add get_dependencies method to Swift-DocC-Render script
Adding the required `get_dependencies` class method should resolve the remaining test failures we're seeing for macOS toolchain builds.
2021-10-29 14:11:32 -07:00
Doug Gregor
6d0abdf1da Fix infernal Python linter warnings 2021-10-26 22:18:43 -07:00
Doug Gregor
7591d44996 Propagate Swift version information to the back-deployed binaries 2021-10-26 20:58:06 -07:00
Ethan Kusters
6fff54d215 Use swift-docc-render-artifact instead of building swift-docc-render 2021-10-19 17:26:02 -07:00
Saleem Abdulrasool
15a5d2c54b Revert "[android] Update to NDK 23" 2021-10-16 11:07:23 -07:00
swift-ci
46f3cc9dd8 Merge pull request #39045 from buttaface/android-ndk-23 2021-10-15 20:55:19 -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
Butta
7fa1b4b2ac [android] Update to NDK 23
The latest Long Term Support NDK finally removed binutils, including the bfd/gold
linkers and libgcc. This simplifies our Android support, including making lld the
default linker for Android. Disable three reflection tests that now fail, likely
related to issues with swift-reflection-dump and switching to lld.

Also, add the libatomic dependency for Android armv7, just as on linux.
2021-10-12 12:37:01 +05:30