diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a2d7acd..192443e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,7 +8,7 @@ jobs: linux: strategy: matrix: - nixpkgs: [ nixpkgs, nixpkgs-21.05, nixpkgs-21.11 ] + nixpkgs: [ nixpkgs ] runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 diff --git a/default.nix b/default.nix index 7c9a259..d8395a5 100644 --- a/default.nix +++ b/default.nix @@ -61,13 +61,33 @@ let # the top-level build buildTopLevel = let - drv = + drv' = build { pname = config.packageName; inherit (config) userAttrs src; builtDependencies = lib.optional (! config.isSingleStep) buildDeps; }; + + # If the project we're building uses CMake, let's proactively get rid + # of `CMakeCache.txt`. + # + # That's because this file contains a dump of environmental variables + # from the deps-only derivation and it could happen that the main + # derivation uses different env-vars - when this happens, CMake will + # fail, saying: + # + # ``` + # CMake Error: The current CMakeCache.txt directory ... is different than the directory ... where CMakeCache.txt was created. + # ``` + drv = drv'.overrideAttrs (attrs: attrs // { + preBuild = (attrs.preBuild or "") + '' + find \ + -name CMakeCache.txt \ + -exec rm {} \; + ''; + }); + in drv.overrideAttrs config.overrideMain; in diff --git a/nix/sources.json b/nix/sources.json index 129ca89..75f3e23 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -1,14 +1,26 @@ { "agent-rs": { - "branch": "paulliu/add-cargo-lock", + "branch": "main", "description": "A collection of libraries and tools for building software around the Internet Computer, in Rust.", "homepage": "https://sdk.dfinity.org/", - "owner": "ninegua", + "owner": "dfinity", "repo": "agent-rs", - "rev": "4a22e590516bc79ec3c75a320f7941e7762ea098", - "sha256": "0sacddc34nlfgldqghlwchgzjki177h5dsgpmdv70cm8hfy0sg7l", + "rev": "71987142bb94a55ac0cb74a52396e01b6a142a16", + "sha256": "0hv3cg3f8jl0qpzm1qfrg1x7vbcqqv0mzjrgmh4g3w6f8xfj68is", + "type": "tarball", + "url": "https://github.com/dfinity/agent-rs/archive/71987142bb94a55ac0cb74a52396e01b6a142a16.tar.gz", + "url_template": "https://github.com///archive/.tar.gz" + }, + "fenix": { + "branch": "main", + "description": "Rust toolchains and rust-analyzer nightly for Nix [maintainer=@figsoda]", + "homepage": "", + "owner": "nix-community", + "repo": "fenix", + "rev": "65fdcbdc0bf35510a013d8a0883b0fa7a4ecd2a8", + "sha256": "1kqhwbd0abxx1hbvvw4ss7whl67p1w780i9f86r453d56qf6nh5g", "type": "tarball", - "url": "https://github.com/ninegua/agent-rs/archive/4a22e590516bc79ec3c75a320f7941e7762ea098.tar.gz", + "url": "https://github.com/nix-community/fenix/archive/65fdcbdc0bf35510a013d8a0883b0fa7a4ecd2a8.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "lorri": { @@ -53,10 +65,10 @@ "homepage": null, "owner": "NixOS", "repo": "nixpkgs", - "rev": "6c2318e451fc0eaf338fb461d9bfcc99869de758", - "sha256": "1djwkvjnn26v0xw1swwh7dgmi0yl0b1kb8kansrdwk0jhhqbl7zq", + "rev": "89abc99d5b6351b2984c6126ef3bda7929905cb9", + "sha256": "088n804fbf2p4gd22nymlgflx14fnknns0xavfc5w2c3vmmk7ql1", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/6c2318e451fc0eaf338fb461d9bfcc99869de758.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/89abc99d5b6351b2984c6126ef3bda7929905cb9.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "nixpkgs-21.05": { @@ -83,28 +95,16 @@ "url": "https://github.com/NixOS/nixpkgs/archive/432864f33c84af53192d4b23ee5871697e57f094.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, - "nixpkgs-mozilla": { - "branch": "master", - "description": "Mozilla overlay for Nixpkgs.", - "homepage": "", - "owner": "mozilla", - "repo": "nixpkgs-mozilla", - "rev": "85eb0ba7d8e5d6d4b79e5b0180aadbdd25d76404", - "sha256": "15a7zd7nrnfgjzs8gq2cpkxg7l3c38jradkxxyaf136kkqhlc0k4", - "type": "tarball", - "url": "https://github.com/mozilla/nixpkgs-mozilla/archive/85eb0ba7d8e5d6d4b79e5b0180aadbdd25d76404.tar.gz", - "url_template": "https://github.com///archive/.tar.gz" - }, "nushell": { "branch": "main", "description": "A new type of shell", "homepage": "https://www.nushell.sh/", "owner": "nushell", "repo": "nushell", - "rev": "85bfdca578157072e51e6972d370cfe63b0fda77", - "sha256": "0virlm3wpzsavdlci725iw0f8amr6ijxg9p2xp2q41zngjgb3w98", + "rev": "6dc7ff2335c9547182094451cd40c19e66c0678b", + "sha256": "1hxrsh7bpi3x7fr8n6589iaak96svncd6ck2sq6d5smjlbjryn1c", "type": "tarball", - "url": "https://github.com/nushell/nushell/archive/85bfdca578157072e51e6972d370cfe63b0fda77.tar.gz", + "url": "https://github.com/nushell/nushell/archive/6dc7ff2335c9547182094451cd40c19e66c0678b.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "ripgrep-all": { diff --git a/nix/sources.nix b/nix/sources.nix index 1938409..fe3dadf 100644 --- a/nix/sources.nix +++ b/nix/sources.nix @@ -10,29 +10,50 @@ let let name' = sanitizeName name + "-src"; in - if spec.builtin or true then - builtins_fetchurl { inherit (spec) url sha256; name = name'; } - else - pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; + if spec.builtin or true then + builtins_fetchurl { inherit (spec) url sha256; name = name'; } + else + pkgs.fetchurl { inherit (spec) url sha256; name = name'; }; fetch_tarball = pkgs: name: spec: let name' = sanitizeName name + "-src"; in - if spec.builtin or true then - builtins_fetchTarball { name = name'; inherit (spec) url sha256; } - else - pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; + if spec.builtin or true then + builtins_fetchTarball { name = name'; inherit (spec) url sha256; } + else + pkgs.fetchzip { name = name'; inherit (spec) url sha256; }; fetch_git = name: spec: let ref = - if spec ? ref then spec.ref else + spec.ref or ( if spec ? branch then "refs/heads/${spec.branch}" else - if spec ? tag then "refs/tags/${spec.tag}" else - abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!"; + if spec ? tag then "refs/tags/${spec.tag}" else + abort "In git source '${name}': Please specify `ref`, `tag` or `branch`!" + ); + submodules = spec.submodules or false; + submoduleArg = + let + nixSupportsSubmodules = builtins.compareVersions builtins.nixVersion "2.4" >= 0; + emptyArgWithWarning = + if submodules + then + builtins.trace + ( + "The niv input \"${name}\" uses submodules " + + "but your nix's (${builtins.nixVersion}) builtins.fetchGit " + + "does not support them" + ) + { } + else { }; + in + if nixSupportsSubmodules + then { inherit submodules; } + else emptyArgWithWarning; in - builtins.fetchGit { url = spec.repo; inherit (spec) rev; inherit ref; }; + builtins.fetchGit + ({ url = spec.repo; inherit (spec) rev; inherit ref; } // submoduleArg); fetch_local = spec: spec.path; @@ -66,16 +87,16 @@ let hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath; hasThisAsNixpkgsPath = == ./.; in - if builtins.hasAttr "nixpkgs" sources - then sourcesNixpkgs - else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then - import {} - else - abort - '' - Please specify either (through -I or NIX_PATH=nixpkgs=...) or - add a package called "nixpkgs" to your sources.json. - ''; + if builtins.hasAttr "nixpkgs" sources + then sourcesNixpkgs + else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then + import { } + else + abort + '' + Please specify either (through -I or NIX_PATH=nixpkgs=...) or + add a package called "nixpkgs" to your sources.json. + ''; # The actual fetching function. fetch = pkgs: name: spec: @@ -95,13 +116,13 @@ let # the path directly as opposed to the fetched source. replace = name: drv: let - saneName = stringAsChars (c: if isNull (builtins.match "[a-zA-Z0-9]" c) then "_" else c) name; + saneName = stringAsChars (c: if (builtins.match "[a-zA-Z0-9]" c) == null then "_" else c) name; ersatz = builtins.getEnv "NIV_OVERRIDE_${saneName}"; in - if ersatz == "" then drv else - # this turns the string into an actual Nix path (for both absolute and - # relative paths) - if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; + if ersatz == "" then drv else + # this turns the string into an actual Nix path (for both absolute and + # relative paths) + if builtins.substring 0 1 ersatz == "/" then /. + ersatz else /. + builtins.getEnv "PWD" + "/${ersatz}"; # Ports of functions for older nix versions @@ -112,7 +133,7 @@ let ); # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/lists.nix#L295 - range = first: last: if first > last then [] else builtins.genList (n: first + n) (last - first + 1); + range = first: last: if first > last then [ ] else builtins.genList (n: first + n) (last - first + 1); # https://github.com/NixOS/nixpkgs/blob/0258808f5744ca980b9a1f24fe0b1e6f0fecee9c/lib/strings.nix#L257 stringToCharacters = s: map (p: builtins.substring p 1 s) (range 0 (builtins.stringLength s - 1)); @@ -123,43 +144,46 @@ let concatStrings = builtins.concatStringsSep ""; # https://github.com/NixOS/nixpkgs/blob/8a9f58a375c401b96da862d969f66429def1d118/lib/attrsets.nix#L331 - optionalAttrs = cond: as: if cond then as else {}; + optionalAttrs = cond: as: if cond then as else { }; # fetchTarball version that is compatible between all the versions of Nix builtins_fetchTarball = { url, name ? null, sha256 }@attrs: let inherit (builtins) lessThan nixVersion fetchTarball; in - if lessThan nixVersion "1.12" then - fetchTarball ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchTarball attrs; + if lessThan nixVersion "1.12" then + fetchTarball ({ inherit url; } // (optionalAttrs (name != null) { inherit name; })) + else + fetchTarball attrs; # fetchurl version that is compatible between all the versions of Nix builtins_fetchurl = { url, name ? null, sha256 }@attrs: let inherit (builtins) lessThan nixVersion fetchurl; in - if lessThan nixVersion "1.12" then - fetchurl ({ inherit url; } // (optionalAttrs (!isNull name) { inherit name; })) - else - fetchurl attrs; + if lessThan nixVersion "1.12" then + fetchurl ({ inherit url; } // (optionalAttrs (name != null) { inherit name; })) + else + fetchurl attrs; # Create the final "sources" from the config mkSources = config: - mapAttrs ( - name: spec: - if builtins.hasAttr "outPath" spec - then abort - "The values in sources.json should not have an 'outPath' attribute" - else - spec // { outPath = replace name (fetch config.pkgs name spec); } - ) config.sources; + mapAttrs + ( + name: spec: + if builtins.hasAttr "outPath" spec + then + abort + "The values in sources.json should not have an 'outPath' attribute" + else + spec // { outPath = replace name (fetch config.pkgs name spec); } + ) + config.sources; # The "config" used by the fetchers mkConfig = { sourcesFile ? if builtins.pathExists ./sources.json then ./sources.json else null - , sources ? if isNull sourcesFile then {} else builtins.fromJSON (builtins.readFile sourcesFile) + , sources ? if sourcesFile == null then { } else builtins.fromJSON (builtins.readFile sourcesFile) , system ? builtins.currentSystem , pkgs ? mkPkgs sources system }: rec { @@ -171,4 +195,4 @@ let }; in -mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); } +mkSources (mkConfig { }) // { __functor = _: settings: mkSources (mkConfig settings); } diff --git a/test/default.nix b/test/default.nix index 75097f6..dc42d6a 100644 --- a/test/default.nix +++ b/test/default.nix @@ -2,9 +2,36 @@ let sources = import ../nix/sources.nix; - pkgs = import ../nix { - inherit system nixpkgs; - }; + pkgs = + let + pkgs' = import ../nix { + inherit system nixpkgs; + }; + + older-pkgs = import ../nix { + inherit system; + + nixpkgs = "nixpkgs-21.05"; + }; + + in + pkgs' // { + # HACK Some of our tests here manually construct a Git repository which + # newer Git versions have a problem with, saying: + # + # > fatal: detected dubious ownership in repository at '/nix/store/...' + # > To add an exception for this directory, call: + # > + # > git config --global --add safe.directory /nix/store/... + # + # Unfortunately, adding an exception doesn't really seem to work and so + # for the testing purposes here we default to the older Git. + # + # Another approach would be to patch Git (commenting out that warning), + # but then `./script/test --nixpkgs ...` would stop working (since that + # patch wouldn't be applicable to the older Git versions). + git = older-pkgs.git; + }; naersk = pkgs.callPackage ../default.nix { inherit (pkgs.rustPackages) cargo rustc; diff --git a/test/slow/agent-rs/default.nix b/test/slow/agent-rs/default.nix index cfb59e0..1b8452c 100644 --- a/test/slow/agent-rs/default.nix +++ b/test/slow/agent-rs/default.nix @@ -2,7 +2,6 @@ naersk.buildPackage { src = sources.agent-rs; - doCheck = true; buildInputs = [ pkgs.openssl diff --git a/test/slow/default.nix b/test/slow/default.nix index d58dff1..9d9ea6e 100644 --- a/test/slow/default.nix +++ b/test/slow/default.nix @@ -1,8 +1,15 @@ args: { agent-rs = import ./agent-rs args; lorri = import ./lorri args; - nushell = import ./nushell args; ripgrep-all = import ./ripgrep-all args; rustlings = import ./rustlings args; talent-plan = import ./talent-plan args; + + # Make sure we can compile projects with a complex workspace setup + # (https://github.com/nix-community/naersk/issues/274) + nushell = import ./nushell args; + + # Make sure we can compile projects that use CMake + # (https://github.com/nix-community/naersk/issues/285) + oqs = import ./oqs args; } diff --git a/test/slow/nushell/default.nix b/test/slow/nushell/default.nix index d491dbf..f867ae5 100644 --- a/test/slow/nushell/default.nix +++ b/test/slow/nushell/default.nix @@ -1,15 +1,11 @@ -{ sources, ... }: +{ sources, pkgs, ... }: let - pkgs = import sources.nixpkgs { - overlays = [ - (import sources.nixpkgs-mozilla) - ]; - }; + fenix = import sources.fenix { }; - toolchain = (pkgs.rustChannelOf { - rustToolchain = "${sources.nushell}/rust-toolchain.toml"; - sha256 = "sha256-Zk2rxv6vwKFkTTidgjPm6gDsseVmmljVt201H7zuDkk="; - }).rust; + toolchain = fenix.fromToolchainFile { + file = "${sources.nushell}/rust-toolchain.toml"; + sha256 = "sha256-S4dA7ne2IpFHG+EnjXfogmqwGyDFSRWFnJ8cy4KZr1k="; + }; naersk = pkgs.callPackage ../../../default.nix { cargo = toolchain; @@ -18,8 +14,12 @@ let app = naersk.buildPackage { src = sources.nushell; - nativeBuildInputs = with pkgs; [ pkg-config ]; - buildInputs = with pkgs; [ openssl ]; + + nativeBuildInputs = with pkgs; [ pkg-config ] + ++ lib.optional stdenv.isDarwin [ rustPlatform.bindgenHook ]; + + buildInputs = with pkgs; [ openssl ] + ++ lib.optionals stdenv.isDarwin [ zlib libiconv darwin.Libsystem darwin.Security darwin.apple_sdk.frameworks.Foundation ]; }; in diff --git a/test/slow/oqs/app/Cargo.lock b/test/slow/oqs/app/Cargo.lock new file mode 100644 index 0000000..968401c --- /dev/null +++ b/test/slow/oqs/app/Cargo.lock @@ -0,0 +1,400 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "aho-corasick" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +dependencies = [ + "memchr", +] + +[[package]] +name = "app" +version = "0.1.0" +dependencies = [ + "oqs-sys", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bindgen" +version = "0.60.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "clap", + "env_logger", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "which", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "build-deps" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f14468960818ce4f3e3553c32d524446687884f8e7af5d3e252331d8a87e43" +dependencies = [ + "glob", +] + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +dependencies = [ + "atty", + "bitflags", + "clap_lex", + "indexmap", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.142" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "oqs-sys" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3929aaf333acdb26bfade2acc25bdfc927a013c87616509be67e0462a3c165b" +dependencies = [ + "bindgen", + "build-deps", + "cmake", + "libc", +] + +[[package]] +name = "os_str_bytes" +version = "6.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "proc-macro2" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "which" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +dependencies = [ + "either", + "libc", + "once_cell", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/test/slow/oqs/app/Cargo.toml b/test/slow/oqs/app/Cargo.toml new file mode 100644 index 0000000..deb6aa8 --- /dev/null +++ b/test/slow/oqs/app/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "app" +version = "0.1.0" +edition = "2021" + +[dependencies] +oqs-sys = "0.7.2" diff --git a/test/slow/oqs/app/rust-toolchain.toml b/test/slow/oqs/app/rust-toolchain.toml new file mode 100644 index 0000000..67e1522 --- /dev/null +++ b/test/slow/oqs/app/rust-toolchain.toml @@ -0,0 +1,2 @@ +[toolchain] +channel = "nightly-2023-01-01" diff --git a/test/slow/oqs/app/src/main.rs b/test/slow/oqs/app/src/main.rs new file mode 100644 index 0000000..b63fa40 --- /dev/null +++ b/test/slow/oqs/app/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + // +} diff --git a/test/slow/oqs/default.nix b/test/slow/oqs/default.nix new file mode 100644 index 0000000..b764591 --- /dev/null +++ b/test/slow/oqs/default.nix @@ -0,0 +1,32 @@ +{ sources, pkgs, ... }: +let + fenix = import sources.fenix { }; + + toolchain = fenix.fromToolchainFile { + file = ./app/rust-toolchain.toml; + sha256 = "sha256-Y2DBRMR6w4fJu+jwplWInTBzNtbr0EW3yZ3CN9YTI/8="; + }; + + naersk = pkgs.callPackage ../../../default.nix { + cargo = toolchain; + rustc = toolchain; + }; + + attrs = { + src = ./app; + nativeBuildInputs = with pkgs; [ rustPlatform.bindgenHook cmake pkg-config ]; + buildInputs = with pkgs; [ openssl ]; + }; + + app = naersk.buildPackage attrs; + + app-single-step = naersk.buildPackage (attrs // { + singleStep = true; + }); + +in +pkgs.runCommand "oqs-test" { } '' + ${app}/bin/app + ${app-single-step}/bin/app + touch $out +''