Commit Graph

4184 Commits

Author SHA1 Message Date
Michael Gottesman
a9d384dac3 [update-checkout] Add a simple mock update-checkout test that makes sure that we can clone.
This commit is not meant to completely test update-checkout, but rather create
some scaffolding for testing update-checkout so we can create starter bugs to
fill out the rest of the functionality. Once we have enough testing in place, we
can start refactoring/simplifying update-checkout.

Design
------

This is just a standard python unittest test suite except that the tests expect
an environment variable (UPDATECHECKOUT_TEST_WORKSPACE_DIR) to be set that
specifies the directory that the unittests have for creating mock git repos
during setup/teardown. lit invokes the test by calling the unittests with the
environment variable set to the appropriate temporary directory.

In this temporary directory, each test creates a pristine set of "fake" remote
repos and a test-config.json file that can be passed to update-checkout to work
with these "fake" remote repos. This allows each test that we write to test
various update-checkout functionalities against a pristime set of git repos. I
choose the git clone test, just b/c it was really simple.

NOTE: One can also run the tests locally using the script
test_update_checkout.sh that uses /tmp/workspace as the workspace directory.
2019-06-21 18:25:08 -07:00
Michael Gottesman
e8ad3201f6 [update-checkout] Allow the source root to be passed in instead of hard coding to SWIFT_SOURCE_ROOT.
This enables mocking testing to work (otherwise we would create repos in
SWIFT_SOURCE_ROOT). SWIFT_SOURCE_ROOT is the default value so nothing changes
unless one specifies the argument explicitly.
2019-06-21 18:13:40 -07:00
mishal_shah
5832743c5c [Update Checkout] Print sorted repo list 2019-06-21 16:04:44 -07:00
mishal_shah
f5963923de [Update Checkout] Print hashes at the end of the successful clone/update.
- Support dump-hashes with skipped repos
- Remove duplicated code from dump hashes
2019-06-21 11:53:59 -07:00
Alex Lorenz
1cf12f93d9 Do not copy the compiler-rt builtins if the destination directory doesn't exist
rdar://51963563
2019-06-20 15:58:03 -07:00
Saleem Abdulrasool
40a49cee87 Merge pull request #25595 from drodriguez/windows-i-give-up
[windows] Use both directory separators in test patterns.
2019-06-20 15:48:16 -07:00
Alex Lorenz
d66caf0c10 build-script-impl: do not copy the darwin compiler-rt builtin archives when using --build-llvm 0 2019-06-19 16:47:15 -07:00
Daniel Rodríguez Troitiño
46a173718a [windows] Use both directory separators in test patterns.
Admit defeat and realize that one simply cannot win against Windows. Use
the pattern with both separators in the tests and remove the hack in
PathSanitizingFileCheck because it created false positives, some of them
could not have been easily fixed.

Sadly lit substitutions or other tricks in lit.cfg will not work,
because CHECK lines are not processed by lit, but by FileCheck.
2019-06-18 18:51:01 -07:00
Alex Lorenz
7351b401af Merge pull request #25547 from hyp/test_embedded
[darwin][build] Copy the libclang_rt.{ios/tvos/watchos}.a from toolchain to the build dir so that swift-clang can use them when building for ios/tvos/watchos
2019-06-18 16:13:58 -07:00
Daniel Rodríguez Troitiño
0f2b753518 Merge pull request #25546 from drodriguez/windows-fix-parseable-interface-tests
[windows] Fix ParseableInterface tests.
2019-06-18 14:16:09 -07:00
Alex Lorenz
e11e127db4 [darwin][build] Copy the libclang_rt.{ios/tvos/watchos}.a from toolchain to the build dir so that swift-clang can use them when building for ios/tvos/watchos 2019-06-18 13:49:14 -07:00
Ross Bayer
094696702c Merge pull request #25534 from Rostepher/append-no-more-stdlib-deployment-targets
[Build System: build-script] Update the --stdlib-deployment-targets flag to no longer append from multiple uses, instead use the standard last-wins strategy.
2019-06-18 13:24:16 -07:00
Daniel Rodríguez Troitiño
80cd48dfe6 [windows] Fix ParseableInterface tests.
There were several Unix specific things in the ParseableInterface tests:
the Bash subcommand was used, a Python tool was invoked without an
explicit interpreter, and Unix path separators are used in CHECK lines.

The Bash subcommand is replaced by a Lit substitution. Both swiftmodule
and swiftdoc had substitutions, so swiftinterface gets one which should
about the subcommand.

The Python tool is invoked with an explicit interpreter.

The Unix paths, instead of adding the ugly {{\\|/}} pattern everywhere
are fixed in the PathSanitizing tool instead, that gets a new capability
in Windows compatibility mode where all the Windows path found in the
input are transformed into Windows path with only forward slashes (Unix
slashes) in the output, which can be checked textually against the CHECK
lines.
2019-06-18 12:43:01 -07:00
Xi Ge
4ac14ea0d5 swift-api-checker: print framework names when diagnosing breakages 2019-06-17 16:19:40 -07:00
Ross Bayer
9dc44b70b5 Merge pull request #25520 from Rostepher/empty-swift-sdks
[Build System: build-script] Update the migration logic for the preset-only option '--swift-sdks' to execute in-place and support empty SDK lists.
2019-06-17 16:15:16 -07:00
Ross Bayer
563bef609f [Build System: build-script] Update the --stdlib-deployment-targets flag to no longer append from multiple uses, instead use the standard last-wins strategy. This aligns better with the existing documentation for the argument and the similar --build-stdlib-deployment-targets flag. 2019-06-17 16:13:58 -07:00
Ross Bayer
ef0b49d96e [Build System: build-script] Update the migration logic for the preset-only option '--swift-sdks' to execute in-place and support empty SDK lists. 2019-06-17 13:42:52 -07:00
Jordan Rose
43bb5e4121 swift_build_sdk_interfaces.py: builds compiled modules from an SDK (#25432)
...by crawling it and looking for module interfaces. This is the tool
Apple is using for the "prebuilt-modules" directory in the toolchain
in Xcode.app, which avoids even a first-use cost for importing modules
from Apple SDKs as long as the SDKs haven't changed. We've been
landing changes to support this model on the compiler side, so the
tool to generate the "prebuilt" compiled modules belongs in the
compiler repo too. (In theory this could be used with open-source
toolchains as well, or for alternate SDKs.)
2019-06-17 10:29:11 -07:00
Saleem Abdulrasool
c1e4a9c019 Merge pull request #25390 from compnerd/double-double
rth: quote the commandline properly on Windows (NFC)
2019-06-14 11:33:22 -07:00
Xi Ge
06c958e6af swift-api-checker: teach the script to collect Swift only frameworks from the SDK.
This will only include frameworks like SwiftUI, Combine, etc.

Related: rdar://48456712
2019-06-13 12:36:56 -07:00
Mishal Shah
27712eb857 Update update-checkout config to support swift-5.1-branch-06-12-2019 2019-06-12 22:22:47 -07:00
Xi Ge
9bbcd55438 Merge pull request #25396 from akyrtzi/infer-imports-swift-frameworks
[api_checker/infer-imports.py] Look for Swift-only frameworks as well
2019-06-12 19:20:20 -07:00
Xi Ge
2509f50e45 Syntax: introduce a token kind for single quote to preserve round-trip printing of syntax tree
For invalid code, lexer is forgiving enough to allow single quote '\'' as the starting point
of string literals. Later, parser assumes the string literals are always using double quote "\"", and passes
such knowledge to SwiftSyntax side, leading to the round-trip failure we observed in the radar.
This commit fixes the issue by introducing another token kind for single quote.

rdar://51071021
2019-06-12 17:16:16 -07:00
Argyrios Kyrtzidis
ea978d9dc3 [api_checker/infer-imports.py] Look for Swift-only frameworks as well 2019-06-12 17:11:44 -07:00
swift-ci
aa4d87584e Merge pull request #25389 from compnerd/runtime-paths-are-changed 2019-06-12 13:57:21 -07:00
Saleem Abdulrasool
ef1fc19027 rth: quote the commandline properly on Windows (NFC)
This is purely for debugging purposes.  Use the subprocess.list2cmd
function to get a command line quoted for Windows quoting rules.  NFC
2019-06-12 11:36:27 -07:00
Saleem Abdulrasool
279df1be0f rth: change the working directory on Windows
The tests need to change the working directory when executing on Windows
as RPATH is not supported on the platform.  The current working
directory gets precedence over `PATH` for library lookup.  This allows
the last of the Evolution tests pass on Windows.
2019-06-12 11:35:08 -07:00
Daniel Rodríguez Troitiño
5a2fd7441b Merge pull request #23303 from drodriguez/cmake-options-improvements
[build-script] Improvements to CMakeOptions.
2019-06-12 10:01:36 -07:00
Julian Lettner
9298944f0b Merge pull request #24756 from apple/tsan-positive-tests
[TSan] Add positive test for TSan + Dispatch on Linux
2019-06-11 15:39:34 -07:00
Saleem Abdulrasool
7ff22f5b7a Merge pull request #25266 from drodriguez/windows-fix-python-tests
[windows] Fix Python tests in Windows.
2019-06-11 10:35:02 -07:00
Saleem Abdulrasool
76095d4a49 Merge pull request #25134 from drodriguez/windows-update-icu-for-ci
[windows] Update ICU version to 64.2.
2019-06-10 15:54:14 -07:00
Julian Lettner
1f08ed458f Wire libdispatch build path through CMake
Wire libdispatch build path through CMake `build-script-impl ->
lit.site.cfg.in -> lit.cfg` instead of computing it in lit.cfg.
2019-06-10 14:28:01 -07:00
Ross Bayer
8db65b35a4 Merge pull request #25122 from Rostepher/darwin-supported-archs
[Build System: CMake] Darwin Supported Archs and Modules.
2019-06-10 12:03:04 -07:00
Saleem Abdulrasool
4e0ed8818a Merge pull request #25220 from compnerd/run-path-emulation
tests: improve resilience test helper for Windows
2019-06-10 11:34:28 -07:00
Mishal Shah
1b198ea956 Merge pull request #25299 from gottesmm/pr-50ee231a2e5e8b83221d1f57d7eedafc4a086190
[standalone_stdlib] Do not test cmark when building standalone.
2019-06-07 12:31:12 -07:00
Michael Gottesman
851e675925 [standalone_stdlib] Do not test cmark when building standalone. 2019-06-07 12:29:30 -07:00
Michael Gottesman
26918a816e [update-checkout] Update stdlib_standalone preset for the snapshot released last night. 2019-06-07 07:37:32 -07:00
Michael Gottesman
9e8c0d0abf Add a update-checkout scheme for people to test out stdlib_standalone. 2019-06-06 15:07:17 -07:00
swift-ci
65bb06c067 Merge pull request #25287 from akyrtzi/build-script-cmake-file-api 2019-06-06 13:00:46 -07:00
Daniel Rodríguez Troitiño
3fb9a2a7a4 [windows] Fix Python tests in Windows.
- Forward several environment variables to the test environment because
Windows uses them to inform the processes about things like the number
of processors and the architecture.
- Normalize some literal Unix paths to be the same as the results in
Windows, that will have forward slashes and the drive letter.
- Skip some test that use build-script-impl and tests that check for
files being executable (everything is executable in Windows).
- Don't use the owner and group arguments for tar on Windows.
- Hide the stderr output of which. In Windows it prints the full PATH in
case of failures, which is disrupting.
- Quote many paths in Windows in the output of build-script results.
- Provide a version of mock-distcc that can be executed in Windows. The
raw Python script cannot.
- Change the expected results for clang/clang++ to the right values in
Windows (clang-cl in both cases).
2019-06-06 11:30:22 -07:00
Argyrios Kyrtzidis
b8dec80f95 [build-script-impl] Use cmake-file-api in case the CMake used supports it 2019-06-06 10:03:03 -07:00
Michael Gottesman
caa2286182 [stdlib_standalone] Add a update-checkout scheme for people to test out stdlib_standalone. 2019-06-06 08:23:50 -07:00
swift-ci
d272bfa18d Merge pull request #25278 from gottesmm/pr-0cbbc6612ad435dc0e80c82f2a6637e3905c9bad 2019-06-05 23:28:56 -07:00
Michael Gottesman
903547f694 [stdlib-standalone] Always configure with lit-args=--filter=stdlib/
Otherwise, we will need to reconfigure when someone uses the build vs test
preset. Because the reconfiguring forces a rebuild, this is unfortunate.
Luckily, we want to make it so we always only build stdlib tests, so this works
around the problem.
2019-06-05 21:37:40 -07:00
Daniel Rodríguez Troitiño
6c349eca99 [windows] Use only a drive letter as build directory.
Caveat: two builds cannot happen at the same time in the same machine.
2019-06-05 14:44:45 -07:00
Saleem Abdulrasool
c50fee199f tests: improve resilience test helper for Windows
Windows does not support the concept of RPATH.  As a result, we must
change the working directory for the test.  This extends the support
for the tests to work with PE/COFF on Windows.  Use the newly minted
`self.triple` property to drive the host detection.  This means that
the test coverage on Windows is able to test most of the resilience
functionality.
2019-06-04 08:54:32 -07:00
Joe Groff
14f9dc6e15 Do not try to dsymutil .a files, which is unsupported 2019-06-03 20:18:53 -07:00
Karoy Lorentey
e53071e240 [utils] Fix linter error (#25229) 2019-06-03 17:43:56 -07:00
Saleem Abdulrasool
47c8642dbb Merge pull request #25209 from compnerd/there-is-a-crack-in-the-plumbing
test: plumb `--triple` to the resilience test helper
2019-06-03 10:38:13 -07:00
Michael Gottesman
af77f11513 [build-presets] Eliminate the --reconfigure from the stdlib standalone presets.
With the previous commit, one can choose when to reconfigure. I have noticed
that when we reconfigure the preset, we always rebuild. So having reconfigure by
default messes with the experience of using the preset.
2019-06-02 23:18:37 -07:00