Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,26 @@ jobs:
echo "Index size: $size bytes"
[ "$size" -ge 102400 ] || { echo "FAIL: index too small"; exit 1; }

# Callers that run commands through /bin/sh and still pass the `index`
# argument accepted by releases up to v0.0.5.
- name: Index target via /bin/sh and `scip-rust index`
run: |
rm target/index.scip
docker run --rm --entrypoint /bin/sh -v "$PWD/target:/work" \
scip-rust:latest -c 'scip-rust index'

- name: Check index size
run: |
size=$(stat --format='%s' target/index.scip)
echo "Index size: $size bytes"
[ "$size" -ge 102400 ] || { echo "FAIL: index too small"; exit 1; }

# BusyBox wget and ssl_client do not verify TLS certificates.
- name: Check the image has no BusyBox TLS clients
run: |
docker run --rm --entrypoint /bin/sh scip-rust:latest \
-c '! command -v wget && ! command -v ssl_client'

index:
strategy:
fail-fast: false
Expand Down
28 changes: 26 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,43 @@
};
text = builtins.readFile ./scip-rust;
};
# Distrust the roots behind the compromised eMudhra intermediate CAs
# (https://emudhra.we-have-a-problem.com/). The pinned cacert (3.123)
# already distrusts Comodo AAA Services root for TLS; it is listed as
# defence in depth. cacert 3.131.1 drops emSign ECC Root CA - G3, so
# this override fails the build after a nixpkgs bump to it; remove it
# then.
dockerTools = pkgs.dockerTools.override {
cacert = pkgs.cacert.override {
blacklist = [
"Comodo AAA Services root"
"emSign ECC Root CA - G3"
];
};
};
# Provides /bin/sh for callers that run commands in the container
# through a shell. wget and ssl_client are left out: BusyBox does
# not verify TLS certificates.
busybox = pkgs.busybox.override {
extraConfig = ''
CONFIG_WGET n
CONFIG_SSL_CLIENT n
'';
};
in
{
packages = {
inherit scip-rust;
default = scip-rust;
}
// pkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
docker = pkgs.dockerTools.buildLayeredImage {
docker = dockerTools.buildLayeredImage {
name = "scip-rust";
tag = "latest";
contents = [
scip-rust
pkgs.dockerTools.caCertificates
busybox
dockerTools.caCertificates
pkgs.git
];
fakeRootCommands = "mkdir -p /work /tmp";
Expand Down
8 changes: 8 additions & 0 deletions scip-rust
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ for tool in cargo rust-analyzer rustc; do
fi
done

# Drop a leading `index` argument. Releases up to v0.0.5 ignored their
# arguments, and existing callers (such as auto-indexing jobs) still run
# `scip-rust index`; without this, rust-analyzer would treat `index` as the
# project path. To index a directory named `index`, pass `./index`.
if [ "${1:-}" = "index" ]; then
shift
fi

# Forward any extra args (e.g. `--output PATH`) to rust-analyzer; default
# to indexing the current directory if no path is given.
if [ $# -eq 0 ]; then
Expand Down
Loading