Commit Graph

32 Commits

Author SHA1 Message Date
Ramon Asuncion
7c10009eab [Test][Driver] Keep only LINUX_LAX checks for LD_LIBRARY_PATH 2025-11-06 15:55:50 -05:00
Ramon Asuncion
34a2557369 [Test][Driver] Clean up FileCheck prefixes for internal shell 2025-10-17 13:03:17 -07:00
Lang Hames
c68e3bfb69 Update Driver/options-interpreter.swift for 8eb9475ed8 2024-01-24 16:58:05 -08: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
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
Richard Howell
6b9d79bab0 use %swift_driver_plain in some driver tests 2020-11-04 13:53:01 -08:00
Doug Gregor
1be17a2550 [Darwin test config] Use the SDK when running swift/swiftc in tests.
The Swift driver (swift/swiftc) is supposed to always be used with an
accompanying SDK, which it derives from the environment. Our test
infrastructure was clearing out this SDK, making it deviate from the
normal operating environment unnecessarily. Switch to providing the
SDK used for building the standard library, which provides a
more-consistent test environment, and tag the few places in tests
where we have explicit dependencies on "no SDK."
2020-06-15 14:11:08 -07:00
Luciano Almeida
49efa57a26 Updating diagnostic message 2019-07-23 19:30:47 -03:00
Luciano Almeida
3bcc072cfe Changing diagnose from error to warning, updating message and tests 2019-07-22 20:58:19 -03:00
Luciano Almeida
0d8da23336 Diagnose libarclite not found on darwing toolchain 2019-07-21 22:27:05 -03:00
Brent Royal-Gordon
1e81ced48d Revert "Revert "Look up runtime libraries in SDK"" 2019-07-03 14:18:48 -07:00
Xi Ge
fdd41aeb68 Revert "Look up runtime libraries in SDK (#25740)"
This reverts commit b818b441f2.
2019-06-25 17:48:41 -07:00
Brent Royal-Gordon
b818b441f2 Look up runtime libraries in SDK (#25740)
In #23175, we started looking in the SDK for swiftmodules, but we want to look for the dylibs there too. Fixes <rdar://problem/52059706>.
2019-06-25 15:39:03 -07:00
Deyton Sehn
f2447bc1b8 [Driver] Clarify unsupported option message (#11448)
Previously, with the tool and option both included in the suggestion, it
was not immediately clear which of the two was being suggested as a fix.

Resolves SR-5677.
2017-08-15 09:17:36 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Jordan Rose
d4ffaa3759 [test] Check LD_LIBRARY_PATH a little less strictly.
LD_LIBRARY_PATH is one of the few environment variables the LLVM 'lit'
tool /doesn't/ strip out, presumably because on some Linux systems
it's necessary to run some of the built products being tested.
However, the Swift driver also uses LD_LIBRARY_PATH when providing -L
options to the script interpreter on Linux. Weaken some of our tests
when there's an LD_LIBRARY_PATH in the environment.

(There are similar environment variables on OS X, but we don't have to
do anything special there because lit /does/ strip those out. This is
presumably okay because all of LLVM's load-time dependencies on OS X
are in standard system locations.)

https://bugs.swift.org/browse/SR-813
2016-06-09 20:19:55 -07:00
Jordan Rose
04915c4f5a [test] Adjust tests for OS X's "System Integrity Protection".
test/Driver/environment.swift is trying to test that the driver can set
environment variables that the frontend will use, but the only environment
variables we set are ones that are blocked by OS X's "System Integrity
Protection" feature when invoking a restricted binary---such as /bin/sh.
We could compile a tiny app that calls getenv, but that's a bit heavy for
this test. Instead, just limit it to non-OS-X hosts.

test/Driver/options-interpreter.swift is testing the effect of the /user/
setting the same sensitive environment variables. In this case, we want to
make sure we're calling the Swift driver directly so that we don't run afoul
of the same limitations environment.swift was seeing.

Fixes rdar://problem/23771412 (which is just about re-enabling these tests).
2015-12-10 16:21:14 -08:00
Jordan Rose
40584f830a [test] Add a Radar to the tests I disabled in f869e9e6.
I filed this under Radar rather than bugs.swift.org because it's /only/ our
CI system that's failing, and external contributors have no insight into
that anyway. Hopefully I'll be able to get to the bottom of this soon.
2015-12-04 18:37:14 -08:00
Jordan Rose
f869e9e653 Temporarily disable tests to unblock Apple's internal CI.
Not sure why these are failing. I'll either get back to them later today
or file a proper JIRA bug.
2015-12-04 14:44:22 -08:00
Jordan Rose
4f9367041f [Driver] Always use the runtime resource library path for DYLD_LIBRARY_PATH.
...when interpreting. Otherwise, the script may depend on library X, which
depends on library Y, where library Y is a standard Swift library, located
in lib/swift/$PLATFORM/.

Finishes rdar://problem/23588774
2015-12-04 12:18:48 -08:00
Jordan Rose
8021ed0873 [Driver] Set [DY]LD_LIBRARY_PATH when building an interpreter job.
That's DYLD_LIBRARY_PATH on OS X and LD_LIBRARY_PATH on Linux for -L,
and DYLD_FRAMEWORK_PATH on OS X for -F.

Note that this commit doesn't actually include the setenv calls yet, so an
end-to-end test is coming in the next commit.

Part of rdar://problem/23588774
2015-12-04 12:18:47 -08:00
Ben Langmuir
d197964680 Rename -integrated-repl to -deprecated-integrated-repl
Swift SVN r20781
2014-07-30 22:09:37 +00:00
Ben Langmuir
fdcee9c501 Clean up the command line interface for 'swift'
In the interactive driver, disable a bunch of flags that only work with
swiftc driver (NoInteractiveOption => disallowed, doesn't show up in
help when invoked as 'swift').  Also move some options to HelpHidden
(hidden from -h in both 'swift' and 'swiftc') that we don't need to
advertise.

Swift SVN r20780
2014-07-30 22:09:28 +00:00
Ben Langmuir
920a8ff343 Make using the -i flag an error
This flag is now obsoleted by the interactive driver and simply
complicates understanding the command-line parsing. Making it an error
to force users to move also allows us to reuse the flag in the future if
we like.

Swift SVN r20641
2014-07-28 20:19:27 +00:00
Ben Langmuir
1fc40c5a2a Bring back -parse-stdlib in the interactive driver
This actually does something useful (and the frontend bits are already
being tested).  <rdar://problem/17821313>

Swift SVN r20624
2014-07-28 15:43:39 +00:00
Ben Langmuir
07a3c7cbd5 Switch to the new swift/swiftc commmand line interface
This makes the command line interface to 'swift' the same as what was
previously in 'swifti', and removes the staging symlink.

For posterity, the command line behaviour for 'swift' is now:
* `swift` -> start the repl
* `swift script.swift` -> run script.swift (the old -i mode)
* Any arguments after the input file are forwarded to the script as
  Process.arguments
* A shebang line is something like #!/usr/bin/xcrun swift

The batch compiler 'swiftc' behaves much like the old 'swift'
executable, but without the interactive bits now in 'swifti'.

<rdar://problem/17710788>

Swift SVN r20540
2014-07-25 13:28:21 +00:00
Ben Langmuir
d2ef235237 Move the lit tests over to the new swift/swiftc interfaces
Most of the tests just got moved to swiftc, but some of them were
duplicated to apply to both swiftc and swift. A handful still use the
existing 'swift' because they are for the existing '-i' syntax.

Note: this means config.swift_driver now uses the staging symlink
'swifti'. The only thing preventing us from dropping the 'i' and getting
rid of the old interface is that Xcode hasn't moved to swiftc yet
<rdar://problem/17769327>.

Swift SVN r20467
2014-07-24 04:34:10 +00:00
Ben Langmuir
afd88cab2a Add parsing support for swifti
Parse until the first input, and then collect the remaining arguments
and forward them to the script.

Swift SVN r20437
2014-07-23 22:42:05 +00:00
Ben Langmuir
a96009c52f Add a 'swifti' symlink to stage in the upcoming driver changes
For now, keep 'swift' the same and put all the interactive driver
changes under 'swifti'. When these are in good shape, I will remove
swifti and make 'swift' the interactive driver as discussed.

Swift SVN r20359
2014-07-23 02:30:39 +00:00
Ben Langmuir
8b7cc4f619 Make -i compatible with shebangs and forward arguments correctly
The driver option -i now requires an input file as argument, and any
options after the input file will be treated as arguments to the
interpretted file.

This also renames the frontend option to -interpret, since it is parsed
as a flag, unlike -i. We could support -interpret in the driver if we
wanted, which would allow us to use --, but wouldn't work with shebang
scripts. For now, it's frontend-only.

Swift SVN r19718
2014-07-09 02:37:42 +00:00
Jordan Rose
67f319b747 [Driver] Hook up -emit-dependencies option, but don't do anything with it yet.
Part of <rdar://problem/14899639>

Swift SVN r18044
2014-05-14 00:34:07 +00:00
Greg Parker
25445d2dff [test] iOS-ify most remaining tests.
Tests that still aren't iOS-safe but should be are all marked `FIXME: iOS`.


Swift SVN r13625
2014-02-07 04:42:51 +00:00