53 Commits

Author SHA1 Message Date
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
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
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
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
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
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
Paolo Tranquilli
61847bc58b Ripunzip: provide installer 2024-06-05 14:46:59 +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
Paolo Tranquilli
07f4288e1f Fix zipmerge build and test 2024-05-31 12:12:58 +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
Paolo Tranquilli
2606d3f6d1 Reapply "Bazel: add codeql specific packaging library"
This reverts commit 31d6b9be4d.
2024-05-29 15:46:29 +02:00
Paolo Tranquilli
31d6b9be4d Revert "Bazel: add codeql specific packaging library" 2024-05-29 15:27:10 +02:00
Paolo Tranquilli
5672ddf8f3 Fix bazel formatting 2024-05-29 09:53:31 +02:00
Paolo Tranquilli
fbe1b56f2d Zipmerge: link test statically 2024-05-29 08:55:06 +02:00
Paolo Tranquilli
332d178298 Zipmerge: allow test to be run from internal repo 2024-05-28 17:37:34 +02:00
Paolo Tranquilli
5eb12b8503 Zipmerge: substitute stripped down slf4j jars with dummy ones 2024-05-28 16:15:20 +02:00
Paolo Tranquilli
c3ccf4d5a3 Zipmerge: substitute CPython archives with dummy ones 2024-05-28 15:47:24 +02:00
Paolo Tranquilli
67d622fa9d Bazel: actually run the zipmerge tests 2024-05-28 15:44:53 +02:00
Paolo Tranquilli
00ed00e1e5 Bazel: avoid unneeded operations if no imported zips are present 2024-05-28 15:01:35 +02:00
Paolo Tranquilli
6d798410ce Bazel: add --no-cleanup to installer script 2024-05-28 12:51:52 +02:00
Paolo Tranquilli
a8543d4a88 Zipmerge: port tests from internal repo 2024-05-28 12:01:57 +02:00
Paolo Tranquilli
392ef09d19 Zipmerge: make lib public for internal testing 2024-05-27 17:28:33 +02:00
Paolo Tranquilli
cde71a915b Bazel: address review comments 2024-05-27 17:00:39 +02:00
Paolo Tranquilli
2f95944244 Bazel: add documentation to install.py 2024-05-27 16:58:58 +02:00
Paolo Tranquilli
2f53c0e640 Bazel: fix codeql_pack installation on Windows 2024-05-27 16:09:42 +02:00
Paolo Tranquilli
5d4b61c365 Bazel: replace prebuilt ripunzip from workflow 2024-05-24 17:44:39 +02:00
Paolo Tranquilli
b9064c5446 Bazel: fail install on ripunzip failing 2024-05-24 15:50:16 +02:00
Paolo Tranquilli
fa2c626e49 Bazel: add fat macOS ripunzip binary 2024-05-24 14:29:02 +02:00
Paolo Tranquilli
dcbf42d29c Bazel: reorganize LFS files and add licensing information 2024-05-24 14:26:22 +02:00
Paolo Tranquilli
e8b857b79e Bazel/Swift: add zip imports to packs 2024-05-24 12:18:42 +02:00
Paolo Tranquilli
60cf77be7e Bazel: add codeql specific packaging library
This encapsulate arch specific logic, local installation and separation
of zip files into generic and arch-specific parts as required by the
internal build.
2024-05-24 10:27:44 +02:00
Paolo Tranquilli
d01d657f89 Bazel: accept new SSH keys in git_lfs_probe.py 2024-05-17 16:39:18 +01:00
Paolo Tranquilli
170e2231d4 Bazel: allow LFS rules to use cached downloads without internet
If the cache is prefilled, LFS rules were still trying to query LFS
urls.

Now the strategy is to first try to fetch the files from the repository
cache (which is possible by providing an empty url list and `allow_fail`
to `repository_ctx.download`), and only run the LFS protocol if that
fails. Technically this is possible by enhancing `git_lfs_probe.py` with
a `--hash-only` flag.

This is also an optimization where no uneeded access is done (including
the slightly slow SSH call) if the repository cache is warm.
2024-05-17 16:24:38 +01:00
Óscar San José
9105faa3fd make sure GITHUB_TOKEN exists and is not empty before using it in auth headers 2024-05-14 11:22:07 +02:00
Óscar San José
faa2dcee24 test GITHUB_TOKEN non-emptyness before using it in auth headers 2024-05-14 11:18:18 +02:00
Óscar San José
5b572a2c2a make GITHUB_TOKEN in lfs_probe a fallback rather than an override 2024-05-14 10:24:02 +02:00
Paolo Tranquilli
9f27eb3eda Bazel: make git_lfs_probe.py compatible with python 3.8 2024-05-07 12:44:28 +02:00
Paolo Tranquilli
54c9aea251 Bazel: fix lfs lazy rule when all objects are local 2024-05-06 15:47:43 +02:00