Commit Graph

25 Commits

Author SHA1 Message Date
Ben Barham
36632cde49 [rebranch] Temporarily fix lit target_triple
Any substring of `target_triple` is allowed as a feature (when used in
REQUIRES/UNSUPPORTED/XFAIL) in `lit.py`. This is what allows eg. `XFAIL:
linux` even though `linux` isn't listed as an available feature.

`TARGET_TRIPLE` was renamed to `LLVM_TARGET_TRIPLE` upstream, so rename
it here as well. Going forward we should remove `target_triple` entirely
and use our `OS=...` features instead.
2022-05-18 16:29:46 -07:00
Konrad `ktoso` Malawski
6008b32789 [Distributed] initial distributed support, fixed availability (#37650)
* [Distributed] Initial distributed checking

* [Distributed] initial types shapes and conform to DistributedActor

* [Distributed] Require Codable params and return types

* [Distributed] initial synthesis of fields and constructors

* [Distributed] Field and initializer synthesis

* [Distributed] Codable requirement on distributed funcs; also handle <T: Codable>

* [Distributed] handle generic type params which are Codable in dist func

[Distributed] conformsToProtocol after all

* [Distributed] Implement remote flag on actors

* Implement remote flag on actors

* add test

* actor initializer that sets remote flag

[Distributed] conformances getting there

* [Distributed] dont require async throws; cleanup compile tests

* [Distributed] do not synthesize default implicit init, only our special ones

* [Distributed] properly synth inits and properties; mark actorTransport as _distributedActorIndependent

Also:

- do not synthesize default init() initializer for dist actor

* [Distributed] init(transport:) designated and typechecking

* [Distributed] dist actor initializers MUST delegate to local-init

* [Distributed] check if any ctors in delegation call init(transport:)

* [Distributed] check init(transport:) delegation through many inits; ban invoking init(resolve:using:) explicitly

* [Distributed] disable IRGen test for now

* [Distributed] Rebase cleanups

* [Concurrent] transport and address are concurrent value

* [Distributed] introduce -enable-experimental-distributed flag

* rebase adjustments again

* rebase again...

* [Distributed] distributed functions are implicitly async+throws outside the actor

* [Distributed] implicitly throwing and async distributed funcs

* remove printlns

* add more checks to implicit function test

* [Distributed] resolve initializer now marks the isRemote actor flag

* [Distributed] distributedActor_destroy invoked instead, rather than before normal

* [Distributed] Generate distributed thunk for actors

* [distributed] typechecking for _remote_ functions existing, add tests for remote funcs

* adding one XFAIL'ed task & actor lifetime test

The `executor_deinit1` test fails 100% of the time
(from what I've seen) so I thought we could track
and see when/if someone happens to fix this bug.

Also, added extra coverage for #36298 via `executor_deinit2`

* Fix a memory issue with actors in the runtime system, by @phausler

* add new test that now passes because of patch by @phausler

See previous commit in this PR.
Test is based on one from rdar://74281361

* fix all tests that require the _remote_ function stubs

* Do not infer @actorIndependent onto `let` decls

* REVERT_ME: remove some tests that hacky workarounds will fail

* another flaky test, help build toolchain

* [Distributed] experimental distributed implies experimental concurrency

* [Distributed] Allow distributed function that are not marked async or throws

* [Distributed] make attrs SIMPLE to get serialization generated

* [Distributed] ActorAddress must be Hashable

* [Distributed] Implement transport.actorReady call in local init

* cleanup after rebase

* [Distributed] add availability attributes to all distributed actor code

* cleanup - this fixed some things

* fixing up

* fixing up

* [Distributed] introduce new Distributed module

* [Distributed] diagnose when missing 'import _Distributed'

* [Distributed] make all tests import the module

* more docs on address

* [Distributed] fixup merge issues

* cleanup: remove unnecessary code for now SIMPLE attribute

* fix: fix getActorIsolationOfContext

* [Distributed] cmake: depend on _concurrency module

* fixing tests...

* Revert "another flaky test, help build toolchain"

This reverts commit 83ae6654dd.

* remove xfail

* clenup some IR and SIL tests

* cleanup

* [Distributed] fix cmake test and ScanDependencies/can_import_with_map.swift

* [Distributed] fix flags/build tests

* cleanup: use isDistributed wherever possible

* [Distributed] don't import Dispatch in tests

* dont link distributed in stdlib unittest

* trying always append distributed module

* cleanups

* [Distributed] move all tests to Distributed/ directory

* [lit] try to fix lit test discovery

* [Distributed] update tests after diagnostics for implicit async changed

* [Distributed] Disable remote func tests on Windows for now

* Review cleanups

* [Distributed] fix typo, fixes Concurrency/actor_isolation_objc.swift

* [Distributed] attributes are DistributedOnly (only)

* cleanup

* [Distributed] cleanup: rely on DistributedOnly for guarding the keyword

* Update include/swift/AST/ActorIsolation.h

Co-authored-by: Doug Gregor <dgregor@apple.com>

* introduce isAnyThunk, minor cleanup

* wip

* [Distributed] move some type checking to TypeCheckDistributed.cpp

* [TypeCheckAttr] remove extra debug info

* [Distributed/AutoDiff] fix SILDeclRef creation which caused AutoDiff issue

* cleanups

* [lit] remove json import from lit test suite, not needed after all

* [Distributed] distributed functions only in DistributedActor protocols

* [Distributed] fix flag overlap & build setting

* [Distributed] Simplify noteIsolatedActorMember to not take bool distributed param

* [Distributed] make __isRemote not public

* [Distributed] Fix availability and remove actor class tests

* [actorIndependent] do not apply actorIndependent implicitly to values where it would be illegal to apply

* [Distributed] disable tests until issue fixed

Co-authored-by: Dario Rexin <drexin@apple.com>
Co-authored-by: Kavon Farvardin <kfarvardin@apple.com>
Co-authored-by: Doug Gregor <dgregor@apple.com>
2021-05-28 07:22:03 +09:00
Ben Langmuir
683a68d738 Disable runtime unit test with use_os_stdlib
This test is failing in back deployment testing due to it failing to
find _Concurrency. Disable the test until we can figure out a more
targeted solution.

rdar://78139218
2021-05-25 10:07:04 -07:00
Konrad `ktoso` Malawski
0c75bd2a39 Revert Initial distributed, some issues to be fixed first (#37556)
* Revert "[Distributed] disable tests until issue fixed"

This reverts commit 0a04278920.

* Revert "[Distributed] Initial `distributed` actors and functions and new module (#37109)"

This reverts commit 814ede0cf3.
2021-05-21 19:28:48 +09:00
Konrad `ktoso` Malawski
814ede0cf3 [Distributed] Initial distributed actors and functions and new module (#37109)
* [Distributed] Initial distributed checking

* [Distributed] initial types shapes and conform to DistributedActor

* [Distributed] Require Codable params and return types

* [Distributed] initial synthesis of fields and constructors

* [Distributed] Field and initializer synthesis

* [Distributed] Codable requirement on distributed funcs; also handle <T: Codable>

* [Distributed] handle generic type params which are Codable in dist func

[Distributed] conformsToProtocol after all

* [Distributed] Implement remote flag on actors

* Implement remote flag on actors

* add test

* actor initializer that sets remote flag

[Distributed] conformances getting there

* [Distributed] dont require async throws; cleanup compile tests

* [Distributed] do not synthesize default implicit init, only our special ones

* [Distributed] properly synth inits and properties; mark actorTransport as _distributedActorIndependent

Also:

- do not synthesize default init() initializer for dist actor

* [Distributed] init(transport:) designated and typechecking

* [Distributed] dist actor initializers MUST delegate to local-init

* [Distributed] check if any ctors in delegation call init(transport:)

* [Distributed] check init(transport:) delegation through many inits; ban invoking init(resolve:using:) explicitly

* [Distributed] disable IRGen test for now

* [Distributed] Rebase cleanups

* [Concurrent] transport and address are concurrent value

* [Distributed] introduce -enable-experimental-distributed flag

* rebase adjustments again

* rebase again...

* [Distributed] distributed functions are implicitly async+throws outside the actor

* [Distributed] implicitly throwing and async distributed funcs

* remove printlns

* add more checks to implicit function test

* [Distributed] resolve initializer now marks the isRemote actor flag

* [Distributed] distributedActor_destroy invoked instead, rather than before normal

* [Distributed] Generate distributed thunk for actors

* [distributed] typechecking for _remote_ functions existing, add tests for remote funcs

* adding one XFAIL'ed task & actor lifetime test

The `executor_deinit1` test fails 100% of the time
(from what I've seen) so I thought we could track
and see when/if someone happens to fix this bug.

Also, added extra coverage for #36298 via `executor_deinit2`

* Fix a memory issue with actors in the runtime system, by @phausler

* add new test that now passes because of patch by @phausler

See previous commit in this PR.
Test is based on one from rdar://74281361

* fix all tests that require the _remote_ function stubs

* Do not infer @actorIndependent onto `let` decls

* REVERT_ME: remove some tests that hacky workarounds will fail

* another flaky test, help build toolchain

* [Distributed] experimental distributed implies experimental concurrency

* [Distributed] Allow distributed function that are not marked async or throws

* [Distributed] make attrs SIMPLE to get serialization generated

* [Distributed] ActorAddress must be Hashable

* [Distributed] Implement transport.actorReady call in local init

* cleanup after rebase

* [Distributed] add availability attributes to all distributed actor code

* cleanup - this fixed some things

* fixing up

* fixing up

* [Distributed] introduce new Distributed module

* [Distributed] diagnose when missing 'import _Distributed'

* [Distributed] make all tests import the module

* more docs on address

* [Distributed] fixup merge issues

* cleanup: remove unnecessary code for now SIMPLE attribute

* fix: fix getActorIsolationOfContext

* [Distributed] cmake: depend on _concurrency module

* fixing tests...

* Revert "another flaky test, help build toolchain"

This reverts commit 83ae6654dd.

* remove xfail

* clenup some IR and SIL tests

* cleanup

* [Distributed] fix cmake test and ScanDependencies/can_import_with_map.swift

* [Distributed] fix flags/build tests

* cleanup: use isDistributed wherever possible

* [Distributed] don't import Dispatch in tests

* dont link distributed in stdlib unittest

* trying always append distributed module

* cleanups

* [Distributed] move all tests to Distributed/ directory

* [lit] try to fix lit test discovery

* [Distributed] update tests after diagnostics for implicit async changed

* [Distributed] Disable remote func tests on Windows for now

* Review cleanups

* [Distributed] fix typo, fixes Concurrency/actor_isolation_objc.swift

* [Distributed] attributes are DistributedOnly (only)

* cleanup

* [Distributed] cleanup: rely on DistributedOnly for guarding the keyword

* Update include/swift/AST/ActorIsolation.h

Co-authored-by: Doug Gregor <dgregor@apple.com>

* introduce isAnyThunk, minor cleanup

* wip

* [Distributed] move some type checking to TypeCheckDistributed.cpp

* [TypeCheckAttr] remove extra debug info

* [Distributed/AutoDiff] fix SILDeclRef creation which caused AutoDiff issue

* cleanups

* [lit] remove json import from lit test suite, not needed after all

* [Distributed] distributed functions only in DistributedActor protocols

* [Distributed] fix flag overlap & build setting

* [Distributed] Simplify noteIsolatedActorMember to not take bool distributed param

* [Distributed] make __isRemote not public

Co-authored-by: Dario Rexin <drexin@apple.com>
Co-authored-by: Kavon Farvardin <kfarvardin@apple.com>
Co-authored-by: Doug Gregor <dgregor@apple.com>
2021-05-21 09:12:29 +09:00
swift-ci
7ee2a5c087 Merge pull request #37186 from Catfish-Man/missing-dependency 2021-05-10 17:35:34 -07:00
David Smith
b16218660a Add missing _Concurrency dependency to the Dispatch overlay 2021-05-10 13:00:42 -07:00
Artem Chikin
ae2e856f9b Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
This reverts commit 937e1a365c, reversing
changes made to a5440a8abd.
2021-04-28 15:11:36 -07:00
Artem Chikin
1e44ed00eb Revert "Always build SwiftDriver and use it as default compiler driver" 2021-04-28 11:20:21 -07:00
Artem Chikin
c2dc8e3d07 Always build (and use) the new SwiftDriver as the default compiler driver.
This will make sure that compiler developers are using the new driver when they build the compiler locally and use it.

- Adds a new build-script product category: before_build_script_impl for products we wish to build before the impl products.
- Adds a new EarlySwiftDriver product to that category, which gets built with the host toolchain.
- Adds an escape hatch: --skip-early-swift-driver
- Adjusts the swift CMake configuration with an additional step: swift_create_early_driver_symlinks which (if one was built) creates symlinks in the swift build bin directory to the EarlySwiftDriver swift-driver and swift-help executables.
- Adds a new test subset : only_early_swiftdriver, which will get built into a corresponding CMake test target: check-swift-only_early_swiftdriver-* which runs a small subset of driver-related tests against the Early SwiftDriver.
  - This subset is run always when the compiler itself is tested (--test is specified)
  - With an escape disable-switch: --skip-test-early-swift-driver
  - All tests outside of only_early_swiftdriver are forced to run using the legacy C++ driver (to ensure it gets tested, still).

NOTE: SwiftDriver product (no 'Early') is still the main product used to build the driver for toolchain installation into and for executing the product's own tests. This change does not affect that.
2021-04-26 12:17:32 -07:00
Eric Miotto
19a4df331c [Test] Propagate XDG_CACHE_HOME to lit tests
This is another tool we can leverage to configure separate caches for CI
runs in Linux to hopefully reduce the likelihood of module cache
related issues.
Also this will allow us to respect the default values for the
environment we are running in.

As per clang source code, the environment variable only impacts Linux environments.

Addresses rdar://73582047
2021-02-01 12:33:20 -08:00
David Zarzycki
283713d61d [Testing] Formalize stress tests
Stress tests are, by definition, stressful. They intentionally burn a
lot of resources by using randomness to hopefully surface state machine
bugs. Additionally, many stress tests are multi-threaded these days and
they may attempt to use all of the available CPUs to better uncover
bugs. In isolation, this is not a problem, but the test suite as a whole
assumes that individual tests are single threaded and therefore running
multiple stress tests at once can quickly spiral out of control.

This change formalizes stress tests and then treats them like long
tests, i.e. tested via 'check-swift-all' and otherwise opt-in.

Finally, with this change, the CI build bots might need to change if
they are still only testing 'validation' instead of all of the tests.
I see three options:

1) Run all of the tests. -- There are very few long tests left these
   days, and the additional costs seems small relative to the cost of
   the whole validation test suite before this change.
2) Continue checking 'validation', now sans stress tests.
3) Check 'validation', *then* the stress tests. If the former doesn't
   pass, then there is no point in the latter, and by running the stress
   tests separately, they stand a better chance of uncovering bugs and
   not overwhelming build bot resources.
2018-03-20 21:45:28 -04: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
Greg Parker
3488c8091a [test] Add long test machinery to test/Unit. Use it to test max refcount. (#4594) 2016-09-02 01:36:41 -07:00
Harlan
1625d97976 Switch to llvm-profdata's pooled profdata merge (#3281) 2016-07-01 16:45:21 -07:00
Rintaro Ishizaki
45acd477c0 [test] Get Swift-Unit test suite to work
- Use correct variable name in test/Unit/lit.site.cfg.in
2016-06-23 18:19:39 +09:00
Brian Gesiak
15c94f657d [unittests] Ignore googletest DWARF directories
The Swift build system does not generate DWARF symbols in the unittests build
directory. For build systems that do, however, files would be generated with
the test suffix "Tests". These need to be excluded because otherwise
`lit.formats.GoogleTest` tries to execute them.
2016-04-04 13:03:06 -04:00
Harlan Haskins
b1d6e17d9f [coverage] Added coverage_mode definitions in validation test and Unit test lit.site.cfg.in 2016-01-28 15:31:03 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
Brian Gesiak
a45a4260d8 [python] Use PEP-0008 compliant code headers
Running the Python style guide checker
[`pep8`](https://pypi.python.org/pypi/pep8) on the Python code headers
in this repository results in the following error being emitted:

    $ pep8 utils/build-script
    utils/build-script:1:1: E265 block comment should start with '# '
    utils/build-script:3:1: E266 too many leading '#' for block comment
    utils/build-script:5:1: E266 too many leading '#' for block comment
    utils/build-script:6:1: E266 too many leading '#' for block comment
    utils/build-script:8:1: E266 too many leading '#' for block comment
    utils/build-script:9:1: E266 too many leading '#' for block comment
    utils/build-script:11:1: E265 block comment should start with '# '
    utils/build-script:11:80: E501 line too long (80 > 79 characters)

The problem is that the code header used in most Python files in the
repository:

1. Do not place a space in between `#` and the rest of the comment.
2. Contains some lines that just barely exceed the recommend length
   limit.

In addition, not all code headers in the repository follow the same
template.

This commit moves all Python code headers to the following template:

    # subfolder/file_name.py - Very brief description -*- python -*--
    #
    # This source file is part of the Swift.org open source project
    #
    # Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
    # Licensed under Apache License v2.0 with Runtime Library Exception
    #
    # See http://swift.org/LICENSE.txt for license information
    # See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
    #
    # -----------------------------------------------------------------------------
    #
    # This file contains stuff that I am describing here in the header and will
    # be sure to keep up to date.
    #
    # ----------------------------------------------------------------------------
2015-12-24 11:35:53 -05:00
Jordan Rose
d90e01f0ce [test] Throw away logic for detecting LLVM build directories.
We were never in this situation. For future reference, there are
two ways to use lit manually:

% lit.py $BUILD/swift*/test-macosx-x86_64/$TESTS
% lit.py --param swift_site_config=$BUILD/swift*/test-macosx-x86_64/lit.site.cfg test/$TESTS

The latter is more verbose, but lets you point at real test files in the
source directory instead of pretending they exist in the build directory.
There are probably still further improvements to be made here.

(P.S. I suggest using -sv if running lit from the command line.)

Swift SVN r31647
2015-09-03 00:51:35 +00:00
Jordan Rose
99febda07f Simplify the CMake-generated lit.py invocation.
Now it's down to what I use myself, plus the --xunit-xml-output flag.
I also threw out a fair number of options we weren't using.

Swift SVN r31646
2015-09-03 00:51:25 +00:00
Doug Gregor
68125d5275 Update lit configuration per LLVM r188108.
Swift SVN r7145
2013-08-12 14:18:26 +00:00
John McCall
eaae8b50d1 Add a unit test suite, including a test for
swift_getGenericMetadata.  Mostly ripped off clang's
support for same.  I did not feel confident in pulling
over the CMake equivalents, so someone else will need to.

Swift SVN r2982
2012-10-11 06:51:47 +00:00