Commit Graph

40 Commits

Author SHA1 Message Date
Kavon Farvardin 81d6286ec5 NFC: avoid adding -enable-experimental-feature with no feature name 2026-04-20 17:37:36 -07:00
Evan Wilde 6db7c6ced8 Merge pull request #86989 from etcwilde/ewilde/llvm-nm-resilience
Testing: Resilience testing with `llvm-nm`
2026-02-09 09:19:59 -08:00
Evan Wilde f23637a882 utils/rth: decode bytes
The object returned by a failing command invocation is a bytes object,
which cannot be concatenated with a string directly. Decode it and split
it to make the missing symbol list clearer.
2026-02-06 16:52:47 -08:00
Kavon Farvardin 006a0a494a Reparenting: require an extension
This change forces you to write ``@reparented` relationships
on an extension of a protocol, rather than on the protocol
itself.

The ProtocolConformance needs to be associated with some
GenericContext and IRGen expects it to be an ExtensionDecl.
That environment defines under what conditions the conformance
exists. We also need to define witnesses for the new parent's
requirements in an extension anyway, so it's a natural fit.

The previous workaround for this was kind of awful, as it'd
require searching all the protocol's extensions and "guess"
which extension they want to represent the conformance. While
we could try to synthesize an extension, there's two
challenges there:

1. Due to SuppressedAssociatedTypes, it's not so simple to
synthesize an unconstrained ExtensionDecl.
2. We currently rely on same-type requirements to pin the
associated types to particular witnesses of those requirements
in the extension. So it's not purely unconstrained! For example,

```
extension Seq: @reparented BorrowSeq where Iter == MyIter {}
```

The constraints that are disallowed (but not yet diagnosed)
are conditional conformance requirements, as the default
conformance for a reparenting cannot depend on those.

Thus, it's better that programmers to specify the extension.
2026-02-03 16:40:21 -08:00
Kavon Farvardin 741089b849 utils: add --skip-application-back-deploy to rth
This mode was effectively removed from `rth`
in ba04d49 because it was unused. I do need this
to exclude the before_after scenario, which is
linking a newer app with an older library.
2026-02-03 16:39:19 -08:00
Kavon Farvardin b5e0f95a18 eliminate pipes in favor of shlex
This solves deprecation warnings in build-script:

```
DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
```

This change assumes that the minimum version
of Python3 is 3.3, which has `shlex.quote`.

Since our build bots currently use 3.6 as their
Python version, we can't yet use `shlex.join`
to further simplify some of the code using
quote.
2023-07-25 15:24:54 -07:00
Daniel Duan 3dfc40898c [NFC] Remove Python 2 imports from __future__ (#42086)
The `__future__` we relied on is now,  where the 3 specific things are
all included [since Python 3.0](https://docs.python.org/3/library/__future__.html):

* absolute_import
* print_function
* unicode_literals
* division

These import statements are no-ops and are no longer necessary.
2022-04-13 14:01:30 -07:00
3405691582 e81534960c [validation] Fix some portability test issues.
Here we fix a few portability issues affecting running the validation tests on OpenBSD. The remaining failures will be dealt with separately.

1. In the `rth` tool, ensure `-z origin` is specified to the linker when
   using `$ORIGIN`, as required on this platform.

2. Explicitly set the rpath in the `dsohandle-multi-module` execution
   test, since the test uses built dynamic libraries during the test.

3. Erase the environment variable instead of using `env -u`, the latter
   of which is not portable.
2021-02-06 16:36:44 -05: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
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
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
Karoy Lorentey e53071e240 [utils] Fix linter error (#25229) 2019-06-03 17:43:56 -07:00
Saleem Abdulrasool 1e630a5969 test: plumb --triple to the resilience test helper
The resilience test helper builds up invocations of the tooling.  In
order to do this, we need to know what host we are building for.  Plumb
the value for `-triple` from the test harness into the utility.  This
will be used subsequently to enable additional testing for Windows.
2019-06-02 17:55:34 -07:00
Slava Pestov 1159af50d9 Rename -enable-resilience to -enable-library-evolution and make it a driver flag
Fixes <rdar://problem/47679085>.
2019-03-14 22:24:26 -04:00
Slava Pestov b64db715a8 IRGen: Remove -enable-class-resilience staging flag 2019-02-08 14:22:00 -05:00
Slava Pestov ba04d49ebd Evolution: Replace unused --no-backward-deployment flag with --backward-deployment flag
This adds a new mode where we always build the app with the new library,
and run it with the old and new library. This is used to test backward
deployment of code that uses weak-linked symbols.

To ensure that we properly crash if we reference an undefined symbol that
is not weak linked, also pass a linker flag to bind symbols eagerly.
2018-12-03 20:36:03 -05:00
Slava Pestov ee8a3ea566 Evolution: Build tests with optimizations if required
Make sure we honor the swift_test_mode parameter, by passing in
the right optimization flags. Also if we're passing in any flags,
pass in -wmo too.
2018-11-28 12:39:04 -05:00
Slava Pestov 5243cc718d Evolution: Compare symbols before and after
A resilient change should not *remove* previously-public symbols.

Note that currently, the test_superclass_properties test does not
meet this critierion, because we always emit keypath property
descriptors, even when the property is an override. Fixing this
is a larger change that I'll address in a follow-on PR, so for now
I'm just going to disable the symbol check for this one test only.

Part of <rdar://problem/40432647>.
2018-11-15 19:55:46 -05:00
Daniel Rodríguez Troitiño d3e5af6f18 [android] Push test binaries w/o modifying executable name. (#19960)
At least test_rth.swift is checking the name of the executable
during the test, so renaming every executable to __executable in
Android will never work.

Also, during the rth tool execution, all the results from before
and after are pushed for every test. Since Android copies the
passed files without relative paths, the library files will
overwrite each other, making the test fail.

Depends on #19949 (more or less)
2018-11-02 11:03:08 -07:00
Jordan Rose 01a0de27ec [test] Update for remote-run-ing tests on a different macOS (#18966)
Most of this is just "remember to specify the inputs and outputs on
the command line, so remote-run can see them". A bit is "prefix
environment variables with '%env-'". And the last few are "yeah,
this was never going to work in a remote environment".

In the few cases where I couldn't think of anything reasonable, I just
marked the test as "UNSUPPORTED: remote_run", a new "feature".
2018-08-27 14:50:40 -07:00
Arnold Schwaighofer 8134920f6d Codesign validation-test/Evolution 2018-08-13 08:00:48 -07:00
Slava Pestov c7853fe086 IRGen: Bring back the -enable-class-resilience staging flag 2018-04-09 21:53:45 -07:00
Jordan Rose f9299e711c [test] rth: Use dynamic linking to properly test backwards-deployment (#14447)
The added test worked before as well; it's to make sure I didn't break
the existing behavior.
2018-02-08 17:14:10 -08:00
Slava Pestov a3d64451c1 Compile evolution tests with -swift-version 4 2018-01-14 21:39:53 -08:00
Hugh Bellamy c6fcbf0510 Python lint a bunch of files not currently python linted 2017-03-17 14:11:00 +07:00
Hugh Bellamy 4f23d61da0 Import print_function wherever we use print() in python code 2017-02-20 11:11:27 +07:00
practicalswift 6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
practicalswift 797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
practicalswift 0796eaad1f [Python] Fix 80-column violations 2016-03-09 23:52:11 +01:00
practicalswift 30b66ea036 Merge pull request #1584 from practicalswift/python-3-compatible-print
[Python] Use Py3k compatible print operator: print "foo" → print("foo")
2016-03-09 08:00:49 +01:00
Brian Gesiak c9000af795 Merge pull request #1526 from practicalswift/fix-pep8-violations-ii
[Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
2016-03-08 23:55:46 -05:00
practicalswift 0fd0c48648 [Python] Use Py3k compatible print operator: print "foo" → print("foo") 2016-03-08 23:10:52 +01:00
practicalswift 265835fdfc [Python] Use consistent import ordering for Python code
Ordering used:
1.) standard library imports
2.) third party imports
3.) local package imports

Each group is individually alphabetized.
2016-03-07 23:25:16 +01:00
practicalswift 183da818df [Python] Fix five classes of PEP-8 violations (E101/E111/E128/E302/W191)
* E101: indentation contains mixed spaces and tabs
* E111: indentation is not a multiple of four
* E128: continuation line under-indented for visual indent
* E302: expected 2 blank lines, found 1
* W191: indentation contains tabs
2016-03-07 22:36:23 +01:00
Slava Pestov 1fef536d62 resilient-test-helper: Add --no-backward-deployment flag
This is used when the application changes in an incompatible way.
2016-03-03 07:37:00 -08:00
Luke Larson c011d5f550 [rth] Flush stdout after print for correct output ordering 2016-02-17 18:11:36 -08:00
Luke Larson 24860d1e67 [rth] Don't raise an exception if tmp_dir doesn't exist 2016-02-17 11:51:58 -08:00
practicalswift 10b3e63b0f [Python] Fix two small PEP8 violations in recently introduced file "rth"
Before this commit:

```
$ flake8
./utils/rth:34:17: E127 continuation line over-indented for visual indent
./utils/rth:67:27: E127 continuation line over-indented for visual indent
$
```

After this commit:

```
$ flake8
$
```
2016-02-17 07:39:11 +01:00
Luke Larson f53db0ebd3 [rth] Add resilience test helper utility 2016-02-16 18:52:34 -08:00