Commit Graph

23 Commits

Author SHA1 Message Date
Evan Wilde
6956b7c5c9 Replace /usr/bin/python with /usr/env/python
/usr/bin/python doesn't exist on ubuntu 20.04 causing tests to fail.
I've updated the shebangs everywhere to use `/usr/bin/env python`
instead.
2021-09-28 10:05:05 -07:00
Karoy Lorentey
9cf28dffa2 [SDK] Remove the obsolete XCTest overlay
The actual XCTest overlay has not been maintained in this repository for years. (It is distributed in Xcode (libXCTestSwiftSupport.dylib), along with XCTest.framework itself.)

The code we have here is badly out of date, and the fact that we have it on the module path in CI makes it interfere with the contents of recent SDKs.

Remove the XCTest overlay from this repository; pick it up from the SDK instead.

rdar://76915582
2021-05-21 17:21:12 -07:00
Erik Eckstein
d49de1a982 ModuleInterfaceBuilder: give a more specific error message in case of a compiler mismatch 2021-04-15 14:06:17 +02:00
Alexis Laferrière
b79c7b627b [ModuleInterface] Update wording of the "failed to build module" error
The error shown when the compiler fails to build a module from its
textual interface has been creating some confusion. This is a proposal
to make it more useful to the programmer not working in the SDK, insist
on looking at the previous errors first, put less emphasis on possible
compiler bugs, and always show alternatives to the incompatible
compilers issue as this is the most common case now.
2021-01-26 15:36:46 -08:00
Meghana Gupta
ee1d975da0 Disable test for asan builds
Raises a stackoverflow error in some asan builds even though it is not a
runaway recursion.
2020-08-17 19:28:40 -07:00
Nate Chandler
caca83e9e1 [Test] Un-XFAIL ParseableInterface/verify_all_overlays.py.
The test is passing now--un-XFAIL it.

rdar://problem/50648519
2020-07-08 18:01:46 -07:00
Dan Zheng
dd645d88d1 [AutoDiff] Enable .swiftinterface verification for _Differentiation. (#32110)
Enable .swiftinterface verification for the _Differentiation module to prevent
regressions.
2020-05-30 23:53:13 -07:00
Doug Gregor
b27b4d4bb6 [CMake] Use proper module triples for the names of standard library modules.
The standard library (and other Swift modules built by our CMake build system)
has been building module files with an architecture only (e.g., x86_64.swiftmodule)
rather than a proper module triple (x86_86-apple-macosx10.15,
x86_64-apple-ios13.0-simulator, etc.), unlike every other build
system. There are hacks in the compiler and other tools to cope with
this unnecessary build difference. Fix the module file names so we'll
be able to remove the hacks later.

Fixes rdar://problem/49071536.
2020-04-20 21:16:14 -07:00
marcrasi
ddef9292a6 [AutoDiff upstream] DifferentiationUnittest and some e2e tests (#30915)
Adds 2 simple e2e tests and some lit subsitutions and unittest libraries
necessary to support them.
2020-04-09 14:25:31 -07:00
Marc Rasi
013a66bffc exempt _Differentiation from verify_all_overlays test 2020-03-31 16:25:09 -07:00
Brent Royal-Gordon
a27fdad4e5 Provide fallback SourceLoc for swiftinterface build errors
When a swiftinterface fails to build for any of various reasons, we try to diagnose the failure at the site of the `import` declaration. But if the import is implicitly added—which happens for many SDK modules, like the standard library and ClangImporter overlays—there is no source location for the import, so the error ends up being diagnosed at <unknown>:0. This causes a number of issues; most notably, Xcode doesn’t display the diagnostic as prominently as others.

This change falls back to diagnosing the error at line 1, column 1 of the swiftinterface file itself. This is perhaps not an ideal location, and it won’t help with I/O errors where we can’t open the swiftinterface file (and therefore can’t diagnose an error in it), but it should improve the way we display most module interface building errors.
2020-03-17 18:44:31 -07:00
Brent Royal-Gordon
a7a5e340aa Improve diagnostic for broken module interfaces
Currently, when a swiftinterface file fails to load, we emit the specific diagnostics for the failures, followed by a generic “failed to load module ‘Foo’” message. This PR improves that final diagnostic, particularly when the cause may be that the interface was emitted by a newer compiler using backwards-incompatible syntax.
2020-03-13 20:31:55 -07:00
Jordan Rose
3243f21280 Make sure all failures to load module interfaces are diagnosed (#25636)
...specifically, diagnosed in the parent DiagnosticEngine. This not
only provides a better user experience, but makes sure that the
compiler exits with a nonzero exit code even if the module goes
unused.

rdar://problem/50789839
2019-06-20 14:14:38 -07:00
Saleem Abdulrasool
6f803155d7 validation-test: avoid shell in ParseableInterface.verify_all_overlays
Avoid using shell in the test as not all targets run with a POSIX shell
for the test executor.
2019-06-05 13:57:19 -07:00
Saleem Abdulrasool
655a60af4d validation-test: correct typo in ParseableInterface.verify_all_overlays
The `%{python}` substitution was typoed with the `%` sigil being
replaced with `$`.
2019-06-04 16:36:12 -07:00
Brent Royal-Gordon
781ce5ed5e XFAIL ParsableInterface/verify_all_overlays.py
rdar://problem/50648519
2019-05-09 20:48:43 -07:00
Jordan Rose
c6efc8dc85 Test that the swiftinterface for the stdlib can be compiled (#24128)
...like we've done with the overlays for months. Meant to do this a
long time ago, but at the time we hadn't gotten the stdlib working
yet!
2019-04-19 14:27:23 -07:00
Jordan Rose
43feb9cbe1 On Apple platforms, use swiftmodule directories for the stdlib (#21797)
This changes the Swift resource directory from looking like

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          x86_64/
            Swift.swiftmodule
            Swift.swiftdoc
            Darwin.swiftmodule
            Darwin.swiftdoc

to

    lib/
      swift/
        macosx/
          libswiftCore.dylib
          libswiftDarwin.dylib
          Swift.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc
          Darwin.swiftmodule/
            x86_64.swiftmodule
            x86_64.swiftdoc

matching the layout we use for multi-architecture swiftmodules
everywhere else (particularly frameworks).

There's no change in this commit to how Linux swiftmodules are
packaged. There's been past interest in going the /opposite/ direction
for Linux, since there's not standard support for fat
(multi-architecture) .so libraries. Moving the .so search path /down/
to an architecture-specific directory on Linux would allow the same
resource directory to be used for both host-compiling and
cross-compiling.

rdar://problem/43545560
2019-02-19 14:47:21 -08:00
Jordan Rose
810a7bcd2d [test] Use -build-module-from-parseable-interface to test overlays (#21687)
Previously we used a manual -emit-module command with a hardcoded set
of arguments, but that didn't work properly for all overlays. This is
much better.
2019-01-07 17:07:06 -08:00
Jordan Rose
605c9f619f [CMake] Conditionalize generation of .swiftinterface files
SWIFT_ENABLE_PARSEABLE_MODULE_INTERFACES is the new setting.

rdar://problem/44942414
2018-11-26 17:04:46 -08:00
Graydon Hoare
77280b00ea [ModuleInterface] Use 2-arg form of basename(1) in overlay validation tests.
A bunch of .swiftinterface files fail to build into their respective .swiftmodules
if you pass -module-name <foo> for some foo that is not the correct module name.

The two tests in this change were using a shell expansion that incorrectly picked
the first path component with a period in the name as the module name; this caused
the failures.

Rather than using a shell expansion, this change uses the 2-argument form of
basename(1) (which is POSIX) that also removes a suffix from the basename.
2018-10-18 15:01:25 -07:00
Graydon Hoare
5e202697a3 [ModuleInterface] Mop up remaining "textual interface" terminology. 2018-10-11 23:56:19 -07:00
Jordan Rose
73d5ebaad2 Rename "textual interface" to "parseable interface" (#19713)
We already have something called "module interfaces" -- it's the
generated interface view that you can see in Xcode, the interface
that's meant for developers using a library. Of course, that's also a
textual format. To reduce confusion, rename the new module stability
feature to "parseable [module] interfaces".
2018-10-04 17:49:55 -07:00