Commit Graph

4111 Commits

Author SHA1 Message Date
Ben Langmuir
6cc14afec9 [build-script] build and test indexstore-db and sourcekit-lsp
Add support to build-script to build and test the indexstore-db and
sourcekit-lsp projects. A future change will add support for installing
these products and putting them in the toolchain.  To build the new
products, add the `--sourcekit-lsp` or `--indexstore-db` options to a
`build-script` invocation.

We add the notion of a Product that is not part of build-script-impl and
build these products after the install phase of build-script-impl. These
products are built using the installed toolchain - either using the
default location within the build subdirectory, or the user-specified
`--install-dest`. This is somewhat rigid setup, since it requires the
toolchain used to build to be the same as the final installed toolchain
(if any), but it makes for a simpler change to the existing builds while
still making progress towards a toolchain-based build model.

*Note*: currently, if you are not using a preset you will need to
manually specify all of the dependencies (on macOS this is
swiftpm and llbuild, on other platforms you additionally need
libdispatch, icu, foundation, and xctest), and the install flags for the
same projects (`--install-llbuild --install-swiftpm ...`). This is not
particularly user-friendly, but it matches the current behaviour of the
other targets, and there is not yet any infrastructure in build-script
to describe these dependencies.
2019-02-04 14:44:22 -08:00
Ben Langmuir
3656084c11 [build-script] Add install-destdir and set a default value
Promotes this from a build-script-impl-only option and sets a default
value of <build>/toolchain-<target>.
2019-02-04 14:43:45 -08:00
Ben Langmuir
8eed9260de Merge pull request #22346 from benlangmuir/libcxx
[build-script] Add Product for libc++
2019-02-04 14:40:35 -08:00
Ben Langmuir
80b6b3abca Conditionalize libc++ installation 2019-02-04 13:21:18 -08:00
Saleem Abdulrasool
0919b1b5a0 Merge pull request #22332 from compnerd/long-long-long
utils: adjust to support long paths on windows
2019-02-04 13:00:25 -08:00
Ben Langmuir
5cdc15bd84 Fix pylint error 2019-02-04 12:02:58 -08:00
Xi Ge
29a4ca8519 cmake: allow SwiftSyntax parser to have an externally defined version number in the dylib 2019-02-04 10:55:39 -08:00
Ben Langmuir
a20050ab30 [build-script] Add Product for libc++
In a non-legacy-impl world, this is needed to trigger
building/installing libc++.

https://bugs.swift.org/browse/SR-9861
2019-02-04 10:26:36 -08:00
Saleem Abdulrasool
bc8aa4b4e9 utils: adjust to support long paths on windows
Windows restricts paths to 251 characters.  Using unicode paths will
allow us to go down the `_wfopen` path which permits the use of the NT
path to actually use long paths.
2019-02-04 08:36:49 -08:00
Xi Ge
035f32868d build-script: teach the script to extract symbols when building libSyntax parser only. 2019-02-01 13:52:34 -08:00
Saleem Abdulrasool
58cc900484 Merge pull request #22228 from compnerd/cmake-is-hard
utils: simplify the lldb build-script-impl invocation
2019-01-30 16:55:52 -08:00
Saleem Abdulrasool
b3b9de7242 utils: simplify the lldb build-script-impl invocation
Merge the cmake invocation for lldb on MacOS and the other targets.
2019-01-30 14:05:38 -08:00
Alex Lorenz
78d759ad69 Merge pull request #22184 from hyp/buildInstallClangAndClangd
Build and install 'clang' and 'clangd' in the macOS & linux toolchains
2019-01-30 12:07:51 -08:00
Xi Ge
283de9f997 Merge pull request #22220 from nkcsgexi/xcbuild-ss-flag
build-script: add a flag to skip building/installing swift-syntax's swift side
2019-01-29 15:36:32 -08:00
Xi Ge
b944b683de build-script: add a flag to skip building/installing swift-syntax's swift side artifacts. 2019-01-29 14:44:40 -08:00
Saleem Abdulrasool
f199222d97 utils: remove LLDB_PATH_TO_CMARK_BUILD
This has been removed from the lldb build, so we no longer need to pass
this along to lldb's CMake invocation.
2019-01-29 10:40:58 -08:00
Ben Langmuir
c1744de648 Merge pull request #22193 from benlangmuir/crash-cmake-less
Re-apply "Set a reasonable default for SWIFT_INSTALL_COMPONENTS"
2019-01-29 09:31:01 -08:00
bannzai
b1ae4c3bad Fix gyb script about add make ellipsis token type 2019-01-30 02:27:18 +09:00
Saleem Abdulrasool
ff7b2fb720 test: make incrParse tests pass on Win32
Use `w+b` mode for the files to avoid EOL style conversions on Windows.
2019-01-28 21:58:43 -08:00
Alex Lorenz
1941aaa0d6 Build and install 'clang' and 'clangd' in the macOS & linux toolchains
- Build script now builds clang_tools_extra as part of LLVM's build.
- Build script now has a new libc++ build step to allow libc++ headers to be installed in the
  resulting toolchain.
- 'clang', 'clangd', 'clang-headers' & 'compiler-rt' targets are now installed for
  the package build configurations for macOS and linux.
- 'clang-resource-dir-symlink' is used in the package build configuration for macOS and linux
  to avoid duplication of Clang's headers and compiler-rt archives.

rdar://24912710
2019-01-28 17:16:12 -08:00
Ben Langmuir
2d5fbb9f18 Re-apply "Set a reasonable default for SWIFT_INSTALL_COMPONENTS"
This reverts commit 77689f5945 (#22079)
2019-01-28 16:25:58 -08:00
Michael Gottesman
cc68e6a0d5 Remove some remaining dead code from the +0 argument convention bring up.
I already removed the option from SILOptions, so all of this stuff is dead.
2019-01-27 13:18:06 -08:00
swift-ci
b08d4c3e13 Merge pull request #22157 from compnerd/sil 2019-01-26 13:02:38 -08:00
Saleem Abdulrasool
8a1311d1c3 vim: add open and mutating keywords to SIL
Add a couple of missing modififers to the syntax highlighting for SIL in
vim.
2019-01-26 12:01:07 -08:00
Saleem Abdulrasool
1807aa32a2 build-script-impl: collapse similar cases
Collapse the various lldb build configuration into a single one where
the invocation is exactly the same.  NFC.
2019-01-25 18:02:06 -08:00
Xi Ge
c2befddc5d build-script: create SwiftSyntax install directory if it doesn't exist.
We may install SwiftSyntax to other places instead of the just-built toolchain, so
this change is necessary.
2019-01-25 13:42:46 -08:00
Ben Langmuir
dc2ea3ebbb Merge pull request #21772 from benlangmuir/no-legacy-rebase
[build-script] Turn on --no-legacy-impl by default
2019-01-24 09:14:41 -08:00
Xi Ge
ff0d764ec9 Merge pull request #22073 from nkcsgexi/PGO-swift
cmake: allow building the Swift compiler with Clang's Profile Guided Optimization (PGO)
2019-01-23 20:02:41 -08:00
Jordan Rose
77689f5945 Revert "Set a reasonable default for SWIFT_INSTALL_COMPONENTS" (#22079) 2019-01-23 19:35:09 -08:00
Xi Ge
018799cd6c cmake: allow building the Swift compiler with Clang's Profile Guided Optimization (PGO)
Previously, Build script flag --clang-profile-instr-use is only used for building
clang and llvm. This patch extends PGO to the building of the Swift compiler.
2019-01-23 18:02:43 -08:00
Xi Ge
1deee1eb63 Merge pull request #22065 from nkcsgexi/build-dir-pre
build-script: allow users to specify build-dir under the preset mode.
2019-01-23 14:39:47 -08:00
Xi Ge
fbcdbe14c1 build-script: being verbose when building SwiftSyntax release. 2019-01-23 13:47:22 -08:00
Xi Ge
08e5028c49 build-script: allow users to specify build-dir under the preset mode. 2019-01-23 11:21:24 -08:00
Xi Ge
5742ced405 build-script: enable lto while building SwiftSyntax release. 2019-01-22 15:48:08 -08:00
Xi Ge
43e7801606 build-script: install libParser header files to destination. 2019-01-22 15:48:08 -08:00
Ben Langmuir
08eabb46c6 Update --*-cmake-options to use format() 2019-01-22 15:37:50 -08:00
Ben Langmuir
5dbe28bf13 Update for feedback 2019-01-22 15:37:50 -08:00
Ben Langmuir
5619138a10 [build-script] Turn on --no-legacy-impl by default
Turns on the `--no-legacy-impl` option to build-script by default; the
old behaviour is temporarily still available as `--legacy-impl`.

This causes build-script to invoke build-script-impl for every
individual build/test/install/etc. action rather than a single global
invocation. For example, a single invocation might be for
`macosx-swift-install`. This will enable the python code in build-script
to drive the overall process and add additional steps in between actions
without the involvement of build-script-impl. It also provides a path to
refactoring the existing actions out of build-script-impl individually.

Discussed as part of https://forums.swift.org/t/rfc-building-swift-packages-in-build-script/18920

The --no-legacy-impl flag was originally disabled by default because of
concerns about the performance of null builds due to the increased
number of script invocations. There is a small optimization in this
commit to use `tr` when processing command-line options instead of
bash's builtin substitution, which eliminates most of the overhead.
After this change, a null build of llvm+swift changes from 1.6 s to
2.1 s on Linux, and from 5 s to 6 s on macOS.  Non-null builds and
builds that involve more build products than just llvm+swift (e.g.
corelibs) are basically unaffected since they are not correctly
incremental to begin with.

The changes to build-script-impl in this commit are to fix the behaviour
of --no-legacy-impl, which had bitrotted since it was introduced. These
changes are to make various parts of the script not rely on variables
defined in "earlier" parts of the script, which is good hygiene in
general.
2019-01-22 15:37:50 -08:00
Xi Ge
ced5044991 build-script: add a flag to separately install SwiftSyntax artifacts.
This flag '--swiftsyntax-install-prefix' could be used in the preset mode
to specify an installation dir. If we are building SwiftSyntax without building
the rest of the compiler, we'll install the SwiftSyntax modules and dylibs
with lib_InternalSwiftSyntaxParser.dylib to the given directory directly, ignoring
the conventional toolchain locations.
2019-01-22 11:59:39 -08:00
Marcelo Fabri
f61751bdcf [SR-9630][SourceKit] Add request to get compiler version 2019-01-20 10:39:25 -08:00
Xi Ge
db684a9e4c Merge pull request #21989 from nkcsgexi/preset
build-script/presets: add a preset to only build parser library and SwiftSyntax
2019-01-18 17:12:20 -08:00
Xi Ge
c73a9580ca build-script/presets: add a preset to only build parser library and SwiftSyntax 2019-01-18 15:58:19 -08:00
Harlan Haskins
26d8262e0a Merge pull request #21963 from harlanhaskins/throw-it-at-the-wall-and-see-what-sticks
[utils] Add wall time to rusage
2019-01-18 13:48:26 -08:00
Harlan Haskins
31f8859bb0 [utils] Add wall time to rusage
This just add a --wall-time flag to rusage.py, which will print the wall
time.
2019-01-18 10:02:03 -08:00
Gwynne Raskind
542d02a60e Merge pull request #21911 from gwynne/replace-deprecated-assertEquals
Replace deprecated Python unit test method usage
2019-01-18 10:06:13 -06:00
Max Moiseev
fce2c19c0c Merge pull request #21939 from ebainville/compression-overlay
InputFilter, OutputFilter overlay for the Darwin Compression stream API
2019-01-17 19:14:05 -08:00
Xi Ge
3dda7eee0e Merge pull request #21901 from nkcsgexi/libparser-build
WIP: build-script: add a flag to build libSwiftSyntaxParser only.
2019-01-17 16:57:45 -08:00
Xi Ge
eefa0b1595 build-script: add a flag to build libSwiftSyntaxParser only. 2019-01-17 16:05:46 -08:00
Xi Ge
758e4a28c2 SyntaxNodes: subsume DotSelfExpr and ImplicitMemberExpr by MemberAccessExpr.
Per our discussion in another PR, having these three similar nodes at
the same time  may unnecessarily complicate client side.
2019-01-17 14:15:53 -08:00
Maxim Moiseev
602fb86740 Add compression to find-overlay-deps-closure.sh 2019-01-17 13:58:20 -08:00