aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flake.nix44
-rw-r--r--test_building_all_shims.py19
2 files changed, 59 insertions, 4 deletions
diff --git a/flake.nix b/flake.nix
index dc5aa9b..e9594cf 100644
--- a/flake.nix
+++ b/flake.nix
@@ -252,6 +252,7 @@
];
}
);
+ # NOTE: should gmp library be also dependent?
nettleBuilder =
{
version ? null,
@@ -675,6 +676,49 @@
};
};
+ lib = {
+ tomcrypt = loadVersionsForShim {
+ libName = "tomcrypt";
+ function = libtomcryptBuilder;
+ };
+ botan = loadVersionsForShim {
+ libName = "botan";
+ function = botan2Builder;
+ };
+ cryptopp = loadVersionsForShim {
+ libName = "cryptopp";
+ function = cryptoppBuilder;
+ };
+ openssl = loadVersionsForShim {
+ libName = "openssl";
+ function = opensslBuilder;
+ };
+ boringssl = loadVersionsForShim {
+ libName = "boringssl";
+ function = boringsslBuilder;
+ };
+ gcrypt = loadVersionsForShim {
+ libName = "gcrypt";
+ function = libgcryptBuilder;
+ };
+ mbedtls = loadVersionsForShim {
+ libName = "mbedtls";
+ function = mbedtlsBuilder;
+ };
+ ippcp = loadVersionsForShim {
+ libName = "ippcp";
+ function = ipp-cryptoBuilder;
+ };
+ nettle = loadVersionsForShim {
+ libName = "nettle";
+ function = nettleBuilder;
+ };
+ libressl = loadVersionsForShim {
+ libName = "libressl";
+ function = libresslBuilder;
+ };
+ };
+
fetchReleases =
with pkgs.python3Packages;
buildPythonApplication {
diff --git a/test_building_all_shims.py b/test_building_all_shims.py
index 259a6a1..bf2c509 100644
--- a/test_building_all_shims.py
+++ b/test_building_all_shims.py
@@ -12,8 +12,8 @@ def get_all_versions(library):
return versions
-def can_build(library, version):
- cmd = ["nix", "build", f".#shim.{library}.{version}"]
+def can_build(library, version, variant):
+ cmd = ["nix", "build", f".#{variant}.{library}.{version}"]
start = time.time()
try:
sp.check_output(cmd, stderr=sp.STDOUT)
@@ -22,11 +22,22 @@ def can_build(library, version):
return False, time.time() - start
return True, time.time() - start
+def valid_build_type(value):
+ value = value.strip()
+ valid_types = ["shim", "lib"]
+ if value not in valid_types:
+ raise argparse.ArgumentTypeError(f"'{value}' not from expected {', '.join(valid_types)})")
+ return value
+
+
def main():
parser = argparse.ArgumentParser()
parser.add_argument("-l", "--library")
+ parser.add_argument("-d", "--variant", default="shim", type=valid_build_type)
args = parser.parse_args()
library = args.library
+ variant = args.variant
+
libraries = [
"botan",
@@ -45,11 +56,11 @@ def main():
for lib in libraries:
print(f"Library: {lib}")
for version in get_all_versions(lib):
- print(f"{version}: {can_build(lib, version)}")
+ print(f"{version}: {can_build(lib, version, variant)}")
case _:
print(f"Library: {library}")
for version in get_all_versions(library):
- print(f"{version}: {can_build(library, version)}")
+ print(f"{version}: {can_build(library, version, variant)}")
if __name__ == '__main__':