Commit Graph

1202 Commits

Author SHA1 Message Date
Ben Barham
591737e1c9 [Test] Small test fix
We want to redirect stderr to stdout, not to ^1.
2023-06-28 15:15:27 -07:00
Doug Gregor
1ec900e2a0 [Macros] Add default plugin paths for Darwin SDKs and platforms.
Corresponding to https://github.com/apple/swift-driver/pull/1377, this
adds some default plugin paths for Darwin SDKs and platforms.
Fixes rdar://110819604.
2023-06-16 14:55:20 -07:00
Egor Zhdan
d5c301823c Merge pull request #66546 from finagolfin/runtime
[Driver] Remove unused runtime library path on non-Darwin platforms
2023-06-15 13:03:46 +01:00
Tristan Labelle
11f34b7ec9 Fix linting error 2023-06-13 10:28:42 -04:00
Tristan Labelle
0d5aa7fcbe Fix non-glob paths in touch.py 2023-06-12 14:27:03 -04:00
Tristan Labelle
6308cd0834 Migrate test to touch.py 2023-06-12 14:21:34 -04:00
Finagolfin
8f0c2d3ace [Driver] Remove unused runtime library path on non-Darwin platforms
Translation of apple/swift-driver#1374 to the legacy C++ Driver, with the
addition of a test.
2023-06-12 01:04:19 +05:30
Tristan Labelle
3c51106fad Fix tests on Windows CI with vs2022 2023-06-09 16:41:05 -04:00
Yuta Saito
c994500d82 [Driver] Use WebAssembly toolchain for WASI target
The toolchain was introduced in 710816d3e0
but was not used. Test cases now use fake resource dir to lookup
static-executable-args.lnk file, which is required by the toolchain but
is not present when not building stdlib for WASI.
2023-06-08 11:40:10 +00:00
Rintaro Ishizaki
495f9b2105 Merge pull request #66145 from rintaro/revert-driver-external-plugin-path-rdar108624128
Revert "[Driver] Derive '-external-plugin-path'"
2023-05-26 09:54:48 -07:00
Daniel Rodríguez Troitiño
8f0382c109 [test] Replace swift_obj_root for alternates that work in LLVM unified builds (#66167)
In LLVM unified builds `%swift_obj_root` points to `<LLVM build dir>/tools/swift`,
and folders like `bin`, `lib` and `share` are not under `swift_obj_root`, which
makes some tests fail.

For the cases in which `%swift_obj_root/lib` was used, replace it by
using `%swift-lib-dir` instead. Replicate `%swift-lib-dir` to create
`%swift-bin-dir` and `%swift-share-dir`, and use those instead of
`%swift_obj_root/bin` and `%swift_obj_root/share`.

This alternates work both in Swift build-script builds and also in LLVM
unified builds.
2023-05-26 08:39:31 -07:00
Rintaro Ishizaki
64b353c5bd Revert "[Driver] Derive '-external-plugin-path'"
This reverts commit b0f5c3977f.

rdar://109851266
2023-05-25 13:39:40 -07:00
Max Desiatov
0fc365960c Merge pull request #65795 from apple/maxd/fix-missing-cmake-value
CMake: fix missing `SWIFT_CONCURRENCY_GLOBAL_EXECUTOR` value

`SWIFT_CONCURRENCY_GLOBAL_EXECUTOR` is defined in `stdlib/cmake/modules/StdlibOptions.cmake`, which is not included during the first pass of evaluation of the root `CMakeLists.txt`. It is available on subsequent evaluations after the value is stored in CMake cache. This led to subtle bugs, where `usr/lib/swift_static/linux/static-stdlib-args.lnk` didn't contain certain flags on clean toolchain builds, but did contain them in incremental builds.

Not having these autolinking flags in toolchain builds leads to errors when statically linking executables on Linux.

Additionally, since are trivial tests previously didn't link Dispatch statically, the didn't expose a bug where `%import-static-libdispatch` substitution had a missing value. To fix that I had to update `lit.cfg` and clean up some of the related path computations to infer a correct substitution value.

Resolves some of the errors reported in https://github.com/apple/swift/issues/65097.
2023-05-17 20:52:05 +01:00
Saleem Abdulrasool
e22cf2e993 Merge pull request #65946 from tristanlabelle/fix-one-way-external-fine-test
Fix test on Windows by expanding "*{a,b,c}" wildcard syntax
2023-05-16 12:13:59 -07:00
Tristan Labelle
5876f6d505 Expand "*{a,b,c}" syntax in test's touch -t call for Windows 2023-05-16 08:48:48 -04:00
Slava Pestov
c2338aa0f6 Backward deployment shim for swift_allocate{Metadata,WitnessTable}Pack() 2023-05-12 15:44:12 -04:00
Max Desiatov
2db62cade8 Fix -DSWIFT_PATH_TO_LIBDISPATCH_STATIC_BUILD value 2023-05-10 14:05:25 +01:00
Rintaro Ishizaki
b0f5c3977f [Driver] Derive '-external-plugin-path'
When the current toolchain is not a Xcode toolchain, derive
'-external-plugin-path' poinintng Xcode plugins paths, so we can use
plugins in Xcode.

rdar://108624128
2023-05-04 16:41:45 -07:00
Erik Eckstein
6375647383 driver: add swift-frontend options to select the tool to run
Tool selection is primarily done by checking the executable (= symlink) name.
But sometimes (e.g. if the tool symlink is not there) it's useful to have an option for selecting the tool.
The selection option (e.g. -sil-opt) must be the first argument of swift-frontend.
2023-04-28 15:18:16 +02:00
Rintaro Ishizaki
a551c01d6a [Macros] Track plugin dependencies
* Factor out ASTContext plugin loading to newly introduced 'PluginLoader'
* Insert 'DependencyTracker' to 'PluginLoader'
* Add dependencies right before loading the plugins

rdar://104938481
2023-04-25 10:50:32 -07:00
Doug Gregor
928c821ba3 Update tests yet again 2023-03-22 09:12:16 -07:00
Doug Gregor
9bb4d261b1 Try harder to deal with / vs. \, the third hardest problem in computer science 2023-03-22 07:15:49 -07:00
Doug Gregor
b1788529ae Cope with Windows paths 2023-03-22 00:41:47 -07:00
Doug Gregor
74b12e8f23 [Driver] Implement inference of -plugin-path arguments.
This was previously implemented in the new driver; backport it to the
existing driver, which is still used by SourceKit.

Fixes rdar://106790436.
2023-03-21 21:23:49 -07:00
Saleem Abdulrasool
19c7bb5a22 Driver: add support for baremetal targets
This allows building the Swift standard library for targets which may
not have an actual OS running.  This is identified by the OS field in
the target triple being set to `none`.
2023-03-20 17:59:13 -04:00
Ben Barham
2b43cf2911 [Test] Rename substitution so it isn't incorrectly substituted
`%swiftc_driver` is a substitution already, which means
`%swiftc_driver_stdlib_target` was actually being substituted as
`%swiftc_driver` first with `-stdlib-target` tacked on the end.

Resolves rdar://106170241 and rdar://106170343.
2023-03-05 14:22:02 -08:00
Meghana Gupta
7feab0b1d3 Disable batch_mode_dependencies_make_wrong_order.swift 2023-03-03 17:25:29 -08:00
Saleem Abdulrasool
4075d706a2 stdlib: remove the dependency on the injected modules
Inject the necessary module maps and apinotes via the VFS.  This cleans
up the developer build in preparation for a secondary change to remove
this need for deployed scenarios as well.  Injecting the content via the
VFS will enable us restore the ability to work with a pristine
installation of Visual Studio, dropping the custom action for the Swift
installer, and open the pathway to per-user installation of Swift.

Thanks to @bnbarham for the help and discussion in resolving the test
issues.
2023-02-28 09:40:51 -08:00
Tim Kientzle
5ab60e673a Remove support for linking arclite (#63662)
* Remove support for linking arclite

Darwin no longer uses arclite and it's no longer distributed
in the macOS SDKs.

This leaves the options -link-objc-runtime and -no-link-objc-runtime
in place, but strips out all the logic that actually used them.

* Remove a dead function

* Warn if `-link-objc-runtime` is used

* Update tests to not look for arclite library

* Add an explicit test for the deprecation warning

* Move the macOS-only -link-objc-runtime test to a separate test file
2023-02-23 12:20:33 -08:00
Joe Groff
69e4b95fb8 SIL: Model noescape partial_applys with ownership in OSSA.
Although nonescaping closures are representationally trivial pointers to their
on-stack context, it is useful to model them as borrowing their captures, which
allows for checking correct use of move-only values across the closure, and
lets us model the lifetime dependence between a closure and its captures without
an ad-hoc web of `mark_dependence` instructions.

During ownership elimination, We eliminate copy/destroy_value instructions and
end the partial_apply's lifetime with an explicit dealloc_stack as before,
for compatibility with existing IRGen and non-OSSA aware passes.
2023-02-16 21:43:53 -08:00
Ben Barham
0c7e3520ae [Test] Better workaround for filelists.swift
bdf60152f0 added some extra padding to
forFilelistCapture to avoid it being exactly 4096 bytes, triggering a
tail bug. Rather than do that, just run the sed's first so that the
input is quite small (definitely under 4096 bytes).

Resolves rdar://105395733.
2023-02-15 09:43:38 -08:00
Richard Wei
4480d89536 [Macros] Emit plugin dependencies to loaded module trace. (#63367)
Emit plugins loaded with `-load-plugin-library` to loaded module trace.

Resolves rdar://102212316.
2023-02-03 09:16:14 +08:00
Alastair Houghton
e105c221d9 [Driver][Tests] Disable failing tests as they're affecting PR testing.
rdar://103867585
2023-01-04 13:32:21 +00:00
Anthony Latsis
d553d0466a Merge pull request #62355 from AnthonyLatsis/sr-no-sr
[NFC] Migrate remnant Jira issue references to GitHub issues
2022-12-04 12:08:25 +03:00
Anthony Latsis
4cb63c8a0f [NFC] Migrate remnant Jira issue references to GitHub issues 2022-12-04 08:20:34 +03:00
Doug Gregor
35ed6f657e Fix up a few more tests that need the host library path 2022-11-30 16:42:16 -08:00
Doug Gregor
5462c0a8ef Ensure that the host library path is provided to tests.
Eliminate the "copy the plugin library" step for these tests, which was
always a hack and doesn't scale when we add more shared libraries.
2022-11-30 13:54:58 -08:00
Doug Gregor
70323dd318 Link _CompilerPluginSupport into the compiler and SourceKit.
Ensure that we link `swift_CompilerPluginSupport` into the compiler and
SourceKit, and set the rpath appropriately to find the library in its
installed location.

A number of driver tests copy the driver executable into a temporary
directory to isolate it from the build tree. Also copy the plugin
support library into its appropriate place near the driver executable
to ensure these tests keep working. To help with this, add a
`swift_swift_parser` lit feature, which we can use in tests that
involve the new parser's capabilities.
2022-11-15 19:32:20 -08:00
Andrew Trick
c30ca69b78 Remove lit --param bootstrapping_mode 2022-11-09 09:10:46 -08:00
Alexis Laferrière
fec0498c65 [Test] Use a clean module cache for more tests
Use a clean module cache in tests printing path to the
swiftmodule/swiftinterface used as it may change depending on previous
tests.
2022-10-31 10:58:56 -07:00
Anthony Latsis
867472491f Merge pull request #60812 from AnthonyLatsis/migrate-test-suite-to-gh-issues-12
Gardening: Migrate test suite to GH issues p. 12
2022-09-02 06:06:53 +03:00
Ben Barham
d7a33551f8 [Option] Add all new driver arguments (without implementations)
Various clients still use the old driver to convert a driver arguments to frontend arguments. This has to work when given new driver arguments, ie. not fail with an unknown argument error.

Move all "extra options" from the new driver into `Options.td` and mark them as new driver only.
2022-08-30 12:46:42 +10:00
Anthony Latsis
57b799764b Gardening: Migrate test suite to GH issues: Driver 2022-08-26 15:13:58 +03:00
YOCKOW
d10381557b [NFC] Python Lint: Fix E275(missing whitespace after keyword) issues. 2022-08-21 16:07:07 +09:00
buttaface
cc0e122125 [Driver] Work around lld 13+ issue with --gc-sections for ELF by adding -z nostart-stop-gc (#60544)
Fixes #60406 

Ran the linux x86_64 compiler validation suite on this pull with `-use-ld=lld -Xlinker --gc-sections`, then without stripping as in the linked issue, and only saw the 20 unrelated failures just like @drodriguez had.
2022-08-19 10:24:05 -07:00
swift-ci
9cc8d34c93 Merge remote-tracking branch 'origin/main' into rebranch 2022-07-07 05:12:51 -07:00
Erik Eckstein
1cbea04103 run the TargetConstantFolding pass also at -Onone
This is important for performance diagnostics: it’s assumed that (non-generic) MemoryLayout constants do not need to create metadata at runtime. At Onone this is only guaranteed if the TargetConstantFolding pass runs.

rdar://94836837
2022-07-07 08:35:04 +02:00
Ben Barham
bdf60152f0 [Test] Add a hack to prevent a very odd tail bug
`test/Driver/filelists.swift` writes out the swift driver jobs to a file
called `%t/forFilelistCapture`. We then `tail -2 | head -1` that file to
get the first line, run some seds, and expect that to the output file
list (eg. from the swift-frontend command). Unfortunately if that file
happens to end up being 4096 in length, `tail` skips the first line and
thus the seds run on *second* line. That produces `/usr/bin/ld` instead,
which obviously doesn't contain the output files!

Add a comment to the end of the file so that it's unlikely to be 4096
in length. Technically we could still hit it if we removed a bunch of
arguments, but this is fine until that bug is fixed.
2022-06-29 15:08:29 -07:00
Butta
a240752487 [test] Fix test that's failing on the Android CI since string processing was enabled by default
Also, move the test to test/Frontend/ where it belongs and disable implicit
concurrency import too.
2022-06-23 01:27:14 +05:30
Yuta Saito
54f1225570 [test] un-XFAIL test/Driver/static-stdlib-linux-lld.swift 2022-06-21 04:24:00 +00:00