Commit Graph

70 Commits

Author SHA1 Message Date
Calum Grant
7cadb0a574 Swift extractor: Simplify declarations back 2024-01-16 11:31:15 +00:00
Calum Grant
f400a5f49f Swift extractor: Fix Linux build 2024-01-16 11:05:05 +00:00
Calum Grant
2cc574dc70 Swift extractor: Use a global variable for the extractor name 2024-01-16 10:56:18 +00:00
Calum Grant
39edfa3c14 Swift extractor: Rename a SwiftDiagnostic to Diagnostic 2024-01-15 09:34:28 +00:00
Alex Denisov
6cbf8abf59 Swift: do not trace codesign binary 2023-12-18 14:24:07 +01:00
Paolo Tranquilli
e25a655509 Swift: fix Linux compatibility problem and fetch resource dir from toolchain
This fetches the resource directory directly from the released
toolchains, allowing us to stop prebuilding and assembling them.
Moreover insertion of our resource directory is moved to the lua
tracing configuration (solving a `TODO`) and enhanced. Now all options
that start with the original resource directory (either explicit or
implied) are redirected to our resource directory.

This solves a problem where `-I <original resource dir>/some/path` was
passed to the extractor and did not work.

This works around the 5.9 linux compatibility problem by including the
`PackageDescription` swift modules in the in-dist toolchain. Copying the
toolchain and fixing the `-I` flag was not enough as for some reason
compilation of `PackageDescription.swiftinterface`  was causing a crash
in the SIL pass. We work around that by pre-compiling those modules
during the build and  including `.swiftmodule` files in the resource
directory.

TODO (apart from testing):
* the libraries included in the macOS toolchain are now fat (they were
  intel only before), occupying more space. We should see if we need to
  trim them down.
* there might be other swiftinterface files causing problems on linux
  lurking around...
* if we go with this, we can simplify and trim down the prebuilding we
  do leaving out the resource directory.
2023-10-31 16:20:58 +01:00
Alex Denisov
c1da2dfa73 Swift: fix autobuild.sh 2023-08-31 09:40:13 +02:00
Alex Denisov
202a4cd1a2 Swift: teach autobuilder about SPM, CocoaPods, and Carthage 2023-08-18 13:17:57 +02:00
Alexandre Boulgakov
679df1e61b Swift: Add "autobuilder" on Windows that simply shows an error. 2023-06-16 17:23:50 +01:00
Alexandre Boulgakov
2bb3101316 Swift: Rename incompatible OS diagnostic to clarify that it's for the autobuilder. 2023-06-16 17:22:43 +01:00
Alexandre Boulgakov
bc48968def Swift: Build incompatible OS diagnostic on all platforms. 2023-06-16 17:22:43 +01:00
Alex Denisov
0479ef5b9c Merge remote-tracking branch 'origin/rc/3.10' into alexdenisov/rc3.10_mergeback 2023-06-16 10:13:23 +02:00
Alex Denisov
93b9115217 Swift: package resource dir from precomiled toolchain 2023-06-14 16:17:44 +02:00
Paolo Tranquilli
c945d65b2d Swift: add clang ignored flag 2023-06-14 16:17:44 +02:00
Alexandre Boulgakov
5450585c1c Swift: Remove SwiftDiagnostic constructor (C++20 todo). 2023-06-08 13:11:14 +01:00
Paolo Tranquilli
dc26dc81a9 Merge pull request #13370 from github/redsun82/swift-fix-cmake
Swift: fix cmake generation
2023-06-05 14:52:40 +02:00
Paolo Tranquilli
400176f677 Swift: fix cmake generation
The bazel -> cmake generator is currently not capable of handling
separate included generated cmake files making use of common C/C++
dependencies.

To work around this limitation, a single generated cmake is now in
place. Long-term, we should either:
* make the cmake generator handle common dependencies gracefully, or
* make the cmake generation aspect travel up `pkg_` rules `srcs`
  attributes
so to avoid having to list the targets to be generated in the top-level
`BUILD` file.

Other things fixed:
* removed some warning spam about redefined `BAZEL_CURRENT_REPOSITORY`
* fixed the final link step, that was failing because `libswiftCore.so`
  was not being linked.
2023-06-05 11:12:11 +02:00
Michael B. Gale
5d89b0739b Swift: Remove .cmd script 2023-06-05 09:12:21 +01:00
Michael B. Gale
e48fc66782 Swift: Add identify-environment script 2023-05-26 10:13:39 +01:00
Paolo Tranquilli
42d40900d3 Swift: reword TSP diagnostics after doc team review 2023-05-16 17:52:02 +02:00
Paolo Tranquilli
8291b2229a Swift: turn internal error into a TSP warning 2023-05-16 15:18:29 +02:00
Paolo Tranquilli
cfcd26cf0d Swift: support markdown TSP diagnostics 2023-05-15 13:48:24 +02:00
Paolo Tranquilli
9a555aea5f Merge branch 'main' into redsun82/swift-diagnostics-locations 2023-05-15 10:01:45 +02:00
Alexandre Boulgakov
0915d2ad77 Swift: Emit a diagnostic when attempting to use the autobuilder on Linux. 2023-05-11 14:43:13 +01:00
Paolo Tranquilli
4b40471f7b Swift: reconfigure default logging in qltest.sh
Route all logging to console by default, which ends up in the qltest.log
file.
2023-04-18 12:48:59 +02:00
Alex Denisov
b71c5e6c4b Swift: ignore sandbox-exec 2023-01-30 15:10:30 +01:00
Alex Denisov
63b4e5ef5c Swift: do not trace lsregister 2023-01-17 09:26:31 +01:00
Paolo Tranquilli
0dc717fd9c Swift: remove no more needed library path setting in qltest.sh 2022-12-13 09:13:43 +01:00
AlexDenisov
476bbfbdb7 Update qltest.sh 2022-11-04 13:04:24 +01:00
Paolo Tranquilli
daa4e99a2f Swift: fix executable permissions
These were broken by a merge done in the github UI.
2022-11-04 10:47:47 +01:00
Paolo Tranquilli
fdde84ac35 Merge branch 'main' into redsun82/swift-filtered-debugging 2022-11-04 10:42:48 +01:00
Paolo Tranquilli
231f2238c1 Swift: fix wrong test names 2022-11-04 10:06:57 +01:00
Paolo Tranquilli
4cfe11c319 Swift: allow expecting failure in qltest.sh 2022-11-04 10:03:00 +01:00
Paolo Tranquilli
3acd4486a3 Swift: add tests for RUN_UNDER support
While I would have preferred to add a proper unit test, this required
more infrastructure for mocking system calls. Instead I made `qltest.sh`
accept a `//codeql-extractor-env` header and used that to write a QL
test exercising the `RUN_UNDER` functionality.
2022-11-02 12:09:13 +01:00
Paolo Tranquilli
c8788bb5cd Swift: move libraries from tools to third_party 2022-10-26 07:05:56 +02:00
Paolo Tranquilli
d419749eb2 Swift: fix missing extraction of function bodies in SPM builds
For some reason `-experimental-skip-non-inlinable-function-bodies-without-types`
is passed to the frontend, which will skip extraction of most bodies.

By suppressing that option the problem goes away.
2022-10-24 17:11:13 +02:00
Paolo Tranquilli
04f6debb88 Swift: fix bazel packaging 2022-10-21 13:42:24 +02:00
Paolo Tranquilli
dbdf6ea489 Swift: fix qltest failure reporting
`qltest.sh` was not exiting with a failure when the extractor was
failing.
2022-10-21 12:54:09 +02:00
Paolo Tranquilli
cf7a5f877b Swift: add qltest.sh tests 2022-10-21 12:54:09 +02:00
Alex Denisov
0c3fd9fdcf Swift: %/\t/\s/ 2022-10-18 10:17:02 +02:00
Alex Denisov
023fea68d0 Merge branch 'main' into alexdenisov/xcode-autobuilder 2022-10-18 09:12:47 +02:00
Geoffrey White
0281bfedda Merge pull request #10689 from d10c/swift/cleartext-storage-nsuserdefaults
Swift: Query for CWE-312: Exposure of sensitive information using NSUserDefaults
2022-10-17 14:05:17 +01:00
Alex Denisov
f3ed54e7ba Swift: only run Xcode autobuilder on macOS 2022-10-17 10:14:06 +02:00
Alex Denisov
3040837062 Swift: introduce Xcode autobuilder 2022-10-14 12:45:48 +02:00
Josh Soref
480f1e24af spelling: unsupported
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-10-13 19:43:27 -04:00
Nora Dimitrijević
ea3510e766 Swift: DX changes based on my new setup experience 2022-10-10 14:08:04 +02:00
Alex Denisov
d9cfd06a88 Swift: do not skip newly supported CLI args 2022-09-22 11:17:07 +02:00
Alex Denisov
61d5cdc421 Swift: update Swift package to 5.7 2022-09-22 11:16:56 +02:00
Alex Denisov
dafa9d24f1 Swift: skip one more unsupported CLI arg 2022-09-20 15:04:54 +02:00
Alex Denisov
d6d8480b2a Swift: fix internal builds 2022-09-16 12:59:43 +02:00