Commit Graph

172 Commits

Author SHA1 Message Date
Cornelius Riemenschneider
a66f8209f9 Rust: Vendor 3rdparty dependencies.
We've been observing some performance issues using crate_universe on CI.
Therefore, we're moving to vendor the auto-generated BUILD files
in our repository. This should provide a nice speed boost, while
getting rid of the complexity of the "rust cache" job we've been using
when we had a lot of git dependencies.

This PR includes a vendor script, and I'll put up a CI job internally
that runs that vendor script on Cargo.toml and Cargo.lock changes, to check
that the vendored files are in sync.
2024-11-13 13:22:14 +01:00
Cornelius Riemenschneider
f900060e7f Bazel: Upgrade to bazel 8. 2024-10-24 13:30:57 +02:00
Paolo Tranquilli
8f451515e0 Bazel: print workaround for git_lfs_probe.py failing 2024-10-16 10:16:38 +02:00
Paolo Tranquilli
fd31e6d813 Bazel: skip git lfs endpoints presenting malformed data 2024-10-16 10:01:19 +02:00
Cornelius Riemenschneider
396bf93ac0 Merge pull request #17716 from github/criemen/rules-kotlin-2.0.0
Upgrade rules_kotlin to 2.0.0.
2024-10-10 15:07:50 +02:00
Cornelius Riemenschneider
4de0fefe86 Upgrade rules_kotlin to 2.0.0.
This is required for the bazel 8 upgrade, as one of the
incompatible-flag flips breaks 1.9.4.
2024-10-09 16:04:16 +02:00
Cornelius Riemenschneider
4c21444dd5 Bazel: Flip --incompatible_use_plus_in_repo_names.
We've hardcoded the tilde in a lot of places :(
This improves performance on Windows and gets us ready for Bazel 8.

We need an upgrade of rules_rust for this to work.
2024-10-09 14:04:05 +02:00
Paolo Tranquilli
7c80b33a63 Bazel: add forgotten files 2024-09-05 08:26:41 +02:00
Paolo Tranquilli
913a9263d2 Bazel: stub internal repo parts needed for building rust binaries
This is another shot at https://github.com/github/codeql/pull/17382,
using a different and more lightweight approach.

This allows building the ruby and python (and in the future also rust)
packs from within the codeql repository. This will:
* skip defining the glibc symbols checking, which only makes sense when
  building the release from the internal repository
* stub out our `universal_binary` rule, which we only need when building
  the release.
2024-09-05 08:16:28 +02:00
Paolo Tranquilli
0738e01e7e Bazel: fix logging bug in git_lfs_probe.py
The case of an `HTTPError` was printed to stdout (and therefore globbed
by bazel).

While I'm at it, I also introduced a timeout to `urlopen` and improved
the `no endpoints found` error message.
2024-08-27 09:12:37 +02:00
Cornelius Riemenschneider
3ac8108c4a Address review. 2024-08-23 17:26:05 +02:00
Cornelius Riemenschneider
f9bc97b2a1 crate_universe: Enable modext isolation.
This should allow us to build our python and ruby
code independently - in particular, we can now do shallow
checkouts of one without the other.
Previously, the modext introduced cross-dependency.
This also reduces the amount of work we do in the
crate universe processing for the other language, even
though it's unused.

This does need renaming the module, as otherwise
the generated paths from rules_rust get too long
for Windows :(
2024-08-18 21:00:30 +02:00
Paolo Tranquilli
e451f2b343 Bazel: fix typo 2024-08-07 20:54:40 +02:00
Paolo Tranquilli
58088b62df Bazel: make git_lfs_probe.py a bit more backward compatible 2024-08-07 16:46:31 +02:00
Paolo Tranquilli
c576a116f5 Bazel: make git_lfs_probe.py try all available endpoints 2024-08-07 12:38:43 +02:00
Paolo Tranquilli
b63bd2ad14 Bazel: format git_lfs_probe.py 2024-08-07 11:57:35 +02:00
Cornelius Riemenschneider
de47838c36 Remove unused exception class. 2024-07-31 11:31:11 +02:00
Cornelius Riemenschneider
1ce15ae2fd Fix exit code when ripunzip isn't called. 2024-07-31 08:09:53 +02:00
Cornelius Riemenschneider
fa6d61809e Fix hang for targets without ripunzip. 2024-07-31 00:38:50 +02:00
Cornelius Riemenschneider
674a5bb9b4 Bazel installer: Retry ripunzip step.
Ripunzip is great, but occasionally bugs out due to a parallelism issue.
As we don't want this to fail CI, retry the entire ripunzip/installation step
up to 3 times.
We need to clean up the working directory as ripunzip doesn't support overwriting
files. I've not been able to test this with the original issue (it doesn't seem
to reproduce locally for me), but I injected another error and got 3 retries
of installation.
2024-07-30 18:20:19 +02:00
Cornelius Riemenschneider
afb6e412f0 pkg.bzl: Disable remote caching of zipmerge steps. 2024-07-18 08:52:04 +02:00
Cornelius Riemenschneider
16660ab1df address review 2024-07-08 17:37:33 +02:00
Cornelius Riemenschneider
8df2e4952c address review 2024-07-08 17:27:17 +02:00
Cornelius Riemenschneider
bb78536804 Install script: Windows-compatible cleanup path.
Windows might need some retrying around deleting
the target directory.
2024-07-08 16:21:29 +02:00
Paolo Tranquilli
0669186713 Bazel: remove unneeded upstream rules_nodejs patch 2024-06-24 17:09:40 +02:00
Paolo Tranquilli
a02cf07833 Bazel: add nodejs mirror
This patches `rules_nodejs` with the contents of
https://github.com/bazelbuild/rules_nodejs/pull/3763
in order to allow specifying a mirror for nodejs, as nodejs.org has
hit us with intermittent downtimes.
2024-06-24 16:59:25 +02:00
Cornelius Riemenschneider
f41bd41bd0 Remove unused bzl files. 2024-06-17 15:15:08 +02:00
Cornelius Riemenschneider
58f69c9385 Make CodeQLPackInfo provider public. 2024-06-13 21:57:46 +02:00
Cornelius Riemenschneider
02100e58d9 Address review. 2024-06-13 21:55:56 +02:00
Cornelius Riemenschneider
92957a63ad Add prefix feature to codeql_pack_group.
Turns out we need this for our production targets.
2024-06-11 17:22:35 +02:00
Cornelius Riemenschneider
3cf719cb39 pkg.bzl: Significantly restructure codeql_pack rule.
This PR introduces a `codeql_pack_rule` that does the heavy lifting
of extracting arch- and common zip files for production dist building.
It also factors out the installer targets for individual packs,
as well as pack groups.

This changes the contract between the internal build system and the pack
definition significantly, which is why an accompanying internal PR is required.
No backwards compatibility layer is provided, as the PR as complex enough as-is.

The individual `codeql_pack` rules are now much simpler,
as they mostly stuff their inputs into a new `_CodeQLPackInfo` provider,
and let the installer and `codeql_pack_group` rules do the heavy lifting.
For working in the external repo with self-contained packs,
the per-pack installer targets are still available.
Internally, we'll only use the new `codeql_pack_group` targets
going forward, both for defining intree-dists and for building
the production zip files.
2024-06-11 13:15:05 +02:00
Cornelius Riemenschneider
092bc6445d Rust/bazel: Port to bzlmod.
This gets rid of our last workspace dependency.
In particular, this change also gets rid of the checked-in extra
lock files that took forever to generate.
2024-06-10 17:03:58 +02:00
Cornelius Riemenschneider
6731bccc92 C#: Provide skeleton to generate an assemblyInfo file.
Each unit gets a unique assemblyInfo file, on top
of the ones for entrypoints that also gets the git info embedded.
2024-06-07 15:24:53 +02:00
Paolo Tranquilli
61847bc58b Ripunzip: provide installer 2024-06-05 14:46:59 +02:00
Paolo Tranquilli
e693c2719d Kotlin: remove unneeded patch 2024-06-04 14:39:02 +02:00
Paolo Tranquilli
d1a2c0fbe4 Merge branch 'main' into redsun82/kotlin 2024-06-04 08:48:52 +02:00
Cornelius Riemenschneider
b9da01a384 Merge remote-tracking branch 'origin/main' into criemen/new-pkg 2024-06-03 15:47:15 +02:00
Cornelius Riemenschneider
5875ec272d Merge pull request #16627 from github/criemen/pkg-fix-install
`pkg.bzl`: Fix install targets.
2024-06-03 15:31:43 +02:00
Paolo Tranquilli
8479673419 Bazel: ignore non-default SSH endpoints in git_lfs_probe.py 2024-06-03 12:26:37 +02:00
Cornelius Riemenschneider
a42bdd9bb0 Update misc/bazel/pkg.bzl
Co-authored-by: Paolo Tranquilli <redsun82@github.com>
2024-06-03 10:53:08 +02:00
Cornelius Riemenschneider
cff78cca5e Cmake generator: Remove space in argument.
This space breaks when upgrading bazelisk on Windows.
Somehow, a space inside the argument messes up some argument-parsin
somewhere. Porbably due to Windows argument parsing
being not well-defined in how it splits a string into argv.
Removing the space works around the problem.

If the space is included, cmake suddenly can't find the bazelisk
binary anymore, despite happily executing `info output_base` earlier.
2024-06-02 23:56:31 +02:00
Paolo Tranquilli
25ab1a934d Merge branch 'main' into redsun82/bazel-fix 2024-05-31 14:03:20 +02:00
Cornelius Riemenschneider
14988002fa Address review. 2024-05-31 12:35:03 +02:00
Paolo Tranquilli
07f4288e1f Fix zipmerge build and test 2024-05-31 12:12:58 +02:00
Paolo Tranquilli
8e26f64f89 Bazel: fix non-swift macOS builds
This is meant to be cleaned up in a later PR with respect to the TODOs.
2024-05-31 11:49:36 +02:00
Cornelius Riemenschneider
e2cb5631d9 pkg.bzl: Fix install targets.
First, the labels used in this file need to be wrapped in `Label`,
so that we can use the installer target from the internal repo.
Second, when unpacking zips, the path passed to `ripunzip` included a trailing
`\n`, which caused `ripunzip` to fail.
2024-05-30 21:06:46 +02:00
Cornelius Riemenschneider
e43b773d7c Fix comment to indicate the correct order in the zip dict. 2024-05-30 17:58:22 +02:00
Cornelius Riemenschneider
d66d7d8a3a C#: Move to new packaging rules. 2024-05-30 14:25:16 +02:00
Cornelius Riemenschneider
60b5317c5f C++: Move to new packaging rules. 2024-05-30 14:25:15 +02:00
Cornelius Riemenschneider
9f3310d3d2 pkg.bzl: Add features to support the nolang dist.
In order to build the language-independent parts of our dist with `pkg.bzl`,
we need two override features:
* A way to set the prefix in the zip files to the empty string, so that our top-level files
  stay top-level.
* A way to put `codeql.exe` into the arch-specific zip, despite it not being under `CODEQL_PLATFORM`.
This PR implements both.
2024-05-30 13:03:57 +02:00