249 Commits

Author SHA1 Message Date
Paolo Tranquilli
c242466d31 Kotlin: first support for Kotlin extractor build 2024-04-03 16:30:57 +02:00
Paolo Tranquilli
0da4130bb9 Bazel: add LFS rules 2024-04-03 08:35:19 +02:00
Paolo Tranquilli
0a137c7b02 Bazel/Cmake: share build options 2024-02-29 15:35:21 +01:00
Paolo Tranquilli
81facd2fd6 Merge branch 'main' into redsun82/bazel-cmake 2024-02-29 14:28:00 +01:00
Paolo Tranquilli
b7df26e6c9 Bazel: make codeql compatible with workspace setup 2024-02-22 15:50:02 +01:00
Paolo Tranquilli
61bfe7e520 Bazel: rename internal module to semmle_code 2024-02-21 16:51:39 +01:00
Paolo Tranquilli
c0eeb7a34e Bazel: reference (and locally stub) internal module 2024-02-12 15:58:43 +01:00
Paolo Tranquilli
19bb8fe22d Bazel: use bzlmod 2024-02-12 10:55:40 +01:00
Paolo Tranquilli
b105d0cf9a Bazel/CMake: be more lenient with aquery
It turns out `bazel aquery` is not so well behaved on Windows, so we
need to accept that it reports errors and exits with an error.
2024-02-07 16:25:54 +01:00
Paolo Tranquilli
9cfef6e42f Bazel/CMake: auto detect all cc_binary/cc_test targets 2024-02-07 11:11:30 +01:00
Paolo Tranquilli
b93d108400 Bazel/CMake: drop confusing _INTERNAL_TRANSITION suffix 2024-01-10 12:00:40 +01:00
Cornelius Riemenschneider
b0599edb7e Bazel: Bump dependant rules versions.
This doesn't bump rules_python, as there's some incompatible changes in that
which will need further addressing.
2024-01-08 11:21:02 +01:00
Paolo Tranquilli
819fc52854 Bazel/CMake: use bazelisk to use correct bazel version 2023-12-13 15:32:06 +01:00
Paolo Tranquilli
9a4b56162e Bazel/CMake: small compatibility fix 2023-11-16 17:16:14 +01:00
Paolo Tranquilli
615a128770 Bazel/CMake: support new internal transition rules 2023-11-16 09:04:58 +01:00
Paolo Tranquilli
ef804c018d C++: make cmake generation work with internal rule cc_binary_add_features 2023-08-14 17:32:03 +02:00
Alex Denisov
d744b218f6 Misc: add bazel buildifer pre-commit hook 2023-06-30 13:07:04 +02:00
Paolo Tranquilli
be9d32a6c1 Bazel/CMake: make include not use cmake include
...but rather just pass along targets. This is required to fix CMake
generation in the internal repository.
2023-06-05 11:43:48 +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
Paolo Tranquilli
c7c12a7108 Swift: add json and date dependencies 2023-05-03 14:32:30 +02:00
Alexandre Boulgakov
36d34f199b Bazel: Add Abseil C++ dependency. 2023-04-24 21:59:57 +01:00
Paolo Tranquilli
cdd4e8021b Move swift/codegen to misc/codegen 2023-02-27 09:46:48 +01:00
Paolo Tranquilli
219ed64b74 Swift: reorganize bazel third party dependencies 2022-12-08 16:10:25 +01:00
Alex Denisov
0bfe502bb0 Swift: remove patches from the extractor
Moved elsewhere https://github.com/dsp-testing/codeql-swift-artifacts/pull/3
2022-11-30 15:36:09 +01:00
Alex Denisov
90d471b486 Swift: upgrade to Swift 5.7.1 2022-11-30 12:40:27 +01:00
Paolo Tranquilli
9731048836 Swift: remove an assert from swift headers
An interesting byproduct was finding a problematic `assert` in the
Swift headers. An incomplete `FallthroughStmt` was asserting on having
a destination. I did not find any other sensible way of getting rid of
the crash when running in debug mode than to patch the header.
2022-11-08 11:47:12 +01:00
Paolo Tranquilli
521e6235b5 Swift: use std::filesystem and picoSHA2
This replaces usages of `llvm::fs` and string manipulation with
`std::filesystem`, also replacing `std::string` with
`std::filesystem::path` where it made sense.

Moreover MD5 hashing used in macOS file remapping was replaced by
SHA256 hashing using a small header-only SHA256 C++ library with an
MIT license, https://github.com/okdshin/PicoSHA2.

File contents hashing was relocated to the newly created `file` library
for later planned reuse.
2022-10-26 13:23:44 +02:00
Paolo Tranquilli
c8788bb5cd Swift: move libraries from tools to third_party 2022-10-26 07:05:56 +02:00
Paolo Tranquilli
1866a98c77 Bazel/CMake: fix typo in README.md 2022-10-24 14:19:11 +02:00
Paolo Tranquilli
f49f6430a1 Bazel/CMake: make cmake runnable from outside the workspace
Also added a small `README.md` file.
2022-10-24 14:15:45 +02:00
Paolo Tranquilli
0ae70fda37 Bazel/CMake: make generated inclusion explicit 2022-10-14 10:57:40 +02:00
Paolo Tranquilli
d734ed9839 Bazel/CMake: fix multiple cmake generate targets 2022-10-14 10:12:40 +02:00
Paolo Tranquilli
3946448e7c Bazel/CMake: create compilation database by default
If on Windows and not in developer mode, the creation of the symbolic
link can be skipped by setting `CREATE_COMPILATION_DATABASE_LINK` to
`OFF`.
2022-10-14 09:58:09 +02:00
Paolo Tranquilli
739702b905 Bazel/CMake: make compilation db link symbolic 2022-10-14 08:57:16 +02:00
Paolo Tranquilli
2b47375190 Bazel/CMake: use -iquote 2022-10-14 08:54:15 +02:00
Paolo Tranquilli
b8b6b254bb Swift: cmake generator for better IDE support
A cmake generator in bazel is introduced allowing to import the Swift
extractor as a CMake project while keeping Bazel files as the source of
truth for the build.

Using the CMake project:
* requires bazel and clang to be installed and available on the command
  line
* does not require a previous bazel build, however
* will require a CMake reconfiguration for changes to generated code
  (like changes to the schema)
2022-10-13 15:25:24 +02:00
Alex Denisov
61d5cdc421 Swift: update Swift package to 5.7 2022-09-22 11:16:56 +02:00
Alex Denisov
9401eda8da Swift: use http_archive instead of new_git_repository since it's faster 2022-09-20 08:38:27 +02:00
Alex Denisov
d6d8480b2a Swift: fix internal builds 2022-09-16 12:59:43 +02:00
Alex Denisov
c638789f3e Swift: open(2) interception 2022-09-16 12:02:16 +02:00
Paolo Tranquilli
c2be267feb Swift: enable dynamic mode
Providing `--dynamic_mode=fully` (for example setting it in
`local.bazelrc`) will now work.

All runfiles are now copied in the extractor pack: in dynamic mode,
those will be the executable and the dynamic libraries, while in static
mode only the executable will be part of the runfiles.

Setting the correct `LD_LIBRARY_PATH` in `qltest.sh` then allows to
run tests with this pakcage. If we need something more, we can switch to
a wrapper script in place of `extractor` in the future.

Notice that `LD_LIBRARY_PATH` is also set in static mode, but that has
no consequence.
2022-05-03 12:33:24 +02:00
Alex Denisov
7332460268 Swift: teach bazel to install python dependencies 2022-04-29 14:05:36 +02:00
Paolo Tranquilli
9e3401ce59 make self repository name parametric
In a workspace macro we must use the exact repository name, and this
can be different when importing the workspace (it is different in
semmle-code).
2022-04-13 16:22:27 +02:00
Paolo Tranquilli
73d5691d91 update swift package 2022-04-13 16:22:27 +02:00
Paolo Tranquilli
e68172f4b0 Swift: fetch prebuilt swift and link against it
This is known to break linux integration in sembuild.
2022-04-13 16:22:27 +02:00
Paolo Tranquilli
141ba2e039 Bazel: rename workspace to codeql 2022-04-12 17:37:29 +02:00
Paolo Tranquilli
6440242268 Swift+Bazel: apply review comments 2022-04-12 16:03:20 +02:00
Paolo Tranquilli
a205b465ba Bazel: reorganization
* fixed 5.0.0 as bazel version
* made dependencies better loadable
* moved `//swift/install` to `//swift:create-extractor-pack` (following
  the clearer ruby naming)
* renamed `extractor_pack` to `extractor-pack` for consistency with Ruby
2022-04-12 12:40:59 +02:00
Paolo Tranquilli
13b2442fed Bazel: code reorganization 2022-04-12 12:40:59 +02:00