Commit Graph

49 Commits

Author SHA1 Message Date
Eric Miotto
d4c6e2c0c6 Allow cross-compilation on Apple Silicon (#622)
Address rdar://99486698
2022-09-06 00:23:37 -07:00
Alex Hoppen
4741486af0 Add rpath of /usr/lib/swift and swift-5.5 compatibility library
Without it, sourcekit-lsp crashes on launch with the same errors as in apple/swift-package-manager#5467.
2022-08-16 21:34:17 +02:00
Alex Hoppen
3f1ae077ba Don’t build SourceKitLSPPackageTests in build-script-helper’s build action
Building SourceKitLSPPackageTests with cross-compilation enabled fails with
```
error: Could not find target named 'mypackagePackageTests_586B622B321A3B86_PackageProduct'
error: fatalError
```

For testing, we work around this by disabling cross-compilation. This is not possible for building, so we need to explicitly build all products.
2022-08-04 08:41:10 +02:00
Alex Hoppen
ac24fd613d Rename --build-path to --scratch-path in SwiftPM invocation
`--build-path` has been deprectated in favor of `--scratch-path` in SwiftPM.
2022-08-03 19:12:43 +02:00
Alex Hoppen
88d4b73b43 Ignore stderr when retrieving SwifitPM’s bin path 2022-08-03 19:12:43 +02:00
Alex Hoppen
ccf4d069a3 Don’t pass -no-toolchain-stdlib-rpath when installing sourcekit-lsp
Since https://github.com/apple/swift-package-manager/pull/4208 SwiftPM no longer adds rpath to the toolchain libraries, so we don’t need to exclude them.
2022-08-03 19:12:43 +02:00
Alex Hoppen
5eefa672f4 Print environment variables that were specified when executing commands 2022-08-03 19:12:43 +02:00
Alex Hoppen
cdcc924079 Add a --multiroot-data-file option to build sourcekit-lsp in a unified build 2022-08-03 19:12:43 +02:00
Alex Hoppen
dd92afb553 Explicitly build all targets
When we build SourceKit-LSP in a unified SwiftPM workspace, a simple `swift build` invocation will build all products in the unified workspace (not just SourceKit-LSP products).
2022-08-03 19:12:41 +02:00
Alex Hoppen
37d003eb73 Don’t clean build directory prior to building
AFAICT cleaning the build directory prior to building was done to work around a bug in SwiftPM at some point. I don’t think that it’s needed anymore.
2022-08-03 07:53:15 +02:00
Alex Hoppen
8e21003484 Restructure build-script-helper.py to make it more readable 2022-07-29 22:26:45 +02:00
Alex Hoppen
42f4239ff0 Change indentation of build-script-helper.py to 4 spaces
This matches the indentation of Python scripts in the rest of the Swift project.
2022-07-29 18:03:20 +02:00
Alex Hoppen
e5e949171c Remove dead code from build-script-helper.py 2022-07-29 18:03:05 +02:00
Alex Hoppen
d1c152ad9d Add type annotations to build-script-helper.py 2022-07-29 18:02:59 +02:00
Alex Hoppen
b8d8181a8c Merge pull request #556 from ahoppen/pr/cross-compile-arm64
Support creation of fat binaries that run on x86_64 and arm64
2022-06-01 09:34:22 +02:00
Alex Hoppen
59c5b63238 Update python scripts to Python3 2022-05-31 22:58:25 +02:00
Alex Hoppen
926414ce1a Support creation of fat binaries that run on x86_64 and arm64
Currently, when building an open source toolchain, SourceKit-LSP is only built for x86_64.  Copy the necessary cross-compilation parts from SwiftPM’s build script to also produce a fat sourcekit-lsp executable for both x86_64 and arm64.

rdar://78039145
2022-05-30 12:05:53 +02:00
Alex Hoppen
ef8bb5ae07 Disabe testable imports when testing
Otherwise, we still need to rebuild SourceKit-LSP even if no-clean is specified.
2022-05-23 17:50:37 +02:00
Alex Hoppen
ba1d590ccc Add option to not clean build directory prior to performing action 2022-05-23 17:50:22 +02:00
Alex Hoppen
215de9a835 Only run tests in parallel on Linux again
The underlying issue in the SwiftPM test runner has been fixed.

rdar://92262856
2022-05-13 15:09:58 +02:00
Alex Hoppen
e938b2c96f Only run tests in parallel on Darwin
Running tests in parallel causes nondeterministic failures on Linux (rdar://92260631). Disable parallel testing on all platforms except Darwin until that issue has been fixed.
2022-04-28 11:08:16 +02:00
Yuta Saito
707608ce0c Remove deleting toolchain rpath step
the install script has been broken since 8876f87141
which stops adding toolchain rpath for older OSes without system
swift libraries.
2022-03-19 01:28:47 +09:00
Butta
dfe220500c [build-script-helper] Add support for Android cross-compilation
Add new flags '--cross-compile-host' and '--cross-compile-config' and use them to
cross-compile, gated only for Android for now. Add a '--prefix' flag to install
to a cross-compiled toolchain instead and set 'SWIFT_EXEC' when using SPM, so it
uses the right Swift toolchain.
2021-08-21 12:04:53 +05:30
Butta
e3f1f16cc9 On ELF platforms, remove the host toolchain rpath from sourcekit-lsp before
installing.
2021-07-19 22:18:46 +05:30
Alex Hoppen
a0c9b30a2a Restart sourcekitd and clangd after they have crashed 2021-01-18 13:30:35 +01:00
soloturn
931f82a43d source_dir is str and UTF-8 already, python2, python3 2020-10-24 07:34:24 +02:00
Butta
8deb6e4bea [build-script-helper] make it run under Python 3 and always run tests in parallel instead 2020-10-20 00:22:57 +05:30
Ben Langmuir
ce69bb4640 [build-script] Provide ISDB toolchain env var as well
Since utilities from isdb are used in our tests, override the toolchain
there as well.
2020-06-08 13:01:45 -07:00
Ben Langmuir
0daa9fa5e3 [build-script] Clean build directory 2020-04-30 13:19:39 -07:00
Ben Langmuir
233ab60829 [build-script] When using tsan, halt_on_error=true
This seems more reliable for detecting failures in CI.
2020-04-27 16:48:30 -07:00
Ben Langmuir
4c925df8e7 [build-script] Change dist to linux_distribution
Seems to be the newer version.
2020-04-27 12:10:20 -07:00
Ben Langmuir
b3e9a8ffba [test] Re-enable --parallel testing
rdar://61837752
2020-04-24 15:29:23 -07:00
Ben Langmuir
7922ef4e3e [test] Disable --parallel testing temporarily (#268)
We have a couple of non-deterministic CI failures right now, and they
may be triggered by, or made more frequent by doing parallel testing.
Disbaling while I continue to investigate.

rdar://61837752
rdar://61965529
2020-04-22 13:17:29 -07:00
Mishal Shah
bf8a1c2f31 Merge pull request #257 from buttaface/prefix
[build-script] Remove hard-coded install prefix of /usr and pass it in instead
2020-04-20 10:03:24 -07:00
Ben Langmuir
cd60743d9e [build-script] Add sanitizer flags
Add --sanitize to choose a specific sanitizer, or --sanitize-all to run
all the sanitizers in sub-directories of the build.
2020-04-14 10:25:01 -07:00
Ben Langmuir
af6f986bb1 [build-script] Add --parallel to supress output on success
It's slightly faster and it helps supress the test output when tests
succeed (which avoids false positives in Jenkins' error regexes, for
example the error from "let pack" in a test).
2020-04-07 16:41:34 -07:00
Butta
1acf71d565 [build-script] Remove hard-coded install prefix of /usr and pass it in instead 2020-03-23 23:20:51 +05:30
Butta
a4cec47d70 Android: add native support 2019-12-26 15:49:13 +05:30
Ron Olson
c5a263f636 project can be built using Python 3 2019-10-31 13:06:48 -05:00
Ben Langmuir
9e8e088f6b [build-script] Add a flag to use normal swiftpm dependencies
Handy for local development if you don't want to test with swift's full
build.
2019-08-12 13:25:46 -07:00
Ben Langmuir
fe7f6cfd91 [build-script] Fix build directory calculation when using -v
Swift-build was logging some extra information to stdout, causing
incorrect calculation of the bin dir.
2019-08-12 13:25:46 -07:00
Ben Langmuir
7e2d7ba42a [build-script] Add installation support for sourcekit-lsp
When invoked with the `install` action, build-script-helper.py will
rsync the produced sourcekit-lsp to the toolchain's bin directory. On
Linux, we add an extra relative rpath to find the swift corelibs
(unfotunately we currently have no way to remove the absolute rpath; the
same is true for all other swift-built binaries in the toolchain). On
macOS, we replace the rpath.
2019-08-12 13:25:46 -07:00
Ben Langmuir
0857bd5bf9 Remove -enable-testing from build-script-helper 2019-08-08 22:33:33 -07:00
Argyrios Kyrtzidis
9b7065d9e4 [build-script-helper] Add a search path to be able to find Block.h from the just built toolchain
This is similar to https://github.com/apple/indexstore-db/pull/33
2019-08-04 09:42:28 -07:00
Ben Langmuir
3044f7394b Add infrastructure for test projects using Tibs
This builds on the indexer changes to support test projects using the
tibs build system. See the commit message from IndexStoreDB for more
information.

This commit adds a couple of simple tests using test fixtures in the
INPUTS directory. It is a fairly minimal change for using the indexer's
test support code to prove the model works. One missing piece here is
support for mutable sources and updating the index, which is supported
on the IndexStoreDB side, but needs a bit more work here.  This also
doesn't include any tests using swiftpm's build system.
2019-07-22 13:57:04 -07:00
Ben Langmuir
e3e6bc6e7b [build-script] Accept --ninja-bin
For now, just thread it through as an environment variable. Future
commits will make use of this during testing.
2019-07-22 11:46:29 -07:00
Ben Langmuir
3a69aefe0b Remove Package.resolved and move to HEAD
Always use the latest indexstore-db and swiftpm from the corresponding
branch (currently master). This is important for swiftpm, because it
does not *guarantee* stable behaviour, so we need to match the version.
It also makes sourcekit-lsp behave more like the rest of the swift
toolchain projects, who all live on HEAD for their dependencies.
2019-03-07 09:32:27 -08:00
Ben Langmuir
1daaa24275 [build-script] Add build-script-helper.py
This is a lightweight wrapper for `swift build` and `swift test` to
facilitate building indexstore-db along with a swift toolchain using the
swift `build-script`.
2019-01-17 16:32:21 -08:00
Ben Langmuir
aabf57a252 Import SourceKit-LSP sources 2018-11-13 15:50:48 -08:00