Commit Graph

968 Commits

Author SHA1 Message Date
Brian Gesiak
ca3e11b2d6 [build-script] Determine HOST_CC in build-script
https://bugs.swift.org/browse/SR-237 calls for `build-script` and
`build-script-impl` to be merged. This commit takes another step towards
that goal by moving the logic that finds the path to the `clang` and
`clang++` executables up into Python-land.

Rather than simply moving all of the logic into `utils/build-script`,
this commit moves relevant functions into a new Python module, named
`swift_build_support`. This has several benefits:

- The logic can be tested. Whereas `build-script-impl` needed to be run
  in order to verify its behavior, the logic extracted out of it into
  `swift_build_support` can be tested in isolation.
- The logic can be split up into several files without polluting the
  `utils` directory, which now contains many different files that are
  unrelated to `build-script`.
2015-12-27 02:35:32 -05:00
Dmitri Gribenko
4a9a6a2056 build-script: fix syntax error in the shell script
Use ${} to expand variables instead of $().
2015-12-24 03:21:22 -08:00
Brian Gesiak
25af095446 [build-script] Do not determine build jobs in impl
Begins work on SR-237.

Rather than determining the number of jobs to use for `make` or
`dsymutil` from within build-script-impl, this change passed in those
values from above.

Furthermore, because we can determine the number of build jobs via a
builtin Python function, we figure out the number of jobs to use from
within `utils/build-script`. Now, by default, the same number of jobs
will be used to build this project as there are cores on the host
machine. Users may still specify a different number, as before, using
the `--jobs` option.

This introduces a behavioral change. Before, running
`utils/build-script` would run something like the following `cmake`
command:

```
cmake --build /build/Ninja-DebugAssert/llvm-macosx-x86_64 -- all
```

Notice the lack of jobs specified. The new default is something like
the following:

```
cmake --build /build/Ninja-DebugAssert/llvm-macosx-x86_64 -- -j8 all
```

Notice that the number of jobs is exlicitly passed to the command.
2015-12-23 23:24:33 -05:00
practicalswift
6e3b700b44 Fix typos. 2015-12-23 00:31:13 +01:00
Dmitri Gribenko
3e6fc7d46d build-script: also look for the ninja binary under the name 'ninja-build' 2015-12-22 11:44:17 -07:00
Dmitri Gribenko
e9a435d77d build-script: allow building a pluggable performance test suite, if requested by a command line flag 2015-12-21 18:17:13 -08:00
Dmitri Gribenko
35ceb6faa8 build-script: replace tabs with spaces 2015-12-21 12:48:28 -07:00
Dmitri Gribenko
0bf708aab8 build-script: allow specifying the compiler version from a preset 2015-12-21 12:48:28 -07:00
Dmitri Gribenko
3bc99c7913 bulid-script: simplify code and use more idiomatic variable names 2015-12-19 21:28:35 -08:00
Dmitri Gribenko
f4c1f4b4a4 Disable SourceKit tests everywhere except OS X
SourceKit tests currently implicitly rely on the OS X standard library.
2015-12-19 18:31:23 -08:00
Dmitri Gribenko
3653e22e0c build-script: use a private sandbox for integration tests
This does not solve all issues, see https://bugs.swift.org/browse/SR-321
2015-12-19 18:15:15 -07:00
practicalswift
36ac5ec220 Use $(cmd) instead of discouraged cmd. 2015-12-19 20:12:11 +01:00
practicalswift
95de256761 Remove superfluous echo. 2015-12-19 20:10:23 +01:00
practicalswift
9a80e859f9 Remove unused variables. 2015-12-19 20:09:29 +01:00
Dmitri Gribenko
8e738c3126 build-script: allow to skip running SourceKit tests 2015-12-18 18:54:26 -08:00
Dmitri Gribenko
dffae4ed71 build-script: pass down the xcrun toolchain name to CMake, and to lit 2015-12-18 01:52:29 -08:00
Todd Fiala
c0c08aa58f LLDB: enable rerunning of load-sensitive tests in a low-load follow-up test pass 2015-12-16 17:04:36 -08:00
Mishal Awadah
811bdb4624 [build-script] Rename package-tests to integration-tests. 2015-12-16 13:27:30 -08:00
Mishal Awadah
41fe7910b2 [build-script] Log foundation testing steps like other targets do. 2015-12-15 11:47:10 -08:00
Davide Italiano
922114ce8f [build] Fix FreeBSD amd64 build after recent changes. 2015-12-14 23:19:39 +00:00
Dmitri Gribenko
cf97acc67d Merge pull request #529 from modocache/export-compile-commands
[build-script] Add flag to export compile commands
2015-12-13 20:15:21 -08:00
Brian Gesiak
adf6fef8d2 [build-script] Add flag to export compile commands
CMake supports generation of compilation databases. These have many uses, not
least of which is in supporting code-completion engines like
https://github.com/Valloric/YouCompleteMe.

Add the `--export-compile-commands` flag to `utils/build-script`.
Setting this flag passes `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` to CMake,
which results in a `compile_commands.json` file being generated along
with built products like `cmark`, `llvm`, and `swift`.
2015-12-13 23:04:43 -05:00
Dmitri Gribenko
15be903fe2 Merge pull request #500 from practicalswift/fix-typos-4
Fix typos (4 of 30)
2015-12-13 16:21:02 -08:00
Dmitri Gribenko
83751888c7 Start porting Swift to Linux on aarch64 (arm64)
Hello world works, a non-trivial part of the testsuite passes.
2015-12-13 17:05:42 -07:00
Dmitri Gribenko
ebcc23d4d1 build-script: try harder to detect outdated cmark repository 2015-12-14 01:22:48 +02:00
practicalswift
cb3a67f477 Fix typo: buildling → building 2015-12-14 00:11:19 +01:00
Dmitri Gribenko
f28d34845c Merge pull request #439 from hpux735/master
Beginning support for ARMv7 hosts (RasPi, etc.)
2015-12-13 00:10:20 -08:00
William Dillon
4bf81e09da Build working on ARMv7l 2015-12-12 22:06:13 -08:00
Dmitri Gribenko
2882816e59 Merge pull request #456 from djwbrown/djwbrown-swift-build-script-impl
[build-scripts] Check for empty array and `skip-test-swift` argument before printing.
2015-12-12 19:58:03 -08:00
Dmitri Gribenko
cc26d70f4e build-script: fix indentation 2015-12-12 18:22:15 -08:00
Dmitri Gribenko
a58f233666 build-script: don't run 'git', we have update-checkout for that 2015-12-12 18:21:46 -08:00
Dmitri Gribenko
c576afe91c build-script: add migration code for the cmark repository 2015-12-12 18:16:54 -08:00
Dylan Brown
4f1d82fe7e [build-scripts] Add condition to check for skip-test-swift argument.
Currently prints 'Running Swift tests for:...' even if the skip-test-swift argument is set. Should only print this line if there are tests in the SWIFT_TEST_TARGETS array and they will not be skipped.
2015-12-12 22:46:38 +02:00
Dylan Brown
7c13902bdb [build-scripts] Test for empty array before printing it.
In the case some SKIP_TEST_* flag is set, and test_this_target is False for all targets, then SWIFT_TEST_TARGETS will be an empty array. Avoid printing 'Running Swift tests...' with an empty array.
2015-12-12 21:25:39 +02:00
halfnelson
37840dbc4f cmark c flags should derive from cmark build type 2015-12-11 21:57:23 +10:00
Dmitri Gribenko
e871424806 Merge pull request #169 from GuillaumeBibaut/patch-1
FreeBSD: Search for newest clang compatible candidate
2015-12-11 00:04:44 -08:00
Guillaume Bibaut
5690a1b838 Search for clang based on Swift requirements 2015-12-11 08:43:14 +01:00
Mishal Shah
e065b6e0af Add support for swift alias in Info.plist
rdar://23580681
2015-12-10 19:54:52 -08:00
Luke Larson
5d1c6e16a0 [build-script] Support perf tests on additional platforms 2015-12-10 14:54:59 -08:00
Todd Fiala
284736cd00 Swift LLDB: allow static Python bindings on non-Darwin by default
This eliminates the need for the swig binary to be present.
This was already the case for OS X, but required extra cmake
arguments for cmake LLDB builds.
2015-12-08 16:47:39 -07:00
Dmitri Gribenko
a3c92e1b0d Remove build options for conditionally enabling targets
* We don't have a use-case for this.

* Swift, like Clang, is fundamentally a cross-compiler, and there is no
  known reason to artificially limit it.
2015-12-04 16:04:35 -08:00
Meador Inge
c4052ebfbd Add a way to specify the number of build jobs
This change adds a '-j' option to the top-level
build script.  The computed defaults may not
always be suitable.

Tested by building for Ninja (default), Make (-m), and XCode (-x).
I also verified the jobs count via a process monitor.
2015-12-04 15:36:00 -06:00
Mishal Awadah
d92e332cd0 [build-script] Enable package testing on OS X builders. 2015-12-04 12:56:56 -08:00
Meador Inge
769f1273b3 Fix Makefile builds
This commit fixes two problems exposed by Makefile builds
(-m): (1) the cmark library directory is wrong and (2) the
COMMON_CMAKE_OPTIONS are not quoted when building swift (thus
"Unix Makefiles" ends up as two command line arguments).

Tested by building for Ninja (default), Make (-m), and XCode (-x).
2015-12-04 09:51:40 -06:00
Adam Treat
f4c341275b Query linux for number of processing units for make parallelism 2015-12-03 16:37:14 -05:00
James McLaughlin
440a052a38 Add FreeBSD cases in build script 2015-12-03 21:06:36 +00:00
James McLaughlin
9da5899652 Consistently use env(1) to resolve bash and python paths 2015-12-03 20:55:27 +00:00
Daniel Dunbar
ff70f62e16 [utils] Change llbuild install to specifically only install swift-build-tool. 2015-12-03 10:13:32 -08:00
Tom Parker
54c3ab9484 Fix cmark checkout path
git@github links only work if you've got write permissions to the
repository
2015-12-03 17:30:18 +00:00
Mishal Awadah
6ed3e9424e [build-script] Add a heading for Foundation tests in the output. 2015-12-01 17:07:57 -08:00