diff --git a/doc/languages-frameworks/rust.section.md b/doc/languages-frameworks/rust.section.md index f1f951b9650fd..f05169f12fb9f 100644 --- a/doc/languages-frameworks/rust.section.md +++ b/doc/languages-frameworks/rust.section.md @@ -739,170 +739,6 @@ stdenv.mkDerivation rec { } ``` -## `buildRustCrate`: Compiling Rust crates using Nix instead of Cargo {#compiling-rust-crates-using-nix-instead-of-cargo} - -### Simple operation {#simple-operation} - -When run, `cargo build` produces a file called `Cargo.lock`, -containing pinned versions of all dependencies. Nixpkgs contains a -tool called `crate2Nix` (`nix-shell -p crate2nix`), which can be -used to turn a `Cargo.lock` into a Nix expression. That Nix -expression calls `rustc` directly (hence bypassing Cargo), and can -be used to compile a crate and all its dependencies. - -See [`crate2nix`'s documentation](https://github.com/kolloch/crate2nix#known-restrictions) -for instructions on how to use it. - -### Handling external dependencies {#handling-external-dependencies} - -Some crates require external libraries. For crates from -[crates.io](https://crates.io), such libraries can be specified in -`defaultCrateOverrides` package in nixpkgs itself. - -Starting from that file, one can add more overrides, to add features -or build inputs by overriding the hello crate in a separate file. - -```nix -with import {}; -((import ./hello.nix).hello {}).override { - crateOverrides = defaultCrateOverrides // { - hello = attrs: { buildInputs = [ openssl ]; }; - }; -} -``` - -Here, `crateOverrides` is expected to be a attribute set, where the -key is the crate name without version number and the value a function. -The function gets all attributes passed to `buildRustCrate` as first -argument and returns a set that contains all attribute that should be -overwritten. - -For more complicated cases, such as when parts of the crate's -derivation depend on the crate's version, the `attrs` argument of -the override above can be read, as in the following example, which -patches the derivation: - -```nix -with import {}; -((import ./hello.nix).hello {}).override { - crateOverrides = defaultCrateOverrides // { - hello = attrs: lib.optionalAttrs (lib.versionAtLeast attrs.version "1.0") { - postPatch = '' - substituteInPlace lib/zoneinfo.rs \ - --replace-fail "/usr/share/zoneinfo" "${tzdata}/share/zoneinfo" - ''; - }; - }; -} -``` - -Another situation is when we want to override a nested -dependency. This actually works in the exact same way, since the -`crateOverrides` parameter is forwarded to the crate's -dependencies. For instance, to override the build inputs for crate -`libc` in the example above, where `libc` is a dependency of the main -crate, we could do: - -```nix -with import {}; -((import hello.nix).hello {}).override { - crateOverrides = defaultCrateOverrides // { - libc = attrs: { buildInputs = []; }; - }; -} -``` - -### Options and phases configuration {#options-and-phases-configuration} - -Actually, the overrides introduced in the previous section are more -general. A number of other parameters can be overridden: - -- The version of `rustc` used to compile the crate: - - ```nix - (hello {}).override { rust = pkgs.rust; } - ``` - -- Whether to build in release mode or debug mode (release mode by - default): - - ```nix - (hello {}).override { release = false; } - ``` - -- Whether to print the commands sent to `rustc` when building - (equivalent to `--verbose` in cargo: - - ```nix - (hello {}).override { verbose = false; } - ``` - -- Extra arguments to be passed to `rustc`: - - ```nix - (hello {}).override { extraRustcOpts = "-Z debuginfo=2"; } - ``` - -- Phases, just like in any other derivation, can be specified using - the following attributes: `preUnpack`, `postUnpack`, `prePatch`, - `patches`, `postPatch`, `preConfigure` (in the case of a Rust crate, - this is run before calling the "build" script), `postConfigure` - (after the "build" script),`preBuild`, `postBuild`, `preInstall` and - `postInstall`. As an example, here is how to create a new module - before running the build script: - - ```nix - (hello {}).override { - preConfigure = '' - echo "pub const PATH=\"${hi.out}\";" >> src/path.rs" - ''; - } - ``` - -### Setting Up `nix-shell` {#setting-up-nix-shell} - -Oftentimes you want to develop code from within `nix-shell`. Unfortunately -`buildRustCrate` does not support common `nix-shell` operations directly -(see [this issue](https://github.com/NixOS/nixpkgs/issues/37945)) -so we will use `stdenv.mkDerivation` instead. - -Using the example `hello` project above, we want to do the following: - -- Have access to `cargo` and `rustc` -- Have the `openssl` library available to a crate through it's _normal_ - compilation mechanism (`pkg-config`). - -A typical `shell.nix` might look like: - -```nix -with import {}; - -stdenv.mkDerivation { - name = "rust-env"; - nativeBuildInputs = [ - rustc cargo - - # Example Build-time Additional Dependencies - pkg-config - ]; - buildInputs = [ - # Example Run-time Additional Dependencies - openssl - ]; - - # Set Environment Variables - RUST_BACKTRACE = 1; -} -``` - -You should now be able to run the following: - -```ShellSession -$ nix-shell --pure -$ cargo build -$ cargo test -``` - ## Using community maintained Rust toolchains {#using-community-maintained-rust-toolchains} ::: {.note} diff --git a/doc/redirects.json b/doc/redirects.json index 254e6ceb6fc6e..69f4e92d1172a 100644 --- a/doc/redirects.json +++ b/doc/redirects.json @@ -3679,21 +3679,6 @@ "rust-package-built-with-meson": [ "index.html#rust-package-built-with-meson" ], - "compiling-rust-crates-using-nix-instead-of-cargo": [ - "index.html#compiling-rust-crates-using-nix-instead-of-cargo" - ], - "simple-operation": [ - "index.html#simple-operation" - ], - "handling-external-dependencies": [ - "index.html#handling-external-dependencies" - ], - "options-and-phases-configuration": [ - "index.html#options-and-phases-configuration" - ], - "setting-up-nix-shell": [ - "index.html#setting-up-nix-shell" - ], "using-community-maintained-rust-toolchains": [ "index.html#using-community-maintained-rust-toolchains" ], diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index fca105e284f4f..6c0d6d915d27b 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -261,6 +261,10 @@ - `docker_24` has been removed, as it was EOL with vulnerabilites since June 08, 2024. +- `buildRustCrate` build helper has been removed as it was only used by out-of-tree packages + +- `defaultCrateOverrides` have been removed as they were only used by `buildRustCrate` + - `containerd` has been updated to v2, which contains breaking changes. See the [containerd 2.0](https://github.com/containerd/containerd/blob/main/docs/containerd-2.0.md) documentation for more details. diff --git a/pkgs/build-support/rust/build-rust-crate/build-crate.nix b/pkgs/build-support/rust/build-rust-crate/build-crate.nix deleted file mode 100644 index 32ab0fd55c3b4..0000000000000 --- a/pkgs/build-support/rust/build-rust-crate/build-crate.nix +++ /dev/null @@ -1,162 +0,0 @@ -{ - lib, - stdenv, - mkRustcDepArgs, - mkRustcFeatureArgs, - needUnstableCLI, - rustc, -}: - -{ - crateName, - dependencies, - crateFeatures, - crateRenames, - libName, - release, - libPath, - crateType, - metadata, - crateBin, - hasCrateBin, - extraRustcOpts, - verbose, - colors, - buildTests, - codegenUnits, -}: - -let - baseRustcOpts = - [ - (if release then "-C opt-level=3" else "-C debuginfo=2") - "-C codegen-units=${toString codegenUnits}" - "--remap-path-prefix=$NIX_BUILD_TOP=/" - (mkRustcDepArgs dependencies crateRenames) - (mkRustcFeatureArgs crateFeatures) - ] - ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "--target" - stdenv.hostPlatform.rust.rustcTargetSpec - ] - ++ lib.optionals (needUnstableCLI dependencies) [ - "-Z" - "unstable-options" - ] - ++ extraRustcOpts - # since rustc 1.42 the "proc_macro" crate is part of the default crate prelude - # https://github.com/rust-lang/cargo/commit/4d64eb99a4#diff-7f98585dbf9d30aa100c8318e2c77e79R1021-R1022 - ++ lib.optional (lib.elem "proc-macro" crateType) "--extern proc_macro" - ++ - lib.optional (stdenv.hostPlatform.linker == "lld" && rustc ? llvmPackages.lld) # Needed when building for targets that use lld. e.g. 'wasm32-unknown-unknown' - "-C linker=${rustc.llvmPackages.lld}/bin/lld" - ++ lib.optional ( - stdenv.hasCC && stdenv.hostPlatform.linker != "lld" - ) "-C linker=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"; - rustcMeta = "-C metadata=${metadata} -C extra-filename=-${metadata}"; - - # build the final rustc arguments that can be different between different - # crates - libRustcOpts = lib.concatStringsSep " " ( - baseRustcOpts ++ [ rustcMeta ] ++ (map (x: "--crate-type ${x}") crateType) - ); - - binRustcOpts = lib.concatStringsSep " " baseRustcOpts; - - build_bin = if buildTests then "build_bin_test" else "build_bin"; -in -'' - runHook preBuild - - # configure & source common build functions - LIB_RUSTC_OPTS="${libRustcOpts}" - BIN_RUSTC_OPTS="${binRustcOpts}" - LIB_EXT="${stdenv.hostPlatform.extensions.library}" - LIB_PATH="${libPath}" - LIB_NAME="${libName}" - - CRATE_NAME='${lib.replaceStrings [ "-" ] [ "_" ] libName}' - - setup_link_paths - - if [[ -e "$LIB_PATH" ]]; then - build_lib "$LIB_PATH" - ${lib.optionalString buildTests ''build_lib_test "$LIB_PATH"''} - elif [[ -e src/lib.rs ]]; then - build_lib src/lib.rs - ${lib.optionalString buildTests "build_lib_test src/lib.rs"} - fi - - - - ${lib.optionalString (lib.length crateBin > 0) ( - lib.concatMapStringsSep "\n" ( - bin: - let - haveRequiredFeature = - if bin ? requiredFeatures then - # Check that all element in requiredFeatures are also present in crateFeatures - lib.intersectLists bin.requiredFeatures crateFeatures == bin.requiredFeatures - else - true; - in - if haveRequiredFeature then - '' - mkdir -p target/bin - BIN_NAME='${bin.name or crateName}' - ${ - if !bin ? path then - '' - BIN_PATH="" - search_for_bin_path "$BIN_NAME" - '' - else - '' - BIN_PATH='${bin.path}' - '' - } - ${build_bin} "$BIN_NAME" "$BIN_PATH" - '' - else - '' - echo Binary ${bin.name or crateName} not compiled due to not having all of the required features -- ${lib.escapeShellArg (builtins.toJSON bin.requiredFeatures)} -- enabled. - '' - ) crateBin - )} - - ${lib.optionalString buildTests '' - # When tests are enabled build all the files in the `tests` directory as - # test binaries. - if [ -d tests ]; then - # find all the .rs files (or symlinks to those) in the tests directory, no subdirectories - find tests -maxdepth 1 \( -type f -o -type l \) -a -name '*.rs' -print0 | while IFS= read -r -d ''' file; do - mkdir -p target/bin - build_bin_test_file "$file" - done - - # find all the subdirectories of tests/ that contain a main.rs file as - # that is also a test according to cargo - find tests/ -mindepth 1 -maxdepth 2 \( -type f -o -type l \) -a -name 'main.rs' -print0 | while IFS= read -r -d ''' file; do - mkdir -p target/bin - build_bin_test_file "$file" - done - - fi - ''} - - # If crateBin is empty and hasCrateBin is not set then we must try to - # detect some kind of bin target based on some files that might exist. - ${lib.optionalString (lib.length crateBin == 0 && !hasCrateBin) '' - if [[ -e src/main.rs ]]; then - mkdir -p target/bin - ${build_bin} ${crateName} src/main.rs - fi - for i in src/bin/*.rs; do #*/ - mkdir -p target/bin - ${build_bin} "$(basename $i .rs)" "$i" - done - ''} - # Remove object files to avoid "wrong ELF type" - find target -type f -name "*.o" -print0 | xargs -0 rm -f - runHook postBuild -'' diff --git a/pkgs/build-support/rust/build-rust-crate/configure-crate.nix b/pkgs/build-support/rust/build-rust-crate/configure-crate.nix deleted file mode 100644 index 30f13b988c6aa..0000000000000 --- a/pkgs/build-support/rust/build-rust-crate/configure-crate.nix +++ /dev/null @@ -1,255 +0,0 @@ -{ - lib, - stdenv, - echo_colored, - noisily, - mkRustcDepArgs, - mkRustcFeatureArgs, -}: -{ - build, - buildDependencies, - codegenUnits, - colors, - completeBuildDeps, - completeDeps, - crateAuthors, - crateDescription, - crateFeatures, - crateHomepage, - crateLicense, - crateLicenseFile, - crateLinks, - crateName, - crateType, - crateReadme, - crateRenames, - crateRepository, - crateRustVersion, - crateVersion, - extraLinkFlags, - extraRustcOptsForBuildRs, - libName, - libPath, - release, - verbose, - workspace_member, -}: -let - version_ = lib.splitString "-" crateVersion; - versionPre = lib.optionalString (lib.tail version_ != [ ]) (lib.elemAt version_ 1); - version = lib.splitVersion (lib.head version_); - rustcOpts = lib.foldl' (opts: opt: opts + " " + opt) ( - if release then "-C opt-level=3" else "-C debuginfo=2" - ) ([ "-C codegen-units=${toString codegenUnits}" ] ++ extraRustcOptsForBuildRs); - buildDeps = mkRustcDepArgs buildDependencies crateRenames; - authors = lib.concatStringsSep ":" crateAuthors; - optLevel = if release then 3 else 0; - completeDepsDir = lib.concatStringsSep " " completeDeps; - completeBuildDepsDir = lib.concatStringsSep " " completeBuildDeps; - envFeatures = lib.concatStringsSep " " ( - map (f: lib.replaceStrings [ "-" ] [ "_" ] (lib.toUpper f)) crateFeatures - ); -in -'' - ${echo_colored colors} - ${noisily colors verbose} - source ${./lib.sh} - - ${lib.optionalString (workspace_member != null) '' - noisily cd "${workspace_member}" - ''} - ${lib.optionalString (workspace_member == null) '' - echo_colored "Searching for matching Cargo.toml (${crateName})" - local cargo_toml_dir=$(matching_cargo_toml_dir "${crateName}") - if [ -z "$cargo_toml_dir" ]; then - echo_error "ERROR configuring ${crateName}: No matching Cargo.toml in $(pwd) found." >&2 - exit 23 - fi - noisily cd "$cargo_toml_dir" - ''} - - runHook preConfigure - - symlink_dependency() { - # $1 is the nix-store path of a dependency - # $2 is the target path - i=$1 - ln -s -f $i/lib/*.rlib $2 #*/ - ln -s -f $i/lib/*.so $i/lib/*.dylib $2 #*/ - if [ -e $i/env ]; then - source $i/env - fi - } - - # The following steps set up the dependencies of the crate. Two - # kinds of dependencies are distinguished: build dependencies - # (used by the build script) and crate dependencies. For each - # dependency we have to: - # - # - Make its Rust library available to rustc. This is done by - # symlinking all library dependencies into a directory that - # can be provided to rustc. - # - Accumulate linking flags. These flags are largely used for - # linking native libraries. - # - # The crate link flags are added to the `link` and `link.final` - # files. The `link` file is used for linkage in the current - # crate. The `link.final` file will be copied to the output and can - # be used by downstream crates to get the linker flags of this - # crate. - - mkdir -p target/{deps,lib,build,buildDeps} - chmod uga+w target -R - echo ${extraLinkFlags} > target/link - echo ${extraLinkFlags} > target/link.final - - # Prepare crate dependencies - for i in ${completeDepsDir}; do - symlink_dependency $i target/deps - if [ -e "$i/lib/link" ]; then - cat $i/lib/link >> target/link - cat $i/lib/link >> target/link.final - fi - done - - # Prepare crate build dependencies that are used for the build script. - for i in ${completeBuildDepsDir}; do - symlink_dependency $i target/buildDeps - if [ -e "$i/lib/link" ]; then - cat $i/lib/link >> target/link.build - fi - done - - # Remove duplicate linker flags from the build dependencies. - if [[ -e target/link.build ]]; then - sort -uo target/link.build target/link.build - fi - - # Remove duplicate linker flags from the dependencies. - sort -uo target/link target/link - tr '\n' ' ' < target/link > target/link_ - - # Remove duplicate linker flags from the that are written - # to the derivation's output. - sort -uo target/link.final target/link.final - - EXTRA_BUILD="" - BUILD_OUT_DIR="" - - # Set up Cargo Environment variables: https://doc.rust-lang.org/cargo/reference/environment-variables.html - export CARGO_PKG_NAME=${crateName} - export CARGO_PKG_VERSION=${crateVersion} - export CARGO_PKG_AUTHORS="${authors}" - export CARGO_PKG_DESCRIPTION="${crateDescription}" - - export CARGO_CFG_TARGET_ARCH=${stdenv.hostPlatform.rust.platform.arch} - export CARGO_CFG_TARGET_OS=${stdenv.hostPlatform.rust.platform.os} - export CARGO_CFG_TARGET_FAMILY="unix" - export CARGO_CFG_UNIX=1 - export CARGO_CFG_TARGET_ENV="gnu" - export CARGO_CFG_TARGET_ENDIAN=${ - if stdenv.hostPlatform.parsed.cpu.significantByte.name == "littleEndian" then "little" else "big" - } - export CARGO_CFG_TARGET_POINTER_WIDTH=${ - with stdenv.hostPlatform; toString (if isILP32 then 32 else parsed.cpu.bits) - } - export CARGO_CFG_TARGET_VENDOR=${stdenv.hostPlatform.parsed.vendor.name} - - export CARGO_MANIFEST_DIR=$(pwd) - export CARGO_MANIFEST_LINKS=${crateLinks} - export DEBUG="${toString (!release)}" - export OPT_LEVEL="${toString optLevel}" - export TARGET="${stdenv.hostPlatform.rust.rustcTargetSpec}" - export HOST="${stdenv.buildPlatform.rust.rustcTargetSpec}" - export PROFILE=${if release then "release" else "debug"} - export OUT_DIR=$(pwd)/target/build/${crateName}.out - export CARGO_PKG_VERSION_MAJOR=${lib.elemAt version 0} - export CARGO_PKG_VERSION_MINOR=${lib.elemAt version 1} - export CARGO_PKG_VERSION_PATCH=${lib.elemAt version 2} - export CARGO_PKG_VERSION_PRE="${versionPre}" - export CARGO_PKG_HOMEPAGE="${crateHomepage}" - export CARGO_PKG_LICENSE="${crateLicense}" - export CARGO_PKG_LICENSE_FILE="${crateLicenseFile}" - export CARGO_PKG_README="${crateReadme}" - export CARGO_PKG_REPOSITORY="${crateRepository}" - export CARGO_PKG_RUST_VERSION="${crateRustVersion}" - export NUM_JOBS=$NIX_BUILD_CORES - export RUSTC="rustc" - export RUSTDOC="rustdoc" - - BUILD="" - if [[ ! -z "${build}" ]] ; then - BUILD=${build} - elif [[ -e "build.rs" ]]; then - BUILD="build.rs" - fi - - # Compile and run the build script, when available. - if [[ ! -z "$BUILD" ]] ; then - echo_build_heading "$BUILD" ${libName} - mkdir -p target/build/${crateName} - EXTRA_BUILD_FLAGS="" - if [ -e target/link.build ]; then - EXTRA_BUILD_FLAGS="$EXTRA_BUILD_FLAGS $(tr '\n' ' ' < target/link.build)" - fi - noisily rustc --crate-name build_script_build $BUILD --crate-type bin ${rustcOpts} \ - ${mkRustcFeatureArgs crateFeatures} --out-dir target/build/${crateName} --emit=dep-info,link \ - -L dependency=target/buildDeps ${buildDeps} --cap-lints allow $EXTRA_BUILD_FLAGS --color ${colors} - - mkdir -p target/build/${crateName}.out - export RUST_BACKTRACE=1 - BUILD_OUT_DIR="-L $OUT_DIR" - mkdir -p $OUT_DIR - - ( - # Features should be set as environment variable for build scripts: - # https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts - for feature in ${envFeatures}; do - export CARGO_FEATURE_$feature=1 - done - - target/build/${crateName}/build_script_build | tee target/build/${crateName}.opt - ) - - set +e - # We want to support the new prefix invocation syntax which uses two colons - # See https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script - - EXTRA_BUILD=$(sed -n "s/^cargo::\{0,1\}rustc-flags=\(.*\)/\1/p" target/build/${crateName}.opt | tr '\n' ' ' | sort -u) - EXTRA_FEATURES=$(sed -n "s/^cargo::\{0,1\}rustc-cfg=\(.*\)/--cfg \1/p" target/build/${crateName}.opt | tr '\n' ' ') - EXTRA_LINK_ARGS=$(sed -n "s/^cargo::\{0,1\}rustc-link-arg=\(.*\)/-C link-arg=\1/p" target/build/${crateName}.opt | tr '\n' ' ') - EXTRA_LINK_ARGS_BINS=$(sed -n "s/^cargo::\{0,1\}rustc-link-arg-bins=\(.*\)/-C link-arg=\1/p" target/build/${crateName}.opt | tr '\n' ' ') - EXTRA_LINK_ARGS_LIB=$(sed -n "s/^cargo::\{0,1\}rustc-link-arg-lib=\(.*\)/-C link-arg=\1/p" target/build/${crateName}.opt | tr '\n' ' ') - EXTRA_LINK_LIBS=$(sed -n "s/^cargo::\{0,1\}rustc-link-lib=\(.*\)/\1/p" target/build/${crateName}.opt | tr '\n' ' ') - EXTRA_LINK_SEARCH=$(sed -n "s/^cargo::\{0,1\}rustc-link-search=\(.*\)/\1/p" target/build/${crateName}.opt | tr '\n' ' ' | sort -u) - - ${lib.optionalString (lib.elem "cdylib" crateType) '' - CRATE_TYPE_IS_CDYLIB="true" - EXTRA_CDYLIB_LINK_ARGS=$(sed -n "s/^cargo::\{0,1\}rustc-cdylib-link-arg=\(.*\)/-C link-arg=\1/p" target/build/${crateName}.opt | tr '\n' ' ') - ''} - - # We want to read part of every line that has cargo:rustc-env= prefix and - # export it as environment variables. This turns out tricky if the lines - # have spaces: we can't wrap the command in double quotes as that captures - # all the lines in single output. We can't use while read loop because - # exporting from inside of it doesn't make it to the outside scope. We - # can't use xargs as export is a built-in and does not work from it. As a - # last resort then, we change the IFS so that the for loop does not split - # on spaces and reset it after we are done. See ticket #199298. - # - _OLDIFS="$IFS" - IFS=$'\n' - for env in $(sed -n "s/^cargo::\{0,1\}rustc-env=\(.*\)/\1/p" target/build/${crateName}.opt); do - export "$env" - done - IFS="$_OLDIFS" - - CRATENAME=$(echo ${crateName} | sed -e "s/\(.*\)-sys$/\U\1/" -e "s/-/_/g") - grep -P "^cargo:(?!:?(rustc-|warning=|rerun-if-changed=|rerun-if-env-changed))" target/build/${crateName}.opt \ - | awk -F= "/^cargo::metadata=/ { gsub(/-/, \"_\", \$2); print \"export \" toupper(\"DEP_$(echo $CRATENAME)_\" \$2) \"=\" \"\\\"\"\$3\"\\\"\"; next } - /^cargo:/ { sub(/^cargo::?/, \"\", \$1); gsub(/-/, \"_\", \$1); print \"export \" toupper(\"DEP_$(echo $CRATENAME)_\" \$1) \"=\" \"\\\"\"\$2\"\\\"\"; next }" > target/env - set -e - fi - runHook postConfigure -'' diff --git a/pkgs/build-support/rust/build-rust-crate/default.nix b/pkgs/build-support/rust/build-rust-crate/default.nix deleted file mode 100644 index db9c2d784f6b9..0000000000000 --- a/pkgs/build-support/rust/build-rust-crate/default.nix +++ /dev/null @@ -1,414 +0,0 @@ -# Code for buildRustCrate, a Nix function that builds Rust code, just -# like Cargo, but using Nix instead. -# -# This can be useful for deploying packages with NixOps, and to share -# binary dependencies between projects. - -{ lib -, stdenv -, defaultCrateOverrides -, fetchCrate -, pkgsBuildBuild -, rustc -, cargo -, jq -, libiconv -}: - -let - # Create rustc arguments to link against the given list of dependencies - # and renames. - # - # See docs for crateRenames below. - mkRustcDepArgs = dependencies: crateRenames: - lib.concatMapStringsSep " " - (dep: - let - normalizeName = lib.replaceStrings [ "-" ] [ "_" ]; - extern = normalizeName dep.libName; - # Find a choice that matches in name and optionally version. - findMatchOrUseExtern = choices: - lib.findFirst - (choice: - (!(choice ? version) - || choice.version == dep.version or "")) - { rename = extern; } - choices; - name = - if lib.hasAttr dep.crateName crateRenames then - let choices = crateRenames.${dep.crateName}; - in - normalizeName ( - if builtins.isList choices - then (findMatchOrUseExtern choices).rename - else choices - ) - else - extern; - opts = lib.optionalString (dep.stdlib or false) "noprelude:"; - filename = - if lib.any (x: x == "lib" || x == "rlib") dep.crateType - then "${dep.metadata}.rlib" - # Adjust lib filename for crates of type proc-macro. Proc macros are compiled/run on the build platform architecture. - else if (lib.attrByPath [ "procMacro" ] false dep) then "${dep.metadata}${stdenv.buildPlatform.extensions.library}" - else "${dep.metadata}${stdenv.hostPlatform.extensions.library}"; - in - " --extern ${opts}${name}=${dep.lib}/lib/lib${extern}-${filename}" - ) - dependencies; - - # Create feature arguments for rustc. - mkRustcFeatureArgs = lib.concatMapStringsSep " " (f: ''--cfg feature=\"${f}\"''); - - # Whether we need to use unstable command line flags - # - # Currently just needed for standard library dependencies, which have a - # special "noprelude:" modifier. If in later versions of Rust this is - # stabilized we can account for that here, too, so we don't opt into - # instability unnecessarily. - needUnstableCLI = dependencies: - lib.any (dep: dep.stdlib or false) dependencies; - - inherit (import ./log.nix { inherit lib; }) noisily echo_colored; - - configureCrate = import ./configure-crate.nix { - inherit lib stdenv echo_colored noisily mkRustcDepArgs mkRustcFeatureArgs; - }; - - installCrate = import ./install-crate.nix { inherit stdenv; }; -in - - /* The overridable pkgs.buildRustCrate function. - * - * Any unrecognized parameters will be passed as to - * the underlying stdenv.mkDerivation. - */ -crate_: lib.makeOverridable - ( - # The rust compiler to use. - # - # Default: pkgs.rustc - { rust ? rustc - # The cargo package to use for getting some metadata. - # - # Default: pkgs.cargo - , cargo ? cargo - # Whether to build a release version (`true`) or a debug - # version (`false`). Debug versions are faster to build - # but might be much slower at runtime. - , release - # Whether to print rustc invocations etc. - # - # Example: false - # Default: true - , verbose - # A list of rust/cargo features to enable while building the crate. - # Example: [ "std" "async" ] - , features - # Additional native build inputs for building this crate. - , nativeBuildInputs - # Additional build inputs for building this crate. - # - # Example: [ pkgs.openssl ] - , buildInputs - # Allows to override the parameters to buildRustCrate - # for any rust dependency in the transitive build tree. - # - # Default: pkgs.defaultCrateOverrides - # - # Example: - # - # pkgs.defaultCrateOverrides // { - # hello = attrs: { buildInputs = [ openssl ]; }; - # } - , crateOverrides - # Rust library dependencies, i.e. other libraries that were built - # with buildRustCrate. - , dependencies - # Rust build dependencies, i.e. other libraries that were built - # with buildRustCrate and are used by a build script. - , buildDependencies - # Specify the "extern" name of a library if it differs from the library target. - # See above for an extended explanation. - # - # Default: no renames. - # - # Example: - # - # `crateRenames` supports two formats. - # - # The simple version is an attrset that maps the - # `crateName`s of the dependencies to their alternative - # names. - # - # ```nix - # { - # my_crate_name = "my_alternative_name"; - # # ... - # } - # ``` - # - # The extended version is also keyed by the `crateName`s but allows - # different names for different crate versions: - # - # ```nix - # { - # my_crate_name = [ - # { version = "1.2.3"; rename = "my_alternative_name01"; } - # { version = "3.2.3"; rename = "my_alternative_name03"; } - # ] - # # ... - # } - # ``` - # - # This roughly corresponds to the following snippet in Cargo.toml: - # - # ```toml - # [dependencies] - # my_alternative_name01 = { package = "my_crate_name", version = "0.1" } - # my_alternative_name03 = { package = "my_crate_name", version = "0.3" } - # ``` - # - # Dependencies which use the lib target name as extern name, do not need - # to be specified in the crateRenames, even if their crate name differs. - # - # Including multiple versions of a crate is very popular during - # ecosystem transitions, e.g. from futures 0.1 to futures 0.3. - , crateRenames - # A list of extra options to pass to rustc. - # - # Example: [ "-Z debuginfo=2" ] - # Default: [] - , extraRustcOpts - # A list of extra options to pass to rustc when building a build.rs. - # - # Example: [ "-Z debuginfo=2" ] - # Default: [] - , extraRustcOptsForBuildRs - # Whether to enable building tests. - # Use true to enable. - # Default: false - , buildTests - # Passed to stdenv.mkDerivation. - , preUnpack - # Passed to stdenv.mkDerivation. - , postUnpack - # Passed to stdenv.mkDerivation. - , prePatch - # Passed to stdenv.mkDerivation. - , patches - # Passed to stdenv.mkDerivation. - , postPatch - # Passed to stdenv.mkDerivation. - , preConfigure - # Passed to stdenv.mkDerivation. - , postConfigure - # Passed to stdenv.mkDerivation. - , preBuild - # Passed to stdenv.mkDerivation. - , postBuild - # Passed to stdenv.mkDerivation. - , preInstall - # Passed to stdenv.mkDerivation. - , postInstall - }: - - let - crate = crate_ // (lib.attrByPath [ crate_.crateName ] (attr: { }) crateOverrides crate_); - dependencies_ = dependencies; - buildDependencies_ = buildDependencies; - processedAttrs = [ - "src" - "nativeBuildInputs" - "buildInputs" - "crateBin" - "crateLib" - "libName" - "libPath" - "buildDependencies" - "dependencies" - "features" - "crateRenames" - "crateName" - "version" - "build" - "authors" - "colors" - "edition" - "buildTests" - "codegenUnits" - "links" - ]; - extraDerivationAttrs = builtins.removeAttrs crate processedAttrs; - nativeBuildInputs_ = nativeBuildInputs; - buildInputs_ = buildInputs; - extraRustcOpts_ = extraRustcOpts; - extraRustcOptsForBuildRs_ = extraRustcOptsForBuildRs; - buildTests_ = buildTests; - - # crate2nix has a hack for the old bash based build script that did split - # entries at `,`. No we have to work around that hack. - # https://github.com/kolloch/crate2nix/blame/5b19c1b14e1b0e5522c3e44e300d0b332dc939e7/crate2nix/templates/build.nix.tera#L89 - crateBin = lib.filter (bin: !(bin ? name && bin.name == ",")) (crate.crateBin or [ ]); - hasCrateBin = crate ? crateBin; - - buildCrate = import ./build-crate.nix { - inherit lib stdenv mkRustcDepArgs mkRustcFeatureArgs needUnstableCLI; - rustc = rust; - }; - in - stdenv.mkDerivation (rec { - - inherit (crate) crateName; - inherit - preUnpack - postUnpack - prePatch - patches - postPatch - preConfigure - postConfigure - preBuild - postBuild - preInstall - postInstall - buildTests - ; - - src = crate.src or (fetchCrate { inherit (crate) crateName version sha256; }); - name = "rust_${crate.crateName}-${crate.version}${lib.optionalString buildTests_ "-test"}"; - version = crate.version; - depsBuildBuild = [ pkgsBuildBuild.stdenv.cc ]; - nativeBuildInputs = [ rust cargo jq ] - ++ lib.optionals stdenv.hasCC [ stdenv.cc ] - ++ lib.optionals stdenv.buildPlatform.isDarwin [ libiconv ] - ++ (crate.nativeBuildInputs or [ ]) ++ nativeBuildInputs_; - buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ] ++ (crate.buildInputs or [ ]) ++ buildInputs_; - dependencies = map lib.getLib dependencies_; - buildDependencies = map lib.getLib buildDependencies_; - - completeDeps = lib.unique (dependencies ++ lib.concatMap (dep: dep.completeDeps) dependencies); - completeBuildDeps = lib.unique ( - buildDependencies - ++ lib.concatMap (dep: dep.completeBuildDeps ++ dep.completeDeps) buildDependencies - ); - - # Create a list of features that are enabled by the crate itself and - # through the features argument of buildRustCrate. Exclude features - # with a forward slash, since they are passed through to dependencies, - # and dep: features, since they're internal-only and do nothing except - # enable optional dependencies. - crateFeatures = lib.optionals (crate ? features) - (builtins.filter - (f: !(lib.hasInfix "/" f || lib.hasPrefix "dep:" f)) - (crate.features ++ features) - ); - - libName = if crate ? libName then crate.libName else crate.crateName; - libPath = lib.optionalString (crate ? libPath) crate.libPath; - - # Seed the symbol hashes with something unique every time. - # https://doc.rust-lang.org/1.0.0/rustc/metadata/loader/index.html#frobbing-symbols - metadata = - let - depsMetadata = lib.foldl' (str: dep: str + dep.metadata) "" (dependencies ++ buildDependencies); - hashedMetadata = builtins.hashString "sha256" - (crateName + "-" + crateVersion + "___" + toString (mkRustcFeatureArgs crateFeatures) + - "___" + depsMetadata + "___" + stdenv.hostPlatform.rust.rustcTarget); - in - lib.substring 0 10 hashedMetadata; - - build = crate.build or ""; - # Either set to a concrete sub path to the crate root - # or use `null` for auto-detect. - workspace_member = crate.workspace_member or "."; - crateAuthors = if crate ? authors && lib.isList crate.authors then crate.authors else [ ]; - crateDescription = crate.description or ""; - crateHomepage = crate.homepage or ""; - crateLicense = crate.license or ""; - crateLicenseFile = crate.license-file or ""; - crateLinks = crate.links or ""; - crateReadme = crate.readme or ""; - crateRepository = crate.repository or ""; - crateRustVersion = crate.rust-version or ""; - crateVersion = crate.version; - crateType = - if lib.attrByPath [ "procMacro" ] false crate then [ "proc-macro" ] else - if lib.attrByPath [ "plugin" ] false crate then [ "dylib" ] else - (crate.type or [ "lib" ]); - colors = lib.attrByPath [ "colors" ] "always" crate; - extraLinkFlags = lib.concatStringsSep " " (crate.extraLinkFlags or [ ]); - edition = crate.edition or null; - codegenUnits = if crate ? codegenUnits then crate.codegenUnits else 1; - extraRustcOpts = - lib.optionals (crate ? extraRustcOpts) crate.extraRustcOpts - ++ extraRustcOpts_ - ++ (lib.optional (edition != null) "--edition ${edition}"); - extraRustcOptsForBuildRs = - lib.optionals (crate ? extraRustcOptsForBuildRs) crate.extraRustcOptsForBuildRs - ++ extraRustcOptsForBuildRs_ - ++ (lib.optional (edition != null) "--edition ${edition}"); - - - configurePhase = configureCrate { - inherit crateName crateType buildDependencies completeDeps completeBuildDeps crateDescription - crateFeatures crateRenames libName build workspace_member release libPath crateVersion crateLinks - extraLinkFlags extraRustcOptsForBuildRs - crateLicense crateLicenseFile crateReadme crateRepository crateRustVersion - crateAuthors crateHomepage verbose colors codegenUnits; - }; - buildPhase = buildCrate { - inherit crateName dependencies - crateFeatures crateRenames libName release libPath crateType - metadata hasCrateBin crateBin verbose colors - extraRustcOpts buildTests codegenUnits; - }; - dontStrip = !release; - - # We need to preserve metadata in .rlib, which might get stripped on macOS. See https://github.com/NixOS/nixpkgs/issues/218712 - stripExclude = [ "*.rlib" ]; - - installPhase = installCrate crateName metadata buildTests; - - # depending on the test setting we are either producing something with bins - # and libs or just test binaries - outputs = if buildTests then [ "out" ] else [ "out" "lib" ]; - outputDev = if buildTests then [ "out" ] else [ "lib" ]; - - meta = { - mainProgram = crateName; - badPlatforms = [ - # Rust is currently unable to target the n32 ABI - lib.systems.inspect.patterns.isMips64n32 - ]; - }; - } // extraDerivationAttrs - ) - ) -{ - rust = crate_.rust or rustc; - cargo = crate_.cargo or cargo; - release = crate_.release or true; - verbose = crate_.verbose or true; - extraRustcOpts = [ ]; - extraRustcOptsForBuildRs = [ ]; - features = [ ]; - nativeBuildInputs = [ ]; - buildInputs = [ ]; - crateOverrides = defaultCrateOverrides; - preUnpack = crate_.preUnpack or ""; - postUnpack = crate_.postUnpack or ""; - prePatch = crate_.prePatch or ""; - patches = crate_.patches or [ ]; - postPatch = crate_.postPatch or ""; - preConfigure = crate_.preConfigure or ""; - postConfigure = crate_.postConfigure or ""; - preBuild = crate_.preBuild or ""; - postBuild = crate_.postBuild or ""; - preInstall = crate_.preInstall or ""; - postInstall = crate_.postInstall or ""; - dependencies = crate_.dependencies or [ ]; - buildDependencies = crate_.buildDependencies or [ ]; - crateRenames = crate_.crateRenames or { }; - buildTests = crate_.buildTests or false; -} diff --git a/pkgs/build-support/rust/build-rust-crate/helpers.nix b/pkgs/build-support/rust/build-rust-crate/helpers.nix deleted file mode 100644 index a72bb505a4014..0000000000000 --- a/pkgs/build-support/rust/build-rust-crate/helpers.nix +++ /dev/null @@ -1,35 +0,0 @@ -{ stdenv, lib }: -{ - kernel = stdenv.hostPlatform.parsed.kernel.name; - abi = stdenv.hostPlatform.parsed.abi.name; - cpu = stdenv.hostPlatform.parsed.cpu.name; - updateFeatures = - f: up: functions: - lib.deepSeq f ( - lib.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions - ); - mapFeatures = features: map (fun: fun { features = features; }); - mkFeatures = - feat: - lib.foldl ( - features: featureName: - if feat.${featureName} or false then [ featureName ] ++ features else features - ) [ ] (lib.attrNames feat); - include = - includedFiles: src: - builtins.filterSource ( - path: type: - lib.any ( - f: - let - p = toString (src + ("/" + f)); - in - p == path || (lib.strings.hasPrefix (p + "/") path) - ) includedFiles - ) src; - exclude = - excludedFiles: src: - builtins.filterSource ( - path: type: lib.all (f: !lib.strings.hasPrefix (toString (src + ("/" + f))) path) excludedFiles - ) src; -} diff --git a/pkgs/build-support/rust/build-rust-crate/install-crate.nix b/pkgs/build-support/rust/build-rust-crate/install-crate.nix deleted file mode 100644 index b35652ad454a7..0000000000000 --- a/pkgs/build-support/rust/build-rust-crate/install-crate.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ stdenv }: -crateName: metadata: buildTests: -if !buildTests then - '' - runHook preInstall - # always create $out even if we do not have binaries. We are detecting binary targets during compilation, if those are missing there is no way to only have $lib - mkdir $out - if [[ -s target/env ]]; then - mkdir -p $lib - cp target/env $lib/env - fi - if [[ -s target/link.final ]]; then - mkdir -p $lib/lib - cp target/link.final $lib/lib/link - fi - if [[ "$(ls -A target/lib)" ]]; then - mkdir -p $lib/lib - cp -r target/lib/* $lib/lib #*/ - for library in $lib/lib/*.so $lib/lib/*.dylib; do #*/ - ln -s $library $(echo $library | sed -e "s/-${metadata}//") - done - fi - if [[ "$(ls -A target/build)" ]]; then # */ - mkdir -p $lib/lib - cp -r target/build/* $lib/lib # */ - fi - if [[ -d target/bin ]]; then - if [[ "$(ls -A target/bin)" ]]; then - mkdir -p $out/bin - cp -rP target/bin/* $out/bin # */ - fi - fi - runHook postInstall - '' -else - # for tests we just put them all in the output. No execution. - '' - runHook preInstall - - mkdir -p $out/tests - if [ -e target/bin ]; then - find target/bin/ -type f -executable -exec cp {} $out/tests \; - fi - if [ -e target/lib ]; then - find target/lib/ -type f \! -name '*.rlib' \ - -a \! -name '*${stdenv.hostPlatform.extensions.library}' \ - -a \! -name '*.d' \ - -executable \ - -print0 | xargs --no-run-if-empty --null install --target $out/tests; - fi - - runHook postInstall - '' diff --git a/pkgs/build-support/rust/build-rust-crate/lib.sh b/pkgs/build-support/rust/build-rust-crate/lib.sh deleted file mode 100644 index 36ddc9ac23c4f..0000000000000 --- a/pkgs/build-support/rust/build-rust-crate/lib.sh +++ /dev/null @@ -1,188 +0,0 @@ -echo_build_heading() { - if (( $# == 1 )); then - echo_colored "Building $1" - else - echo_colored "Building $1 ($2)" - fi -} - -build_lib() { - lib_src=$1 - echo_build_heading $lib_src ${libName} - - noisily rustc \ - --crate-name $CRATE_NAME \ - $lib_src \ - --out-dir target/lib \ - -L dependency=target/deps \ - --cap-lints allow \ - $LINK \ - $EXTRA_LINK_ARGS \ - $EXTRA_LINK_ARGS_LIB \ - $LIB_RUSTC_OPTS \ - $BUILD_OUT_DIR \ - $EXTRA_BUILD \ - $EXTRA_FEATURES \ - $EXTRA_RUSTC_FLAGS \ - --color $colors - - EXTRA_LIB=" --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-$metadata.rlib" - if [ -e target/deps/lib$CRATE_NAME-$metadata$LIB_EXT ]; then - EXTRA_LIB="$EXTRA_LIB --extern $CRATE_NAME=target/lib/lib$CRATE_NAME-$metadata$LIB_EXT" - fi -} - -build_bin() { - local crate_name=$1 - local crate_name_=$(echo $crate_name | tr '-' '_') - local main_file="" - - if [[ ! -z $2 ]]; then - main_file=$2 - fi - echo_build_heading $@ - noisily rustc \ - --crate-name $crate_name_ \ - $main_file \ - --crate-type bin \ - $BIN_RUSTC_OPTS \ - --out-dir target/bin \ - -L dependency=target/deps \ - $LINK \ - $EXTRA_LINK_ARGS \ - $EXTRA_LINK_ARGS_BINS \ - $EXTRA_LIB \ - --cap-lints allow \ - $BUILD_OUT_DIR \ - $EXTRA_BUILD \ - $EXTRA_FEATURES \ - $EXTRA_RUSTC_FLAGS \ - --color ${colors} \ - - if [ "$crate_name_" != "$crate_name" ]; then - mv target/bin/$crate_name_ target/bin/$crate_name - fi -} - -build_lib_test() { - local file="$1" - EXTRA_RUSTC_FLAGS="--test $EXTRA_RUSTC_FLAGS" build_lib "$1" "$2" -} - -build_bin_test() { - local crate="$1" - local file="$2" - EXTRA_RUSTC_FLAGS="--test $EXTRA_RUSTC_FLAGS" build_bin "$1" "$2" -} - -build_bin_test_file() { - local file="$1" - local derived_crate_name="${file//\//_}" - # Make sure to strip the top level `tests` directory: see #204051. Note that - # a forward slash has now become an underscore due to the substitution - # above. - derived_crate_name=${derived_crate_name#"tests_"} - derived_crate_name="${derived_crate_name%.rs}" - build_bin_test "$derived_crate_name" "$file" -} - -# Add additional link options that were provided by the build script. -setup_link_paths() { - EXTRA_LIB="" - if [[ -e target/link_ ]]; then - EXTRA_BUILD="$(cat target/link_) $EXTRA_BUILD" - fi - - echo "$EXTRA_LINK_SEARCH" | while read i; do - if [[ ! -z "$i" ]]; then - for library in $i; do - echo "-L $library" >> target/link - L=$(echo $library | sed -e "s#$(pwd)/target/build#$lib/lib#") - echo "-L $L" >> target/link.final - done - fi - done - echo "$EXTRA_LINK_LIBS" | while read i; do - if [[ ! -z "$i" ]]; then - for library in $i; do - echo "-l $library" >> target/link - done - fi - done - - if [[ -e target/link ]]; then - tr '\n' ' ' < target/link > target/link_ - LINK=$(cat target/link_) - fi - - # Add "rustc-cdylib-link-arg" as linker arguments - # https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-cdylib-link-arg - if [[ -n "$CRATE_TYPE_IS_CDYLIB" ]]; then - EXTRA_BUILD+=" $EXTRA_CDYLIB_LINK_ARGS" - fi -} - -search_for_bin_path() { - # heuristic to "guess" the correct source file as found in cargo: - # https://github.com/rust-lang/cargo/blob/90fc9f620190d5fa3c80b0c8c65a1e1361e6b8ae/src/cargo/util/toml/targets.rs#L308-L325 - - BIN_NAME=$1 - BIN_NAME_=$(echo $BIN_NAME | tr '-' '_') - - # the first two cases are the "new" default IIRC - FILES=( "src/bin/$BIN_NAME.rs" "src/bin/$BIN_NAME/main.rs" "src/bin/$BIN_NAME_.rs" "src/bin/$BIN_NAME_/main.rs" "src/bin/main.rs" "src/main.rs" ) - - if ! [ -e "$LIB_PATH" -o -e src/lib.rs -o -e "src/$LIB_NAME.rs" ]; then - # if this is not a library the following path is also valid - FILES=( "src/$BIN_NAME.rs" "src/$BIN_NAME_.rs" "${FILES[@]}" ) - fi - - for file in "${FILES[@]}"; - do - echo "checking file $file" - # first file that exists wins - if [[ -e "$file" ]]; then - BIN_PATH="$file" - break - fi - done - - if [[ -z "$BIN_PATH" ]]; then - echo_error "ERROR: failed to find file for binary target: $BIN_NAME" >&2 - exit 1 - fi -} - -# Extracts cargo_toml_path of the matching crate. -matching_cargo_toml_path() { - local manifest_path="$1" - local expected_crate_name="$2" - - # If the Cargo.toml is not a workspace root, - # it will only contain one package in ".packages" - # because "--no-deps" suppressed dependency resolution. - # - # But to make it more general, we search for a matching - # crate in all packages and use the manifest path that - # is referenced there. - cargo metadata --no-deps --format-version 1 \ - --manifest-path "$manifest_path" \ - | jq -r '.packages[] - | select( .name == "'$expected_crate_name'") - | .manifest_path' -} - -# Find a Cargo.toml in the current or any sub directory -# with a matching crate name. -matching_cargo_toml_dir() { - local expected_crate_name="$1" - - find -L -name Cargo.toml | sort | while read manifest_path; do - echo "...checking manifest_path $manifest_path" >&2 - local matching_path="$(matching_cargo_toml_path "$manifest_path" "$expected_crate_name")" - if [ -n "${matching_path}" ]; then - echo "$(dirname $matching_path)" - break - fi - done -} diff --git a/pkgs/build-support/rust/build-rust-crate/log.nix b/pkgs/build-support/rust/build-rust-crate/log.nix deleted file mode 100644 index b1a07f1a9589c..0000000000000 --- a/pkgs/build-support/rust/build-rust-crate/log.nix +++ /dev/null @@ -1,61 +0,0 @@ -{ lib }: - -let - echo_colored_body = - start_escape: - # Body of a function that behaves like "echo" but - # has the output colored by the given start_escape - # sequence. E.g. - # - # * echo_x "Building ..." - # * echo_x -n "Running " - # - # This is more complicated than apparent at first sight - # because: - # * The color markers and the text must be print - # in the same echo statement. Otherise, other - # intermingled text from concurrent builds will - # be colored as well. - # * We need to preserve the trailing newline of the - # echo if and only if it is present. Bash likes - # to strip those if we capture the output of echo - # in a variable. - # * Leading "-" will be interpreted by test as an - # option for itself. Therefore, we prefix it with - # an x in `[[ "x$1" =~ ^x- ]]`. - '' - local echo_args=""; - while [[ "x$1" =~ ^x- ]]; do - echo_args+=" $1" - shift - done - - local start_escape="$(printf '${start_escape}')" - local reset="$(printf '\033[0m')" - echo $echo_args $start_escape"$@"$reset - ''; - echo_conditional_colored_body = - colors: start_escape: - if colors == "always" then (echo_colored_body start_escape) else ''echo "$@"''; -in -{ - echo_colored = colors: '' - echo_colored() { - ${echo_conditional_colored_body colors ''\033[0;1;32m''} - } - - echo_error() { - ${echo_conditional_colored_body colors ''\033[0;1;31m''} - } - ''; - - noisily = colors: verbose: '' - noisily() { - ${lib.optionalString verbose '' - echo_colored -n "Running " - echo $@ - ''} - $@ - } - ''; -} diff --git a/pkgs/build-support/rust/build-rust-crate/test/brotli-crates.nix b/pkgs/build-support/rust/build-rust-crate/test/brotli-crates.nix deleted file mode 100644 index 006045c206040..0000000000000 --- a/pkgs/build-support/rust/build-rust-crate/test/brotli-crates.nix +++ /dev/null @@ -1,161 +0,0 @@ -{ - lib, - stdenv, - buildRustCrate, - fetchgit, -}: -let - kernel = stdenv.buildPlatform.parsed.kernel.name; - abi = stdenv.buildPlatform.parsed.abi.name; - include = - includedFiles: src: - builtins.filterSource ( - path: type: - lib.lists.any ( - f: - let - p = toString (src + ("/" + f)); - in - (path == p) || (type == "directory" && lib.strings.hasPrefix path p) - ) includedFiles - ) src; - updateFeatures = - f: up: functions: - builtins.deepSeq f ( - lib.lists.foldl' (features: fun: fun features) (lib.attrsets.recursiveUpdate f up) functions - ); - mapFeatures = features: map (fun: fun { features = features; }); - mkFeatures = - feat: - lib.lists.foldl ( - features: featureName: - if feat.${featureName} or false then [ featureName ] ++ features else features - ) [ ] (builtins.attrNames feat); -in -rec { - alloc_no_stdlib_1_3_0_ = - { - dependencies ? [ ], - buildDependencies ? [ ], - features ? [ ], - }: - buildRustCrate { - crateName = "alloc-no-stdlib"; - version = "1.3.0"; - authors = [ "Daniel Reiter Horn " ]; - sha256 = "1jcp27pzmqdszgp80y484g4kwbjbg7x8a589drcwbxg0i8xwkir9"; - crateBin = [ { name = "example"; } ]; - inherit dependencies buildDependencies features; - }; - brotli_2_5_0_ = - { - dependencies ? [ ], - buildDependencies ? [ ], - features ? [ ], - }: - buildRustCrate { - crateName = "brotli"; - version = "2.5.0"; - authors = [ - "Daniel Reiter Horn " - "The Brotli Authors" - ]; - sha256 = "1ynw4hkdwnp0kj30p86ls44ahv4s99258s019bqrq4mya8hlsb5b"; - crateBin = [ { name = "brotli"; } ]; - inherit dependencies buildDependencies features; - }; - brotli_decompressor_1_3_1_ = - { - dependencies ? [ ], - buildDependencies ? [ ], - features ? [ ], - }: - buildRustCrate { - crateName = "brotli-decompressor"; - version = "1.3.1"; - authors = [ - "Daniel Reiter Horn " - "The Brotli Authors" - ]; - sha256 = "022g69q1xzwdj0130qm3fa4qwpn4q1jx3lc8yz0v0v201p7bm8fb"; - crateBin = [ { name = "brotli-decompressor"; } ]; - inherit dependencies buildDependencies features; - }; - alloc_no_stdlib_1_3_0 = - { - features ? (alloc_no_stdlib_1_3_0_features { }), - }: - alloc_no_stdlib_1_3_0_ { - features = mkFeatures (features.alloc_no_stdlib_1_3_0 or { }); - }; - alloc_no_stdlib_1_3_0_features = - f: - updateFeatures f ({ - alloc_no_stdlib_1_3_0.default = (f.alloc_no_stdlib_1_3_0.default or true); - }) [ ]; - brotli_2_5_0 = - { - features ? (brotli_2_5_0_features { }), - }: - brotli_2_5_0_ { - dependencies = mapFeatures features ([ - alloc_no_stdlib_1_3_0 - brotli_decompressor_1_3_1 - ]); - features = mkFeatures (features.brotli_2_5_0 or { }); - }; - brotli_2_5_0_features = - f: - updateFeatures f - (rec { - alloc_no_stdlib_1_3_0.no-stdlib = - (f.alloc_no_stdlib_1_3_0.no-stdlib or false) - || (brotli_2_5_0.no-stdlib or false) - || (f.brotli_2_5_0.no-stdlib or false); - alloc_no_stdlib_1_3_0.default = true; - brotli_2_5_0.default = (f.brotli_2_5_0.default or true); - brotli_decompressor_1_3_1.disable-timer = - (f.brotli_decompressor_1_3_1.disable-timer or false) - || (brotli_2_5_0.disable-timer or false) - || (f.brotli_2_5_0.disable-timer or false); - brotli_decompressor_1_3_1.no-stdlib = - (f.brotli_decompressor_1_3_1.no-stdlib or false) - || (brotli_2_5_0.no-stdlib or false) - || (f.brotli_2_5_0.no-stdlib or false); - brotli_decompressor_1_3_1.benchmark = - (f.brotli_decompressor_1_3_1.benchmark or false) - || (brotli_2_5_0.benchmark or false) - || (f.brotli_2_5_0.benchmark or false); - brotli_decompressor_1_3_1.default = true; - brotli_decompressor_1_3_1.seccomp = - (f.brotli_decompressor_1_3_1.seccomp or false) - || (brotli_2_5_0.seccomp or false) - || (f.brotli_2_5_0.seccomp or false); - }) - [ - alloc_no_stdlib_1_3_0_features - brotli_decompressor_1_3_1_features - ]; - brotli_decompressor_1_3_1 = - { - features ? (brotli_decompressor_1_3_1_features { }), - }: - brotli_decompressor_1_3_1_ { - dependencies = mapFeatures features ([ alloc_no_stdlib_1_3_0 ]); - features = mkFeatures (features.brotli_decompressor_1_3_1 or { }); - }; - brotli_decompressor_1_3_1_features = - f: - updateFeatures f (rec { - alloc_no_stdlib_1_3_0.no-stdlib = - (f.alloc_no_stdlib_1_3_0.no-stdlib or false) - || (brotli_decompressor_1_3_1.no-stdlib or false) - || (f.brotli_decompressor_1_3_1.no-stdlib or false); - alloc_no_stdlib_1_3_0.default = true; - alloc_no_stdlib_1_3_0.unsafe = - (f.alloc_no_stdlib_1_3_0.unsafe or false) - || (brotli_decompressor_1_3_1.unsafe or false) - || (f.brotli_decompressor_1_3_1.unsafe or false); - brotli_decompressor_1_3_1.default = (f.brotli_decompressor_1_3_1.default or true); - }) [ alloc_no_stdlib_1_3_0_features ]; -} diff --git a/pkgs/build-support/rust/build-rust-crate/test/default.nix b/pkgs/build-support/rust/build-rust-crate/test/default.nix deleted file mode 100644 index fdfc8fdef01ef..0000000000000 --- a/pkgs/build-support/rust/build-rust-crate/test/default.nix +++ /dev/null @@ -1,909 +0,0 @@ -{ - lib, - buildPackages, - buildRustCrate, - callPackage, - releaseTools, - runCommand, - runCommandCC, - stdenv, - symlinkJoin, - writeTextFile, - pkgsCross, -}: - -let - mkCrate = - buildRustCrate: args: - let - p = { - crateName = "nixtestcrate"; - version = "0.1.0"; - authors = [ "Test " ]; - } // args; - in - buildRustCrate p; - mkHostCrate = mkCrate buildRustCrate; - - mkCargoToml = - { - name, - crateVersion ? "0.1.0", - path ? "Cargo.toml", - }: - mkFile path '' - [package] - name = ${builtins.toJSON name} - version = ${builtins.toJSON crateVersion} - ''; - - mkFile = - destination: text: - writeTextFile { - name = "src"; - destination = "/${destination}"; - inherit text; - }; - - mkBin = - name: - mkFile name '' - use std::env; - fn main() { - let name: String = env::args().nth(0).unwrap(); - println!("executed {}", name); - } - ''; - - mkBinExtern = - name: extern: - mkFile name '' - extern crate ${extern}; - fn main() { - assert_eq!(${extern}::test(), 23); - } - ''; - - mkTestFile = - name: functionName: - mkFile name '' - #[cfg(test)] - #[test] - fn ${functionName}() { - assert!(true); - } - ''; - mkTestFileWithMain = - name: functionName: - mkFile name '' - #[cfg(test)] - #[test] - fn ${functionName}() { - assert!(true); - } - - fn main() {} - ''; - - mkLib = name: mkFile name "pub fn test() -> i32 { return 23; }"; - - mkTest = - crateArgs: - let - crate = mkHostCrate (builtins.removeAttrs crateArgs [ "expectedTestOutput" ]); - hasTests = crateArgs.buildTests or false; - expectedTestOutputs = crateArgs.expectedTestOutputs or null; - binaries = map (v: lib.escapeShellArg v.name) (crateArgs.crateBin or [ ]); - isLib = crateArgs ? libName || crateArgs ? libPath; - crateName = crateArgs.crateName or "nixtestcrate"; - libName = crateArgs.libName or crateName; - - libTestBinary = - if !isLib then - null - else - mkHostCrate { - crateName = "run-test-${crateName}"; - dependencies = [ crate ]; - src = mkBinExtern "src/main.rs" libName; - }; - - in - assert expectedTestOutputs != null -> hasTests; - assert hasTests -> expectedTestOutputs != null; - - runCommand "run-buildRustCrate-${crateName}-test" - { - nativeBuildInputs = [ crate ]; - } - ( - if !hasTests then - '' - ${lib.concatMapStringsSep "\n" ( - binary: - # Can't actually run the binary when cross-compiling - (lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "type ") + binary - ) binaries} - ${lib.optionalString isLib '' - test -e ${crate}/lib/*.rlib || exit 1 - ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "test -x "} \ - ${libTestBinary}/bin/run-test-${crateName} - ''} - touch $out - '' - else if stdenv.hostPlatform == stdenv.buildPlatform then - '' - for file in ${crate}/tests/*; do - $file 2>&1 >> $out - done - set -e - ${lib.concatMapStringsSep "\n" ( - o: "grep '${o}' $out || { echo 'output \"${o}\" not found in:'; cat $out; exit 23; }" - ) expectedTestOutputs} - '' - else - '' - for file in ${crate}/tests/*; do - test -x "$file" - done - touch "$out" - '' - ); - - /* - Returns a derivation that asserts that the crate specified by `crateArgs` - has the specified files as output. - - `name` is used as part of the derivation name that performs the checking. - - `mkCrate` can be used to override the `mkCrate` call/implementation to use to - override the `buildRustCrate`, useful for cross compilation. Uses `mkHostCrate` by default. - - `crateArgs` is passed to `mkCrate` to build the crate with `buildRustCrate` - - `expectedFiles` contains a list of expected file paths in the output. E.g. - `[ "./bin/my_binary" ]`. - - `output` specifies the name of the output to use. By default, the default - output is used but e.g. `output = "lib";` will cause the lib output - to be checked instead. You do not need to specify any directories. - */ - assertOutputs = - { - name, - mkCrate ? mkHostCrate, - crateArgs, - expectedFiles, - output ? null, - }: - assert (builtins.isString name); - assert (builtins.isAttrs crateArgs); - assert (builtins.isList expectedFiles); - - let - crate = mkCrate (builtins.removeAttrs crateArgs [ "expectedTestOutput" ]); - crateOutput = if output == null then crate else crate."${output}"; - expectedFilesFile = writeTextFile { - name = "expected-files-${name}"; - text = - let - sorted = builtins.sort (a: b: a < b) expectedFiles; - concatenated = builtins.concatStringsSep "\n" sorted; - in - "${concatenated}\n"; - }; - in - runCommand "assert-outputs-${name}" - { - } - ( - '' - local actualFiles=$(mktemp) - - cd "${crateOutput}" - find . -type f \ - | sort \ - '' - # sed out the hash because it differs per platform - + '' - | sed 's/-${crate.metadata}//g' \ - > "$actualFiles" - diff -q ${expectedFilesFile} "$actualFiles" > /dev/null || { - echo -e "\033[0;1;31mERROR: Difference in expected output files in ${crateOutput} \033[0m" >&2 - echo === Got: - sed -e 's/^/ /' $actualFiles - echo === Expected: - sed -e 's/^/ /' ${expectedFilesFile} - echo === Diff: - diff -u ${expectedFilesFile} $actualFiles |\ - tail -n +3 |\ - sed -e 's/^/ /' - exit 1 - } - touch $out - '' - ); - -in -rec { - - tests = - let - cases = rec { - libPath = { - libPath = "src/my_lib.rs"; - src = mkLib "src/my_lib.rs"; - }; - srcLib = { - src = mkLib "src/lib.rs"; - }; - - # This used to be supported by cargo but as of 1.40.0 I can't make it work like that with just cargo anymore. - # This might be a regression or deprecated thing they finally removed… - # customLibName = { libName = "test_lib"; src = mkLib "src/test_lib.rs"; }; - # rustLibTestsCustomLibName = { - # libName = "test_lib"; - # src = mkTestFile "src/test_lib.rs" "foo"; - # buildTests = true; - # expectedTestOutputs = [ "test foo ... ok" ]; - # }; - - customLibNameAndLibPath = { - libName = "test_lib"; - libPath = "src/best-lib.rs"; - src = mkLib "src/best-lib.rs"; - }; - crateBinWithPath = { - crateBin = [ - { - name = "test_binary1"; - path = "src/foobar.rs"; - } - ]; - src = mkBin "src/foobar.rs"; - }; - crateBinNoPath1 = { - crateBin = [ { name = "my-binary2"; } ]; - src = mkBin "src/my_binary2.rs"; - }; - crateBinNoPath2 = { - crateBin = [ - { name = "my-binary3"; } - { name = "my-binary4"; } - ]; - src = symlinkJoin { - name = "buildRustCrateMultipleBinariesCase"; - paths = [ - (mkBin "src/bin/my_binary3.rs") - (mkBin "src/bin/my_binary4.rs") - ]; - }; - }; - crateBinNoPath3 = { - crateBin = [ { name = "my-binary5"; } ]; - src = mkBin "src/bin/main.rs"; - }; - crateBinNoPath4 = { - crateBin = [ { name = "my-binary6"; } ]; - src = mkBin "src/main.rs"; - }; - crateBinRename1 = { - crateBin = [ { name = "my-binary-rename1"; } ]; - src = mkBinExtern "src/main.rs" "foo_renamed"; - dependencies = [ - (mkHostCrate { - crateName = "foo"; - src = mkLib "src/lib.rs"; - }) - ]; - crateRenames = { - "foo" = "foo_renamed"; - }; - }; - crateBinRename2 = { - crateBin = [ { name = "my-binary-rename2"; } ]; - src = mkBinExtern "src/main.rs" "foo_renamed"; - dependencies = [ - (mkHostCrate { - crateName = "foo"; - libName = "foolib"; - src = mkLib "src/lib.rs"; - }) - ]; - crateRenames = { - "foo" = "foo_renamed"; - }; - }; - crateBinRenameMultiVersion = - let - crateWithVersion = - version: - mkHostCrate { - crateName = "my_lib"; - inherit version; - src = mkFile "src/lib.rs" '' - pub const version: &str = "${version}"; - ''; - }; - depCrate01 = crateWithVersion "0.1.2"; - depCrate02 = crateWithVersion "0.2.1"; - in - { - crateName = "my_bin"; - src = symlinkJoin { - name = "my_bin_src"; - paths = [ - (mkFile "src/main.rs" '' - #[test] - fn my_lib_01() { assert_eq!(lib01::version, "0.1.2"); } - - #[test] - fn my_lib_02() { assert_eq!(lib02::version, "0.2.1"); } - - fn main() { } - '') - ]; - }; - dependencies = [ - depCrate01 - depCrate02 - ]; - crateRenames = { - "my_lib" = [ - { - version = "0.1.2"; - rename = "lib01"; - } - { - version = "0.2.1"; - rename = "lib02"; - } - ]; - }; - buildTests = true; - expectedTestOutputs = [ - "test my_lib_01 ... ok" - "test my_lib_02 ... ok" - ]; - }; - rustLibTestsDefault = { - src = mkTestFile "src/lib.rs" "baz"; - buildTests = true; - expectedTestOutputs = [ "test baz ... ok" ]; - }; - rustLibTestsCustomLibPath = { - libPath = "src/test_path.rs"; - src = mkTestFile "src/test_path.rs" "bar"; - buildTests = true; - expectedTestOutputs = [ "test bar ... ok" ]; - }; - rustLibTestsCustomLibPathWithTests = { - libPath = "src/test_path.rs"; - src = symlinkJoin { - name = "rust-lib-tests-custom-lib-path-with-tests-dir"; - paths = [ - (mkTestFile "src/test_path.rs" "bar") - (mkTestFile "tests/something.rs" "something") - ]; - }; - buildTests = true; - expectedTestOutputs = [ - "test bar ... ok" - "test something ... ok" - ]; - }; - rustBinTestsCombined = { - src = symlinkJoin { - name = "rust-bin-tests-combined"; - paths = [ - (mkTestFileWithMain "src/main.rs" "src_main") - (mkTestFile "tests/foo.rs" "tests_foo") - (mkTestFile "tests/bar.rs" "tests_bar") - ]; - }; - buildTests = true; - expectedTestOutputs = [ - "test src_main ... ok" - "test tests_foo ... ok" - "test tests_bar ... ok" - ]; - }; - rustBinTestsSubdirCombined = { - src = symlinkJoin { - name = "rust-bin-tests-subdir-combined"; - paths = [ - (mkTestFileWithMain "src/main.rs" "src_main") - (mkTestFile "tests/foo/main.rs" "tests_foo") - (mkTestFile "tests/bar/main.rs" "tests_bar") - ]; - }; - buildTests = true; - expectedTestOutputs = [ - "test src_main ... ok" - "test tests_foo ... ok" - "test tests_bar ... ok" - ]; - }; - linkAgainstRlibCrate = { - crateName = "foo"; - src = mkFile "src/main.rs" '' - extern crate somerlib; - fn main() {} - ''; - dependencies = [ - (mkHostCrate { - crateName = "somerlib"; - type = [ "rlib" ]; - src = mkLib "src/lib.rs"; - }) - ]; - }; - buildScriptDeps = - let - depCrate = - buildRustCrate: boolVal: - mkCrate buildRustCrate { - crateName = "bar"; - src = mkFile "src/lib.rs" '' - pub const baz: bool = ${boolVal}; - ''; - }; - in - { - crateName = "foo"; - src = symlinkJoin { - name = "build-script-and-main"; - paths = [ - (mkFile "src/main.rs" '' - extern crate bar; - #[cfg(test)] - #[test] - fn baz_false() { assert!(!bar::baz); } - fn main() { } - '') - (mkFile "build.rs" '' - extern crate bar; - fn main() { assert!(bar::baz); } - '') - ]; - }; - buildDependencies = [ (depCrate buildPackages.buildRustCrate "true") ]; - dependencies = [ (depCrate buildRustCrate "false") ]; - buildTests = true; - expectedTestOutputs = [ "test baz_false ... ok" ]; - }; - buildScriptFeatureEnv = { - crateName = "build-script-feature-env"; - features = [ - "some-feature" - "crate/another_feature" - ]; - src = symlinkJoin { - name = "build-script-feature-env"; - paths = [ - (mkFile "src/main.rs" '' - #[cfg(test)] - #[test] - fn feature_not_visible() { - assert!(std::env::var("CARGO_FEATURE_SOME_FEATURE").is_err()); - assert!(option_env!("CARGO_FEATURE_SOME_FEATURE").is_none()); - } - fn main() {} - '') - (mkFile "build.rs" '' - fn main() { - assert!(std::env::var("CARGO_FEATURE_SOME_FEATURE").is_ok()); - assert!(option_env!("CARGO_FEATURE_SOME_FEATURE").is_none()); - } - '') - ]; - }; - buildTests = true; - expectedTestOutputs = [ "test feature_not_visible ... ok" ]; - }; - # Regression test for https://github.com/NixOS/nixpkgs/pull/88054 - # Build script output should be rewritten as valid env vars. - buildScriptIncludeDirDeps = - let - depCrate = mkHostCrate { - crateName = "bar"; - src = symlinkJoin { - name = "build-script-and-include-dir-bar"; - paths = [ - (mkFile "src/lib.rs" '' - fn main() { } - '') - (mkFile "build.rs" '' - use std::path::PathBuf; - fn main() { println!("cargo:include-dir={}/src", std::env::current_dir().unwrap_or(PathBuf::from(".")).to_str().unwrap()); } - '') - ]; - }; - }; - in - { - crateName = "foo"; - src = symlinkJoin { - name = "build-script-and-include-dir-foo"; - paths = [ - (mkFile "src/main.rs" '' - fn main() { } - '') - (mkFile "build.rs" '' - fn main() { assert!(std::env::var_os("DEP_BAR_INCLUDE_DIR").is_some()); } - '') - ]; - }; - buildDependencies = [ depCrate ]; - dependencies = [ depCrate ]; - }; - # Support new invocation prefix for build scripts `cargo::` - # https://doc.rust-lang.org/cargo/reference/build-scripts.html#outputs-of-the-build-script - buildScriptInvocationPrefix = - let - depCrate = - buildRustCrate: - mkCrate buildRustCrate { - crateName = "bar"; - src = mkFile "build.rs" '' - fn main() { - // Old invocation prefix - // We likely won't see be mixing these syntaxes in the same build script in the wild. - println!("cargo:key_old=value_old"); - - // New invocation prefix - println!("cargo::metadata=key=value"); - println!("cargo::metadata=key_complex=complex(value)"); - } - ''; - }; - in - { - crateName = "foo"; - src = symlinkJoin { - name = "build-script-and-main-invocation-prefix"; - paths = [ - (mkFile "src/main.rs" '' - const BUILDFOO: &'static str = env!("BUILDFOO"); - - #[test] - fn build_foo_check() { assert!(BUILDFOO == "yes(check)"); } - - fn main() { } - '') - (mkFile "build.rs" '' - use std::env; - fn main() { - assert!(env::var_os("DEP_BAR_KEY_OLD").expect("metadata key 'key_old' not set in dependency") == "value_old"); - assert!(env::var_os("DEP_BAR_KEY").expect("metadata key 'key' not set in dependency") == "value"); - assert!(env::var_os("DEP_BAR_KEY_COMPLEX").expect("metadata key 'key_complex' not set in dependency") == "complex(value)"); - - println!("cargo::rustc-env=BUILDFOO=yes(check)"); - } - '') - ]; - }; - buildDependencies = [ (depCrate buildPackages.buildRustCrate) ]; - dependencies = [ (depCrate buildRustCrate) ]; - buildTests = true; - expectedTestOutputs = [ "test build_foo_check ... ok" ]; - }; - # Regression test for https://github.com/NixOS/nixpkgs/issues/74071 - # Whenevever a build.rs file is generating files those should not be overlayed onto the actual source dir - buildRsOutDirOverlay = { - src = symlinkJoin { - name = "buildrs-out-dir-overlay"; - paths = [ - (mkLib "src/lib.rs") - (mkFile "build.rs" '' - use std::env; - use std::ffi::OsString; - use std::fs; - use std::path::Path; - fn main() { - let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR not set"); - let out_file = Path::new(&out_dir).join("lib.rs"); - fs::write(out_file, "invalid rust code!").expect("failed to write lib.rs"); - } - '') - ]; - }; - }; - # Regression test for https://github.com/NixOS/nixpkgs/pull/83379 - # link flag order should be preserved - linkOrder = { - src = symlinkJoin { - name = "buildrs-out-dir-overlay"; - paths = [ - (mkFile "build.rs" '' - fn main() { - // in the other order, linkage will fail - println!("cargo:rustc-link-lib=b"); - println!("cargo:rustc-link-lib=a"); - } - '') - (mkFile "src/main.rs" '' - extern "C" { - fn hello_world(); - } - fn main() { - unsafe { - hello_world(); - } - } - '') - ]; - }; - buildInputs = - let - compile = - name: text: - let - src = writeTextFile { - name = "${name}-src.c"; - inherit text; - }; - in - runCommandCC name { } '' - mkdir -p $out/lib - # Note: On darwin (which defaults to clang) we have to add - # `-undefined dynamic_lookup` as otherwise the compilation fails. - $CC -shared \ - ${lib.optionalString stdenv.hostPlatform.isDarwin "-undefined dynamic_lookup"} \ - -o $out/lib/${name}${stdenv.hostPlatform.extensions.library} ${src} - ''; - b = compile "libb" '' - #include - - void hello(); - - void hello_world() { - hello(); - printf(" world!\n"); - } - ''; - a = compile "liba" '' - #include - - void hello() { - printf("hello"); - } - ''; - in - [ - a - b - ]; - }; - rustCargoTomlInSubDir = { - # The "workspace_member" can be set to the sub directory with the crate to build. - # By default ".", meaning the top level directory is assumed. - # Using null will trigger a search. - workspace_member = null; - src = symlinkJoin rec { - name = "find-cargo-toml"; - paths = [ - (mkCargoToml { name = "ignoreMe"; }) - (mkTestFileWithMain "src/main.rs" "ignore_main") - - (mkCargoToml { - name = "rustCargoTomlInSubDir"; - path = "subdir/Cargo.toml"; - }) - (mkTestFileWithMain "subdir/src/main.rs" "src_main") - (mkTestFile "subdir/tests/foo/main.rs" "tests_foo") - (mkTestFile "subdir/tests/bar/main.rs" "tests_bar") - ]; - }; - buildTests = true; - expectedTestOutputs = [ - "test src_main ... ok" - "test tests_foo ... ok" - "test tests_bar ... ok" - ]; - }; - - rustCargoTomlInTopDir = - let - withoutCargoTomlSearch = builtins.removeAttrs rustCargoTomlInSubDir [ "workspace_member" ]; - in - withoutCargoTomlSearch - // { - expectedTestOutputs = [ - "test ignore_main ... ok" - ]; - }; - procMacroInPrelude = { - procMacro = true; - edition = "2018"; - src = symlinkJoin { - name = "proc-macro-in-prelude"; - paths = [ - (mkFile "src/lib.rs" '' - use proc_macro::TokenTree; - '') - ]; - }; - }; - }; - brotliCrates = (callPackage ./brotli-crates.nix { }); - rcgenCrates = callPackage ./rcgen-crates.nix { - # Suppress deprecation warning - buildRustCrate = null; - }; - tests = lib.mapAttrs ( - key: value: mkTest (value // lib.optionalAttrs (!value ? crateName) { crateName = key; }) - ) cases; - in - tests - // rec { - - crateBinWithPathOutputs = assertOutputs { - name = "crateBinWithPath"; - crateArgs = { - crateBin = [ - { - name = "test_binary1"; - path = "src/foobar.rs"; - } - ]; - src = mkBin "src/foobar.rs"; - }; - expectedFiles = [ - "./bin/test_binary1" - ]; - }; - - crateBinWithPathOutputsDebug = assertOutputs { - name = "crateBinWithPath"; - crateArgs = { - release = false; - crateBin = [ - { - name = "test_binary1"; - path = "src/foobar.rs"; - } - ]; - src = mkBin "src/foobar.rs"; - }; - expectedFiles = - [ - "./bin/test_binary1" - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ - # On Darwin, the debug symbols are in a separate directory. - "./bin/test_binary1.dSYM/Contents/Info.plist" - "./bin/test_binary1.dSYM/Contents/Resources/DWARF/test_binary1" - ]; - }; - - crateBinNoPath1Outputs = assertOutputs { - name = "crateBinNoPath1"; - crateArgs = { - crateBin = [ { name = "my-binary2"; } ]; - src = mkBin "src/my_binary2.rs"; - }; - expectedFiles = [ - "./bin/my-binary2" - ]; - }; - - crateLibOutputs = assertOutputs { - name = "crateLib"; - output = "lib"; - crateArgs = { - libName = "test_lib"; - type = [ "rlib" ]; - libPath = "src/lib.rs"; - src = mkLib "src/lib.rs"; - }; - expectedFiles = [ - "./nix-support/propagated-build-inputs" - "./lib/libtest_lib.rlib" - "./lib/link" - ]; - }; - - crateLibOutputsDebug = assertOutputs { - name = "crateLib"; - output = "lib"; - crateArgs = { - release = false; - libName = "test_lib"; - type = [ "rlib" ]; - libPath = "src/lib.rs"; - src = mkLib "src/lib.rs"; - }; - expectedFiles = [ - "./nix-support/propagated-build-inputs" - "./lib/libtest_lib.rlib" - "./lib/link" - ]; - }; - - crateLibOutputsWasm32 = assertOutputs { - name = "wasm32-crate-lib"; - output = "lib"; - mkCrate = mkCrate pkgsCross.wasm32-unknown-none.buildRustCrate; - crateArgs = { - libName = "test_lib"; - type = [ "cdylib" ]; - libPath = "src/lib.rs"; - src = mkLib "src/lib.rs"; - }; - expectedFiles = [ - "./nix-support/propagated-build-inputs" - "./lib/test_lib.wasm" - "./lib/link" - ]; - }; - - brotliTest = - let - pkg = brotliCrates.brotli_2_5_0 { }; - in - runCommand "run-brotli-test-cmd" - { - nativeBuildInputs = [ pkg ]; - } - ( - if stdenv.hostPlatform == stdenv.buildPlatform then - '' - ${pkg}/bin/brotli -c ${pkg}/bin/brotli > /dev/null && touch $out - '' - else - '' - test -x '${pkg}/bin/brotli' && touch $out - '' - ); - allocNoStdLibTest = - let - pkg = brotliCrates.alloc_no_stdlib_1_3_0 { }; - in - runCommand "run-alloc-no-stdlib-test-cmd" - { - nativeBuildInputs = [ pkg ]; - } - '' - test -e ${pkg}/bin/example && touch $out - ''; - brotliDecompressorTest = - let - pkg = brotliCrates.brotli_decompressor_1_3_1 { }; - in - runCommand "run-brotli-decompressor-test-cmd" - { - nativeBuildInputs = [ pkg ]; - } - '' - test -e ${pkg}/bin/brotli-decompressor && touch $out - ''; - - rcgenTest = - let - pkg = rcgenCrates.rootCrate.build; - in - runCommand "run-rcgen-test-cmd" - { - nativeBuildInputs = [ pkg ]; - } - ( - if stdenv.hostPlatform == stdenv.buildPlatform then - '' - ${pkg}/bin/rcgen && touch $out - '' - else - '' - test -x '${pkg}/bin/rcgen' && touch $out - '' - ); - }; - test = releaseTools.aggregate { - name = "buildRustCrate-tests"; - meta = { - description = "Test cases for buildRustCrate"; - maintainers = [ ]; - }; - constituents = builtins.attrValues tests; - }; -} diff --git a/pkgs/build-support/rust/build-rust-crate/test/rcgen-crates.nix b/pkgs/build-support/rust/build-rust-crate/test/rcgen-crates.nix deleted file mode 100644 index 4400df270666b..0000000000000 --- a/pkgs/build-support/rust/build-rust-crate/test/rcgen-crates.nix +++ /dev/null @@ -1,5013 +0,0 @@ -# This file was @generated by crate2nix 0.10.0 with the command: -# "generate" -# See https://github.com/kolloch/crate2nix for more info. - -{ - nixpkgs ? , - pkgs ? import nixpkgs { config = { }; }, - lib ? pkgs.lib, - stdenv ? pkgs.stdenv, - buildRustCrateForPkgs ? - if buildRustCrate != null then - lib.warn - "crate2nix: Passing `buildRustCrate` as argument to Cargo.nix is deprecated. If you don't customize `buildRustCrate`, replace `callPackage ./Cargo.nix {}` by `import ./Cargo.nix { inherit pkgs; }`, and if you need to customize `buildRustCrate`, use `buildRustCrateForPkgs` instead." - (_: buildRustCrate) - else - pkgs: pkgs.buildRustCrate, - # Deprecated - buildRustCrate ? null, - # This is used as the `crateOverrides` argument for `buildRustCrate`. - defaultCrateOverrides ? pkgs.defaultCrateOverrides, - # The features to enable for the root_crate or the workspace_members. - rootFeatures ? [ "default" ], - # If true, throw errors instead of issueing deprecation warnings. - strictDeprecation ? false, - # Used for conditional compilation based on CPU feature detection. - targetFeatures ? [ ], - # Whether to perform release builds: longer compile times, faster binaries. - release ? true, - # Additional crate2nix configuration if it exists. - crateConfig ? lib.optionalAttrs (builtins.pathExists ./crate-config.nix) ( - pkgs.callPackage ./crate-config.nix { } - ), -}: - -rec { - # - # "public" attributes that we attempt to keep stable with new versions of crate2nix. - # - - rootCrate = rec { - packageId = "rcgen"; - - # Use this attribute to refer to the derivation building your root crate package. - # You can override the features with rootCrate.build.override { features = [ "default" "feature1" ... ]; }. - build = internal.buildRustCrateWithFeatures { - inherit packageId; - }; - - # Debug support which might change between releases. - # File a bug if you depend on any for non-debug work! - debug = internal.debugCrate { inherit packageId; }; - }; - # Refer your crate build derivation by name here. - # You can override the features with - # workspaceMembers."${crateName}".build.override { features = [ "default" "feature1" ... ]; }. - workspaceMembers = { - "rcgen" = rec { - packageId = "rcgen"; - build = internal.buildRustCrateWithFeatures { - packageId = "rcgen"; - }; - - # Debug support which might change between releases. - # File a bug if you depend on any for non-debug work! - debug = internal.debugCrate { inherit packageId; }; - }; - }; - - # A derivation that joins the outputs of all workspace members together. - allWorkspaceMembers = pkgs.symlinkJoin { - name = "all-workspace-members"; - paths = - let - members = builtins.attrValues workspaceMembers; - in - builtins.map (m: m.build) members; - }; - - # - # "internal" ("private") attributes that may change in every new version of crate2nix. - # - - internal = rec { - # Build and dependency information for crates. - # Many of the fields are passed one-to-one to buildRustCrate. - # - # Noteworthy: - # * `dependencies`/`buildDependencies`: similar to the corresponding fields for buildRustCrate. - # but with additional information which is used during dependency/feature resolution. - # * `resolvedDependencies`: the selected default features reported by cargo - only included for debugging. - # * `devDependencies` as of now not used by `buildRustCrate` but used to - # inject test dependencies into the build - - crates = { - "asn1-rs" = rec { - crateName = "asn1-rs"; - version = "0.3.1"; - edition = "2018"; - sha256 = "0czsk1nd4dx2k83f7jzkn8klx05wbmblkx1jh51i4c170akhbzrh"; - authors = [ - "Pierre Chifflier " - ]; - dependencies = [ - { - name = "asn1-rs-derive"; - packageId = "asn1-rs-derive"; - } - { - name = "asn1-rs-impl"; - packageId = "asn1-rs-impl"; - } - { - name = "displaydoc"; - packageId = "displaydoc"; - } - { - name = "nom"; - packageId = "nom"; - usesDefaultFeatures = false; - features = [ "std" ]; - } - { - name = "num-traits"; - packageId = "num-traits"; - } - { - name = "rusticata-macros"; - packageId = "rusticata-macros"; - } - { - name = "thiserror"; - packageId = "thiserror"; - } - { - name = "time"; - packageId = "time"; - optional = true; - features = [ - "macros" - "parsing" - "formatting" - ]; - } - ]; - features = { - "bigint" = [ "num-bigint" ]; - "bits" = [ "bitvec" ]; - "bitvec" = [ "dep:bitvec" ]; - "cookie-factory" = [ "dep:cookie-factory" ]; - "datetime" = [ "time" ]; - "default" = [ "std" ]; - "num-bigint" = [ "dep:num-bigint" ]; - "serialize" = [ "cookie-factory" ]; - "time" = [ "dep:time" ]; - }; - resolvedDefaultFeatures = [ - "datetime" - "default" - "std" - "time" - ]; - }; - "asn1-rs-derive" = rec { - crateName = "asn1-rs-derive"; - version = "0.1.0"; - edition = "2018"; - sha256 = "1gzf9vab06lk0zjvbr07axx64fndkng2s28bnj27fnwd548pb2yv"; - procMacro = true; - authors = [ - "Pierre Chifflier " - ]; - dependencies = [ - { - name = "proc-macro2"; - packageId = "proc-macro2"; - } - { - name = "quote"; - packageId = "quote"; - } - { - name = "syn"; - packageId = "syn"; - } - { - name = "synstructure"; - packageId = "synstructure"; - } - ]; - - }; - "asn1-rs-impl" = rec { - crateName = "asn1-rs-impl"; - version = "0.1.0"; - edition = "2018"; - sha256 = "1va27bn7qxqp4wanzjlkagnynv6jnrhnwmcky2ahzb1r405p6xr7"; - procMacro = true; - authors = [ - "Pierre Chifflier " - ]; - dependencies = [ - { - name = "proc-macro2"; - packageId = "proc-macro2"; - } - { - name = "quote"; - packageId = "quote"; - } - { - name = "syn"; - packageId = "syn"; - } - ]; - - }; - "autocfg 0.1.7" = rec { - crateName = "autocfg"; - version = "0.1.7"; - edition = "2015"; - sha256 = "1chwgimpx5z7xbag7krr9d8asxfqbh683qhgl9kn3hxk2l0djj8x"; - authors = [ - "Josh Stone " - ]; - - }; - "autocfg 1.0.1" = rec { - crateName = "autocfg"; - version = "1.0.1"; - edition = "2015"; - sha256 = "0jj6i9zn4gjl03kjvziqdji6rwx8ykz8zk2ngpc331z2g3fk3c6d"; - authors = [ - "Josh Stone " - ]; - - }; - "base64" = rec { - crateName = "base64"; - version = "0.13.0"; - edition = "2018"; - sha256 = "1z82g23mbzjgijkpcrilc7nljpxpvpf7zxf6iyiapkgka2ngwkch"; - authors = [ - "Alice Maz " - "Marshall Pierce " - ]; - features = { - "default" = [ "std" ]; - }; - resolvedDefaultFeatures = [ - "default" - "std" - ]; - }; - "base64ct" = rec { - crateName = "base64ct"; - version = "1.1.1"; - edition = "2018"; - sha256 = "0p4was874qc90q2chm2i14m9mn8zmxjis8vaxihd6a2x4aqxkd76"; - authors = [ - "RustCrypto Developers" - ]; - features = { - "std" = [ "alloc" ]; - }; - }; - "bitflags" = rec { - crateName = "bitflags"; - version = "1.3.2"; - edition = "2018"; - sha256 = "12ki6w8gn1ldq7yz9y680llwk5gmrhrzszaa17g1sbrw2r2qvwxy"; - authors = [ - "The Rust Project Developers" - ]; - features = { - "compiler_builtins" = [ "dep:compiler_builtins" ]; - "core" = [ "dep:core" ]; - "rustc-dep-of-std" = [ - "core" - "compiler_builtins" - ]; - }; - resolvedDefaultFeatures = [ "default" ]; - }; - "botan" = rec { - crateName = "botan"; - version = "0.8.1"; - edition = "2018"; - sha256 = "08bmiyn7c3b0dgx20w6hr28d9jcq7cj78cchr84pc686sb2s41ik"; - authors = [ - "Jack Lloyd " - ]; - dependencies = [ - { - name = "botan-sys"; - packageId = "botan-sys"; - } - { - name = "cty"; - packageId = "cty"; - } - ]; - features = { - "cstr_core" = [ "dep:cstr_core" ]; - "no-std" = [ "cstr_core/alloc" ]; - "vendored" = [ "botan-sys/vendored" ]; - }; - resolvedDefaultFeatures = [ - "default" - "vendored" - ]; - }; - "botan-src" = rec { - crateName = "botan-src"; - version = "0.21703.0"; - edition = "2018"; - sha256 = "0s2ad9q84qsrllfsbj7hjhn7gr3hab9ng6lwzwqmimia6yvja8y8"; - authors = [ - "Rodolphe Breard " - "Jack Lloyd " - ]; - - }; - "botan-sys" = rec { - crateName = "botan-sys"; - version = "0.8.1"; - edition = "2015"; - sha256 = "1m11zblxfanrhl97j7z3ap7n17rr8j0rg91sr7f9j6y2bsniaz1x"; - authors = [ - "Jack Lloyd " - ]; - dependencies = [ - { - name = "cty"; - packageId = "cty"; - } - ]; - buildDependencies = [ - { - name = "botan-src"; - packageId = "botan-src"; - optional = true; - } - ]; - features = { - "botan-src" = [ "dep:botan-src" ]; - "vendored" = [ "botan-src" ]; - }; - resolvedDefaultFeatures = [ - "botan-src" - "default" - "vendored" - ]; - }; - "bumpalo" = rec { - crateName = "bumpalo"; - version = "3.9.1"; - edition = "2018"; - sha256 = "1688dv6s0cbj72p9lmll8a02a85dzxvdw2is7pji490zmd35m954"; - authors = [ - "Nick Fitzgerald " - ]; - features = { - }; - resolvedDefaultFeatures = [ "default" ]; - }; - "byteorder" = rec { - crateName = "byteorder"; - version = "1.4.3"; - edition = "2018"; - sha256 = "0456lv9xi1a5bcm32arknf33ikv76p3fr9yzki4lb2897p2qkh8l"; - authors = [ - "Andrew Gallant " - ]; - features = { - "default" = [ "std" ]; - }; - }; - "cc" = rec { - crateName = "cc"; - version = "1.0.72"; - edition = "2018"; - crateBin = [ ]; - sha256 = "1vl50h2qh0nh0iddzj6gd1pnxnxpvwmbfxc30578c1pajmxi7a92"; - authors = [ - "Alex Crichton " - ]; - features = { - "jobserver" = [ "dep:jobserver" ]; - "parallel" = [ "jobserver" ]; - }; - }; - "cfg-if" = rec { - crateName = "cfg-if"; - version = "1.0.0"; - edition = "2018"; - sha256 = "1za0vb97n4brpzpv8lsbnzmq5r8f2b0cpqqr0sy8h5bn751xxwds"; - authors = [ - "Alex Crichton " - ]; - features = { - "compiler_builtins" = [ "dep:compiler_builtins" ]; - "core" = [ "dep:core" ]; - "rustc-dep-of-std" = [ - "core" - "compiler_builtins" - ]; - }; - }; - "const-oid" = rec { - crateName = "const-oid"; - version = "0.6.2"; - edition = "2018"; - sha256 = "12vv7csqqjj0x1l5mf51lgqiw76k5c3mb1yzfhfcqysks2j2lvwx"; - authors = [ - "RustCrypto Developers" - ]; - features = { - }; - }; - "crypto-bigint" = rec { - crateName = "crypto-bigint"; - version = "0.2.11"; - edition = "2018"; - sha256 = "00qckh65nzb7s7vd60wylw6alxf9g37xh31lirb1qw0l8fxx6fzq"; - authors = [ - "RustCrypto Developers" - ]; - dependencies = [ - { - name = "generic-array"; - packageId = "generic-array"; - optional = true; - } - { - name = "rand_core"; - packageId = "rand_core"; - optional = true; - } - { - name = "subtle"; - packageId = "subtle"; - usesDefaultFeatures = false; - } - ]; - features = { - "default" = [ "rand" ]; - "generic-array" = [ "dep:generic-array" ]; - "rand" = [ "rand_core" ]; - "rand_core" = [ "dep:rand_core" ]; - "rlp" = [ "dep:rlp" ]; - "zeroize" = [ "dep:zeroize" ]; - }; - resolvedDefaultFeatures = [ - "default" - "generic-array" - "rand" - "rand_core" - ]; - }; - "cty" = rec { - crateName = "cty"; - version = "0.2.2"; - edition = "2015"; - sha256 = "0d8z0pbr87wgzqqb2jk5pvj0afzc6d3rb772ach6fijhg6yglrdk"; - authors = [ - "Jorge Aparicio " - ]; - - }; - "data-encoding" = rec { - crateName = "data-encoding"; - version = "2.3.2"; - edition = "2018"; - sha256 = "0mvd8bjq5mq50fcf931cff57vwmbsvs1kpxynkzrshli98y3kqiy"; - authors = [ - "Julien Cretin " - ]; - features = { - "default" = [ "std" ]; - "std" = [ "alloc" ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "default" - "std" - ]; - }; - "der" = rec { - crateName = "der"; - version = "0.4.5"; - edition = "2018"; - sha256 = "1x4k0jln8va1657cghl40l6p7hyvr1ixz71v9cd6imwmgp51rdvr"; - authors = [ - "RustCrypto Developers" - ]; - dependencies = [ - { - name = "const-oid"; - packageId = "const-oid"; - optional = true; - } - { - name = "crypto-bigint"; - packageId = "crypto-bigint"; - optional = true; - features = [ "generic-array" ]; - } - ]; - features = { - "bigint" = [ "crypto-bigint" ]; - "const-oid" = [ "dep:const-oid" ]; - "crypto-bigint" = [ "dep:crypto-bigint" ]; - "der_derive" = [ "dep:der_derive" ]; - "derive" = [ "der_derive" ]; - "oid" = [ "const-oid" ]; - "std" = [ "alloc" ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "bigint" - "const-oid" - "crypto-bigint" - "oid" - "std" - ]; - }; - "der-parser" = rec { - crateName = "der-parser"; - version = "7.0.0"; - edition = "2018"; - sha256 = "10kfa2gzl3x20mwgrd43cyi79xgkqxyzcyrh0xylv4apa33qlfgy"; - authors = [ - "Pierre Chifflier " - ]; - dependencies = [ - { - name = "asn1-rs"; - packageId = "asn1-rs"; - } - { - name = "displaydoc"; - packageId = "displaydoc"; - usesDefaultFeatures = false; - } - { - name = "nom"; - packageId = "nom"; - } - { - name = "num-bigint"; - packageId = "num-bigint"; - optional = true; - } - { - name = "num-traits"; - packageId = "num-traits"; - } - { - name = "rusticata-macros"; - packageId = "rusticata-macros"; - } - ]; - features = { - "bigint" = [ "num-bigint" ]; - "cookie-factory" = [ "dep:cookie-factory" ]; - "default" = [ "std" ]; - "num-bigint" = [ "dep:num-bigint" ]; - "serialize" = [ - "std" - "cookie-factory" - ]; - }; - resolvedDefaultFeatures = [ - "bigint" - "default" - "num-bigint" - "std" - ]; - }; - "digest" = rec { - crateName = "digest"; - version = "0.9.0"; - edition = "2018"; - sha256 = "0rmhvk33rgvd6ll71z8sng91a52rw14p0drjn1da0mqa138n1pfk"; - authors = [ - "RustCrypto Developers" - ]; - dependencies = [ - { - name = "generic-array"; - packageId = "generic-array"; - } - ]; - features = { - "blobby" = [ "dep:blobby" ]; - "dev" = [ "blobby" ]; - "std" = [ "alloc" ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "std" - ]; - }; - "displaydoc" = rec { - crateName = "displaydoc"; - version = "0.2.3"; - edition = "2018"; - sha256 = "11i8p5snlc1hs4g5q3wiyr75dn276l6kr0si5m7xmfa6y31mvy9v"; - procMacro = true; - authors = [ - "Jane Lusby " - ]; - dependencies = [ - { - name = "proc-macro2"; - packageId = "proc-macro2"; - } - { - name = "quote"; - packageId = "quote"; - } - { - name = "syn"; - packageId = "syn"; - } - ]; - features = { - "default" = [ "std" ]; - }; - resolvedDefaultFeatures = [ - "default" - "std" - ]; - }; - "foreign-types" = rec { - crateName = "foreign-types"; - version = "0.3.2"; - edition = "2015"; - sha256 = "1cgk0vyd7r45cj769jym4a6s7vwshvd0z4bqrb92q1fwibmkkwzn"; - authors = [ - "Steven Fackler " - ]; - dependencies = [ - { - name = "foreign-types-shared"; - packageId = "foreign-types-shared"; - } - ]; - - }; - "foreign-types-shared" = rec { - crateName = "foreign-types-shared"; - version = "0.1.1"; - edition = "2015"; - sha256 = "0jxgzd04ra4imjv8jgkmdq59kj8fsz6w4zxsbmlai34h26225c00"; - authors = [ - "Steven Fackler " - ]; - - }; - "generic-array" = rec { - crateName = "generic-array"; - version = "0.14.5"; - edition = "2015"; - sha256 = "00qqhls43bzvyb7s26iw6knvsz3mckbxl3rhaahvypzhqwzd6j7x"; - libName = "generic_array"; - authors = [ - "Bartłomiej Kamiński " - "Aaron Trent " - ]; - dependencies = [ - { - name = "typenum"; - packageId = "typenum"; - } - ]; - buildDependencies = [ - { - name = "version_check"; - packageId = "version_check"; - } - ]; - features = { - "serde" = [ "dep:serde" ]; - }; - }; - "getrandom" = rec { - crateName = "getrandom"; - version = "0.2.4"; - edition = "2018"; - sha256 = "0k0bdr1dyf4n9fvnkx4fmwxhv4hgnyf55gj86v4m69fln743g3a1"; - authors = [ - "The Rand Project Developers" - ]; - dependencies = [ - { - name = "cfg-if"; - packageId = "cfg-if"; - } - { - name = "libc"; - packageId = "libc"; - usesDefaultFeatures = false; - target = { target, features }: (target."unix" or false); - } - { - name = "wasi"; - packageId = "wasi"; - target = { target, features }: (target."os" == "wasi"); - } - ]; - features = { - "compiler_builtins" = [ "dep:compiler_builtins" ]; - "core" = [ "dep:core" ]; - "js" = [ - "wasm-bindgen" - "js-sys" - ]; - "js-sys" = [ "dep:js-sys" ]; - "rustc-dep-of-std" = [ - "compiler_builtins" - "core" - "libc/rustc-dep-of-std" - "wasi/rustc-dep-of-std" - ]; - "wasm-bindgen" = [ "dep:wasm-bindgen" ]; - }; - resolvedDefaultFeatures = [ "std" ]; - }; - "itoa" = rec { - crateName = "itoa"; - version = "1.0.1"; - edition = "2018"; - sha256 = "0d8wr2qf5b25a04xf10rz9r0pdbjdgb0zaw3xvf8k2sqcz1qzaqs"; - authors = [ - "David Tolnay " - ]; - - }; - "js-sys" = rec { - crateName = "js-sys"; - version = "0.3.56"; - edition = "2018"; - sha256 = "010g8jkj5avy3xd77i3cprjzzpfa6z9z2ay0fkllqmpx617c53x3"; - authors = [ - "The wasm-bindgen Developers" - ]; - dependencies = [ - { - name = "wasm-bindgen"; - packageId = "wasm-bindgen"; - } - ]; - - }; - "lazy_static" = rec { - crateName = "lazy_static"; - version = "1.4.0"; - edition = "2015"; - sha256 = "0in6ikhw8mgl33wjv6q6xfrb5b9jr16q8ygjy803fay4zcisvaz2"; - authors = [ - "Marvin Löbel " - ]; - dependencies = [ - { - name = "spin"; - packageId = "spin"; - optional = true; - } - ]; - features = { - "spin" = [ "dep:spin" ]; - "spin_no_std" = [ "spin" ]; - }; - resolvedDefaultFeatures = [ - "spin" - "spin_no_std" - ]; - }; - "libc" = rec { - crateName = "libc"; - version = "0.2.116"; - edition = "2015"; - sha256 = "0x6sk17kv2fdsqxlm23bz9x1y79w90k7ylkflk44rgidhy4bspan"; - authors = [ - "The Rust Project Developers" - ]; - features = { - "default" = [ "std" ]; - "rustc-dep-of-std" = [ - "align" - "rustc-std-workspace-core" - ]; - "rustc-std-workspace-core" = [ "dep:rustc-std-workspace-core" ]; - "use_std" = [ "std" ]; - }; - resolvedDefaultFeatures = [ - "default" - "std" - ]; - }; - "libm" = rec { - crateName = "libm"; - version = "0.2.1"; - edition = "2018"; - sha256 = "0akh56sh51adhagmk9l84dyrlz60gv8ri05xhr13i1b18czkpmy7"; - authors = [ - "Jorge Aparicio " - ]; - features = { - "musl-reference-tests" = [ "rand" ]; - "rand" = [ "dep:rand" ]; - }; - resolvedDefaultFeatures = [ "default" ]; - }; - "log" = rec { - crateName = "log"; - version = "0.4.14"; - edition = "2015"; - sha256 = "04175hv0v62shd82qydq58a48k3bjijmk54v38zgqlbxqkkbpfai"; - authors = [ - "The Rust Project Developers" - ]; - dependencies = [ - { - name = "cfg-if"; - packageId = "cfg-if"; - } - ]; - features = { - "kv_unstable" = [ "value-bag" ]; - "kv_unstable_serde" = [ - "kv_unstable_std" - "value-bag/serde" - "serde" - ]; - "kv_unstable_std" = [ - "std" - "kv_unstable" - "value-bag/error" - ]; - "kv_unstable_sval" = [ - "kv_unstable" - "value-bag/sval" - "sval" - ]; - "serde" = [ "dep:serde" ]; - "sval" = [ "dep:sval" ]; - "value-bag" = [ "dep:value-bag" ]; - }; - }; - "memchr" = rec { - crateName = "memchr"; - version = "2.4.1"; - edition = "2018"; - sha256 = "0smq8xzd40njqpfzv5mghigj91fzlfrfg842iz8x0wqvw2dw731h"; - authors = [ - "Andrew Gallant " - "bluss" - ]; - features = { - "compiler_builtins" = [ "dep:compiler_builtins" ]; - "core" = [ "dep:core" ]; - "default" = [ "std" ]; - "libc" = [ "dep:libc" ]; - "rustc-dep-of-std" = [ - "core" - "compiler_builtins" - ]; - "use_std" = [ "std" ]; - }; - resolvedDefaultFeatures = [ "std" ]; - }; - "minimal-lexical" = rec { - crateName = "minimal-lexical"; - version = "0.2.1"; - edition = "2018"; - sha256 = "16ppc5g84aijpri4jzv14rvcnslvlpphbszc7zzp6vfkddf4qdb8"; - authors = [ - "Alex Huszagh " - ]; - features = { - "default" = [ "std" ]; - }; - resolvedDefaultFeatures = [ "std" ]; - }; - "nom" = rec { - crateName = "nom"; - version = "7.1.0"; - edition = "2018"; - sha256 = "0281jdx0xcyhjgs1jkj9pii8py1clcpazg41bgz7d71qxzhi278v"; - authors = [ - "contact@geoffroycouprie.com" - ]; - dependencies = [ - { - name = "memchr"; - packageId = "memchr"; - usesDefaultFeatures = false; - } - { - name = "minimal-lexical"; - packageId = "minimal-lexical"; - usesDefaultFeatures = false; - } - ]; - buildDependencies = [ - { - name = "version_check"; - packageId = "version_check"; - } - ]; - features = { - "default" = [ "std" ]; - "std" = [ - "alloc" - "memchr/std" - "minimal-lexical/std" - ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "default" - "std" - ]; - }; - "num-bigint" = rec { - crateName = "num-bigint"; - version = "0.4.3"; - edition = "2018"; - sha256 = "0py73wsa5j4izhd39nkqzqv260r0ma08vy30ky54ld3vkhlbcfpr"; - authors = [ - "The Rust Project Developers" - ]; - dependencies = [ - { - name = "num-integer"; - packageId = "num-integer"; - usesDefaultFeatures = false; - features = [ "i128" ]; - } - { - name = "num-traits"; - packageId = "num-traits"; - usesDefaultFeatures = false; - features = [ "i128" ]; - } - ]; - buildDependencies = [ - { - name = "autocfg"; - packageId = "autocfg 1.0.1"; - } - ]; - features = { - "arbitrary" = [ "dep:arbitrary" ]; - "default" = [ "std" ]; - "quickcheck" = [ "dep:quickcheck" ]; - "rand" = [ "dep:rand" ]; - "serde" = [ "dep:serde" ]; - "std" = [ - "num-integer/std" - "num-traits/std" - ]; - }; - resolvedDefaultFeatures = [ - "default" - "std" - ]; - }; - "num-bigint-dig" = rec { - crateName = "num-bigint-dig"; - version = "0.7.0"; - edition = "2015"; - sha256 = "1004mmipvc7pvaf3kf13i1nqh3vxf789bj72d8wl51y185aywis5"; - authors = [ - "dignifiedquire " - "The Rust Project Developers" - ]; - dependencies = [ - { - name = "byteorder"; - packageId = "byteorder"; - usesDefaultFeatures = false; - } - { - name = "lazy_static"; - packageId = "lazy_static"; - usesDefaultFeatures = false; - features = [ "spin_no_std" ]; - } - { - name = "libm"; - packageId = "libm"; - } - { - name = "num-integer"; - packageId = "num-integer"; - usesDefaultFeatures = false; - } - { - name = "num-iter"; - packageId = "num-iter"; - usesDefaultFeatures = false; - } - { - name = "num-traits"; - packageId = "num-traits"; - usesDefaultFeatures = false; - } - { - name = "rand"; - packageId = "rand"; - optional = true; - usesDefaultFeatures = false; - } - { - name = "smallvec"; - packageId = "smallvec"; - usesDefaultFeatures = false; - } - { - name = "zeroize"; - packageId = "zeroize"; - optional = true; - usesDefaultFeatures = false; - features = [ "zeroize_derive" ]; - } - ]; - buildDependencies = [ - { - name = "autocfg"; - packageId = "autocfg 0.1.7"; - } - ]; - devDependencies = [ - { - name = "rand"; - packageId = "rand"; - features = [ "small_rng" ]; - } - ]; - features = { - "default" = [ - "std" - "i128" - "u64_digit" - ]; - "i128" = [ - "num-integer/i128" - "num-traits/i128" - ]; - "prime" = [ "rand/std_rng" ]; - "rand" = [ "dep:rand" ]; - "serde" = [ "dep:serde" ]; - "std" = [ - "num-integer/std" - "num-traits/std" - "smallvec/write" - "rand/std" - "serde/std" - ]; - "zeroize" = [ "dep:zeroize" ]; - }; - resolvedDefaultFeatures = [ - "i128" - "prime" - "rand" - "u64_digit" - "zeroize" - ]; - }; - "num-integer" = rec { - crateName = "num-integer"; - version = "0.1.44"; - edition = "2015"; - sha256 = "1nq152y3304as1iai95hqz8prqnc94lks1s7q05sfjdmcf56kk6j"; - authors = [ - "The Rust Project Developers" - ]; - dependencies = [ - { - name = "num-traits"; - packageId = "num-traits"; - usesDefaultFeatures = false; - } - ]; - buildDependencies = [ - { - name = "autocfg"; - packageId = "autocfg 1.0.1"; - } - ]; - features = { - "default" = [ "std" ]; - "i128" = [ "num-traits/i128" ]; - "std" = [ "num-traits/std" ]; - }; - resolvedDefaultFeatures = [ - "i128" - "std" - ]; - }; - "num-iter" = rec { - crateName = "num-iter"; - version = "0.1.42"; - edition = "2015"; - sha256 = "0ndd9wb9qar50fdr16xm3i1zk6h2g9br56nml2n22kd56y1iq0mj"; - authors = [ - "The Rust Project Developers" - ]; - dependencies = [ - { - name = "num-integer"; - packageId = "num-integer"; - usesDefaultFeatures = false; - } - { - name = "num-traits"; - packageId = "num-traits"; - usesDefaultFeatures = false; - } - ]; - buildDependencies = [ - { - name = "autocfg"; - packageId = "autocfg 1.0.1"; - } - ]; - features = { - "default" = [ "std" ]; - "i128" = [ - "num-integer/i128" - "num-traits/i128" - ]; - "std" = [ - "num-integer/std" - "num-traits/std" - ]; - }; - }; - "num-traits" = rec { - crateName = "num-traits"; - version = "0.2.14"; - edition = "2015"; - sha256 = "144j176s2p76azy2ngk2vkdzgwdc0bc8c93jhki8c9fsbknb2r4s"; - authors = [ - "The Rust Project Developers" - ]; - dependencies = [ - { - name = "libm"; - packageId = "libm"; - optional = true; - } - ]; - buildDependencies = [ - { - name = "autocfg"; - packageId = "autocfg 1.0.1"; - } - ]; - features = { - "default" = [ "std" ]; - "libm" = [ "dep:libm" ]; - }; - resolvedDefaultFeatures = [ - "default" - "i128" - "libm" - "std" - ]; - }; - "num_threads" = rec { - crateName = "num_threads"; - version = "0.1.3"; - edition = "2015"; - sha256 = "05gvsnv4k6d69iksz47i7fq1r61dj1k1nh4i8xrw7qlkcfx9kflp"; - authors = [ - "Jacob Pratt " - ]; - dependencies = [ - { - name = "libc"; - packageId = "libc"; - target = { target, features }: ((target."os" == "macos") || (target."os" == "freebsd")); - } - ]; - - }; - "oid-registry" = rec { - crateName = "oid-registry"; - version = "0.4.0"; - edition = "2018"; - sha256 = "0akbah3j8231ayrp2l1y5d9zmvbvqcsj0sa6s6dz6h85z8bhgqiq"; - authors = [ - "Pierre Chifflier " - ]; - dependencies = [ - { - name = "asn1-rs"; - packageId = "asn1-rs"; - } - ]; - features = { - "crypto" = [ - "kdf" - "pkcs1" - "pkcs7" - "pkcs9" - "pkcs12" - "nist_algs" - "x962" - ]; - "default" = [ "registry" ]; - }; - resolvedDefaultFeatures = [ - "crypto" - "default" - "kdf" - "nist_algs" - "pkcs1" - "pkcs12" - "pkcs7" - "pkcs9" - "registry" - "x509" - "x962" - ]; - }; - "once_cell" = rec { - crateName = "once_cell"; - version = "1.9.0"; - edition = "2018"; - sha256 = "1mfqhrsgi368x92bwnq3vi3p5nv0n1qlrn69gfflhvkfkxfm2cns"; - authors = [ - "Aleksey Kladov " - ]; - features = { - "alloc" = [ "race" ]; - "atomic-polyfill" = [ "dep:atomic-polyfill" ]; - "default" = [ "std" ]; - "parking_lot" = [ "dep:parking_lot" ]; - "std" = [ "alloc" ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "default" - "race" - "std" - ]; - }; - "openssl" = rec { - crateName = "openssl"; - version = "0.10.38"; - edition = "2018"; - sha256 = "15baqlphisr1f7ddq11jnrrzz4shdh35kwal24adyc2c4cif4yhc"; - authors = [ - "Steven Fackler " - ]; - dependencies = [ - { - name = "bitflags"; - packageId = "bitflags"; - } - { - name = "cfg-if"; - packageId = "cfg-if"; - } - { - name = "foreign-types"; - packageId = "foreign-types"; - } - { - name = "libc"; - packageId = "libc"; - } - { - name = "once_cell"; - packageId = "once_cell"; - } - { - name = "openssl-sys"; - packageId = "openssl-sys"; - rename = "ffi"; - } - ]; - features = { - "vendored" = [ "ffi/vendored" ]; - }; - }; - "openssl-sys" = rec { - crateName = "openssl-sys"; - version = "0.9.72"; - edition = "2015"; - sha256 = "1jq3qbcvf16qn71yasdzw54b14n8nz98vr52l1gp60in72f10iky"; - build = "build/main.rs"; - authors = [ - "Alex Crichton " - "Steven Fackler " - ]; - dependencies = [ - { - name = "libc"; - packageId = "libc"; - } - ]; - buildDependencies = [ - { - name = "autocfg"; - packageId = "autocfg 1.0.1"; - } - { - name = "cc"; - packageId = "cc"; - } - { - name = "pkg-config"; - packageId = "pkg-config"; - } - { - name = "vcpkg"; - packageId = "vcpkg"; - target = { target, features }: (target."env" == "msvc"); - } - ]; - features = { - "openssl-src" = [ "dep:openssl-src" ]; - "vendored" = [ "openssl-src" ]; - }; - }; - "pem" = rec { - crateName = "pem"; - version = "1.0.2"; - edition = "2018"; - sha256 = "0iqrvfnm71x9pvff39d5ajwn3gc9glxlv4d4h22max7342db18z9"; - authors = [ - "Jonathan Creekmore " - ]; - dependencies = [ - { - name = "base64"; - packageId = "base64"; - } - ]; - - }; - "pem-rfc7468" = rec { - crateName = "pem-rfc7468"; - version = "0.2.4"; - edition = "2018"; - sha256 = "1m1c9jypydzabg4yscplmvff7pdcc8gg4cqg081hnlf03hxkmsc4"; - authors = [ - "RustCrypto Developers" - ]; - dependencies = [ - { - name = "base64ct"; - packageId = "base64ct"; - } - ]; - features = { - "std" = [ "alloc" ]; - }; - resolvedDefaultFeatures = [ "alloc" ]; - }; - "pkcs1" = rec { - crateName = "pkcs1"; - version = "0.2.4"; - edition = "2018"; - sha256 = "0b2f1a0lf5h53zrjvcqbxzjhh89gcfa1myhf6z7w10ypg61fwsqi"; - authors = [ - "RustCrypto Developers" - ]; - dependencies = [ - { - name = "der"; - packageId = "der"; - features = [ - "bigint" - "oid" - ]; - } - { - name = "pem-rfc7468"; - packageId = "pem-rfc7468"; - optional = true; - } - { - name = "zeroize"; - packageId = "zeroize"; - optional = true; - usesDefaultFeatures = false; - features = [ "alloc" ]; - } - ]; - features = { - "alloc" = [ - "der/alloc" - "zeroize" - ]; - "pem" = [ - "alloc" - "pem-rfc7468/alloc" - ]; - "pem-rfc7468" = [ "dep:pem-rfc7468" ]; - "zeroize" = [ "dep:zeroize" ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "pem" - "pem-rfc7468" - "std" - "zeroize" - ]; - }; - "pkcs8" = rec { - crateName = "pkcs8"; - version = "0.7.6"; - edition = "2018"; - sha256 = "0iq46p6fa2b8xy6pj52zpmdy8ya3fg31dj4rc19x1fi69nvgjgpf"; - authors = [ - "RustCrypto Developers" - ]; - dependencies = [ - { - name = "der"; - packageId = "der"; - features = [ "oid" ]; - } - { - name = "pem-rfc7468"; - packageId = "pem-rfc7468"; - optional = true; - } - { - name = "pkcs1"; - packageId = "pkcs1"; - optional = true; - features = [ "alloc" ]; - } - { - name = "spki"; - packageId = "spki"; - } - { - name = "zeroize"; - packageId = "zeroize"; - optional = true; - usesDefaultFeatures = false; - features = [ "alloc" ]; - } - ]; - features = { - "3des" = [ - "encryption" - "pkcs5/3des" - ]; - "alloc" = [ - "der/alloc" - "zeroize" - ]; - "des-insecure" = [ - "encryption" - "pkcs5/des-insecure" - ]; - "encryption" = [ - "alloc" - "pkcs5/alloc" - "pkcs5/pbes2" - "rand_core" - ]; - "pem" = [ - "alloc" - "pem-rfc7468/alloc" - ]; - "pem-rfc7468" = [ "dep:pem-rfc7468" ]; - "pkcs1" = [ "dep:pkcs1" ]; - "pkcs5" = [ "dep:pkcs5" ]; - "rand_core" = [ "dep:rand_core" ]; - "sha1" = [ - "encryption" - "pkcs5/sha1" - ]; - "std" = [ - "alloc" - "der/std" - ]; - "zeroize" = [ "dep:zeroize" ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "pem" - "pem-rfc7468" - "pkcs1" - "std" - "zeroize" - ]; - }; - "pkg-config" = rec { - crateName = "pkg-config"; - version = "0.3.24"; - edition = "2015"; - sha256 = "1ghcyjp5537r7qigmgl3dj62j01arlpddaq93a3i414v3iskz2aq"; - authors = [ - "Alex Crichton " - ]; - - }; - "ppv-lite86" = rec { - crateName = "ppv-lite86"; - version = "0.2.16"; - edition = "2018"; - sha256 = "0wkqwnvnfcgqlrahphl45vdlgi2f1bs7nqcsalsllp1y4dp9x7zb"; - authors = [ - "The CryptoCorrosion Contributors" - ]; - features = { - "default" = [ "std" ]; - }; - resolvedDefaultFeatures = [ - "simd" - "std" - ]; - }; - "proc-macro2" = rec { - crateName = "proc-macro2"; - version = "1.0.36"; - edition = "2018"; - sha256 = "0adh6gvs31x6pfwmygypmzrv1jc7kjq568vsqcfaxk7vhdc2sd67"; - authors = [ - "David Tolnay " - "Alex Crichton " - ]; - dependencies = [ - { - name = "unicode-xid"; - packageId = "unicode-xid"; - } - ]; - features = { - "default" = [ "proc-macro" ]; - }; - resolvedDefaultFeatures = [ - "default" - "proc-macro" - ]; - }; - "quote" = rec { - crateName = "quote"; - version = "1.0.15"; - edition = "2018"; - sha256 = "0id1q0875pvhkg0mlb5z8gzdm2g2rbbz76bfzhv331lrm2b3wkc6"; - authors = [ - "David Tolnay " - ]; - dependencies = [ - { - name = "proc-macro2"; - packageId = "proc-macro2"; - usesDefaultFeatures = false; - } - ]; - features = { - "default" = [ "proc-macro" ]; - "proc-macro" = [ "proc-macro2/proc-macro" ]; - }; - resolvedDefaultFeatures = [ - "default" - "proc-macro" - ]; - }; - "rand" = rec { - crateName = "rand"; - version = "0.8.4"; - edition = "2018"; - sha256 = "1n5wska2fbfj4dsfz8mc0pd0dgjlrb6c9anpk5mwym345rip6x9f"; - authors = [ - "The Rand Project Developers" - "The Rust Project Developers" - ]; - dependencies = [ - { - name = "libc"; - packageId = "libc"; - optional = true; - usesDefaultFeatures = false; - target = { target, features }: (target."unix" or false); - } - { - name = "rand_chacha"; - packageId = "rand_chacha"; - optional = true; - usesDefaultFeatures = false; - target = { target, features }: (!(target."os" == "emscripten")); - } - { - name = "rand_core"; - packageId = "rand_core"; - } - { - name = "rand_hc"; - packageId = "rand_hc"; - optional = true; - target = { target, features }: (target."os" == "emscripten"); - } - ]; - devDependencies = [ - { - name = "rand_hc"; - packageId = "rand_hc"; - } - ]; - features = { - "alloc" = [ "rand_core/alloc" ]; - "default" = [ - "std" - "std_rng" - ]; - "getrandom" = [ "rand_core/getrandom" ]; - "libc" = [ "dep:libc" ]; - "log" = [ "dep:log" ]; - "packed_simd" = [ "dep:packed_simd" ]; - "rand_chacha" = [ "dep:rand_chacha" ]; - "rand_hc" = [ "dep:rand_hc" ]; - "serde" = [ "dep:serde" ]; - "serde1" = [ - "serde" - "rand_core/serde1" - ]; - "simd_support" = [ "packed_simd" ]; - "std" = [ - "rand_core/std" - "rand_chacha/std" - "alloc" - "getrandom" - "libc" - ]; - "std_rng" = [ - "rand_chacha" - "rand_hc" - ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "default" - "getrandom" - "libc" - "rand_chacha" - "rand_hc" - "std" - "std_rng" - ]; - }; - "rand_chacha" = rec { - crateName = "rand_chacha"; - version = "0.3.1"; - edition = "2018"; - sha256 = "123x2adin558xbhvqb8w4f6syjsdkmqff8cxwhmjacpsl1ihmhg6"; - authors = [ - "The Rand Project Developers" - "The Rust Project Developers" - "The CryptoCorrosion Contributors" - ]; - dependencies = [ - { - name = "ppv-lite86"; - packageId = "ppv-lite86"; - usesDefaultFeatures = false; - features = [ "simd" ]; - } - { - name = "rand_core"; - packageId = "rand_core"; - } - ]; - features = { - "default" = [ "std" ]; - "serde" = [ "dep:serde" ]; - "serde1" = [ "serde" ]; - "std" = [ "ppv-lite86/std" ]; - }; - resolvedDefaultFeatures = [ "std" ]; - }; - "rand_core" = rec { - crateName = "rand_core"; - version = "0.6.3"; - edition = "2018"; - sha256 = "1rxlxc3bpzgwphcg9c9yasvv9idipcg2z2y4j0vlb52jyl418kyk"; - authors = [ - "The Rand Project Developers" - "The Rust Project Developers" - ]; - dependencies = [ - { - name = "getrandom"; - packageId = "getrandom"; - optional = true; - } - ]; - features = { - "getrandom" = [ "dep:getrandom" ]; - "serde" = [ "dep:serde" ]; - "serde1" = [ "serde" ]; - "std" = [ - "alloc" - "getrandom" - "getrandom/std" - ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "getrandom" - "std" - ]; - }; - "rand_hc" = rec { - crateName = "rand_hc"; - version = "0.3.1"; - edition = "2018"; - sha256 = "1rwpykyvhkxs4jvqdja3mzp9dqaqamzn113cxaigs9z2dmcry7nm"; - authors = [ - "The Rand Project Developers" - ]; - dependencies = [ - { - name = "rand_core"; - packageId = "rand_core"; - } - ]; - - }; - "rcgen" = rec { - crateName = "rcgen"; - version = "0.9.2"; - edition = "2018"; - crateBin = [ - { - name = "rcgen"; - path = "src/main.rs"; - } - ]; - sha256 = "0ppwfl9g504x2qwk7m7mag8c3l70w9mcfha93013nlzqdlw2vynp"; - authors = [ - "est31 " - ]; - dependencies = [ - { - name = "pem"; - packageId = "pem"; - optional = true; - } - { - name = "ring"; - packageId = "ring"; - } - { - name = "time"; - packageId = "time"; - usesDefaultFeatures = false; - } - { - name = "x509-parser"; - packageId = "x509-parser"; - optional = true; - features = [ "verify" ]; - } - { - name = "yasna"; - packageId = "yasna"; - features = [ - "time" - "std" - ]; - } - { - name = "zeroize"; - packageId = "zeroize"; - optional = true; - } - ]; - devDependencies = [ - { - name = "botan"; - packageId = "botan"; - features = [ "vendored" ]; - } - { - name = "openssl"; - packageId = "openssl"; - } - { - name = "rand"; - packageId = "rand"; - } - { - name = "rsa"; - packageId = "rsa"; - } - { - name = "webpki"; - packageId = "webpki"; - features = [ "std" ]; - } - { - name = "x509-parser"; - packageId = "x509-parser"; - features = [ "verify" ]; - } - ]; - features = { - "default" = [ "pem" ]; - "pem" = [ "dep:pem" ]; - "x509-parser" = [ "dep:x509-parser" ]; - "zeroize" = [ "dep:zeroize" ]; - }; - resolvedDefaultFeatures = [ - "default" - "pem" - "x509-parser" - "zeroize" - ]; - }; - "ring" = rec { - crateName = "ring"; - version = "0.16.20"; - edition = "2018"; - sha256 = "1z682xp7v38ayq9g9nkbhhfpj6ygralmlx7wdmsfv8rnw99cylrh"; - authors = [ - "Brian Smith " - ]; - dependencies = [ - { - name = "libc"; - packageId = "libc"; - usesDefaultFeatures = false; - target = { target, features }: ((target."os" == "android") || (target."os" == "linux")); - } - { - name = "once_cell"; - packageId = "once_cell"; - optional = true; - usesDefaultFeatures = false; - target = { target, features }: ((target."os" == "android") || (target."os" == "linux")); - features = [ "std" ]; - } - { - name = "once_cell"; - packageId = "once_cell"; - usesDefaultFeatures = false; - target = - { target, features }: - ( - (target."os" == "dragonfly") - || (target."os" == "freebsd") - || (target."os" == "illumos") - || (target."os" == "netbsd") - || (target."os" == "openbsd") - || (target."os" == "solaris") - ); - features = [ "std" ]; - } - { - name = "spin"; - packageId = "spin"; - usesDefaultFeatures = false; - target = - { target, features }: - ( - (target."arch" == "x86") - || (target."arch" == "x86_64") - || ( - ((target."arch" == "aarch64") || (target."arch" == "arm")) - && ((target."os" == "android") || (target."os" == "fuchsia") || (target."os" == "linux")) - ) - ); - } - { - name = "untrusted"; - packageId = "untrusted"; - } - { - name = "web-sys"; - packageId = "web-sys"; - usesDefaultFeatures = false; - target = - { target, features }: - ( - (target."arch" == "wasm32") - && (target."vendor" == "unknown") - && (target."os" == "unknown") - && (target."env" == "") - ); - features = [ - "Crypto" - "Window" - ]; - } - { - name = "winapi"; - packageId = "winapi"; - usesDefaultFeatures = false; - target = { target, features }: (target."os" == "windows"); - features = [ - "ntsecapi" - "wtypesbase" - ]; - } - ]; - buildDependencies = [ - { - name = "cc"; - packageId = "cc"; - usesDefaultFeatures = false; - } - ]; - devDependencies = [ - { - name = "libc"; - packageId = "libc"; - usesDefaultFeatures = false; - target = { target, features }: ((target."unix" or false) || (target."windows" or false)); - } - ]; - features = { - "default" = [ - "alloc" - "dev_urandom_fallback" - ]; - "dev_urandom_fallback" = [ "once_cell" ]; - "once_cell" = [ "dep:once_cell" ]; - "std" = [ "alloc" ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "default" - "dev_urandom_fallback" - "once_cell" - ]; - }; - "rsa" = rec { - crateName = "rsa"; - version = "0.5.0"; - edition = "2018"; - sha256 = "039676a4mj0875phdi7vc0bd37hv84dh0dql6fmk8dl2w81jcp70"; - authors = [ - "RustCrypto Developers" - "dignifiedquire " - ]; - dependencies = [ - { - name = "byteorder"; - packageId = "byteorder"; - usesDefaultFeatures = false; - } - { - name = "digest"; - packageId = "digest"; - usesDefaultFeatures = false; - } - { - name = "lazy_static"; - packageId = "lazy_static"; - features = [ "spin_no_std" ]; - } - { - name = "num-bigint-dig"; - packageId = "num-bigint-dig"; - rename = "num-bigint"; - usesDefaultFeatures = false; - features = [ - "i128" - "u64_digit" - "prime" - "zeroize" - ]; - } - { - name = "num-integer"; - packageId = "num-integer"; - usesDefaultFeatures = false; - } - { - name = "num-iter"; - packageId = "num-iter"; - usesDefaultFeatures = false; - } - { - name = "num-traits"; - packageId = "num-traits"; - usesDefaultFeatures = false; - features = [ "libm" ]; - } - { - name = "pkcs1"; - packageId = "pkcs1"; - usesDefaultFeatures = false; - } - { - name = "pkcs8"; - packageId = "pkcs8"; - usesDefaultFeatures = false; - } - { - name = "rand"; - packageId = "rand"; - usesDefaultFeatures = false; - features = [ "std_rng" ]; - } - { - name = "subtle"; - packageId = "subtle"; - usesDefaultFeatures = false; - } - { - name = "zeroize"; - packageId = "zeroize"; - features = [ - "alloc" - "zeroize_derive" - ]; - } - ]; - features = { - "alloc" = [ - "digest/alloc" - "pkcs1/alloc" - "pkcs8/alloc" - "pkcs8/pkcs1" - ]; - "default" = [ - "std" - "pem" - ]; - "nightly" = [ - "subtle/nightly" - "num-bigint/nightly" - ]; - "pem" = [ - "alloc" - "pkcs1/pem" - "pkcs8/pem" - ]; - "pkcs5" = [ "pkcs8/encryption" ]; - "serde" = [ - "num-bigint/serde" - "serde_crate" - ]; - "serde_crate" = [ "dep:serde_crate" ]; - "std" = [ - "alloc" - "digest/std" - "pkcs1/std" - "pkcs8/std" - "rand/std" - ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "default" - "pem" - "std" - ]; - }; - "rusticata-macros" = rec { - crateName = "rusticata-macros"; - version = "4.0.0"; - edition = "2018"; - sha256 = "03dmfxhgwzpm1360iwcpcg3y18ddgya0i0hc599am212pdvj7ib5"; - authors = [ - "Pierre Chifflier " - ]; - dependencies = [ - { - name = "nom"; - packageId = "nom"; - usesDefaultFeatures = false; - features = [ "std" ]; - } - ]; - - }; - "smallvec" = rec { - crateName = "smallvec"; - version = "1.8.0"; - edition = "2018"; - sha256 = "10zf4fn63p2d6sx8qap3jvyarcfw563308x3431hd4c34r35gpgj"; - authors = [ - "The Servo Project Developers" - ]; - features = { - "arbitrary" = [ "dep:arbitrary" ]; - "const_new" = [ "const_generics" ]; - "serde" = [ "dep:serde" ]; - }; - }; - "spin" = rec { - crateName = "spin"; - version = "0.5.2"; - edition = "2015"; - sha256 = "0b84m6dbzrwf2kxylnw82d3dr8w06av7rfkr8s85fb5f43rwyqvf"; - authors = [ - "Mathijs van de Nes " - "John Ericson " - ]; - - }; - "spki" = rec { - crateName = "spki"; - version = "0.4.1"; - edition = "2018"; - sha256 = "0ckgkcg6db5y94dqhmyikgn8yrsah6pyf4j197hv1c51bp0s00aw"; - authors = [ - "RustCrypto Developers" - ]; - dependencies = [ - { - name = "der"; - packageId = "der"; - features = [ "oid" ]; - } - ]; - features = { - "std" = [ "der/std" ]; - }; - }; - "subtle" = rec { - crateName = "subtle"; - version = "2.4.1"; - edition = "2015"; - sha256 = "00b6jzh9gzb0h9n25g06nqr90z3xzqppfhhb260s1hjhh4pg7pkb"; - authors = [ - "Isis Lovecruft " - "Henry de Valence " - ]; - features = { - "default" = [ - "std" - "i128" - ]; - }; - }; - "syn" = rec { - crateName = "syn"; - version = "1.0.86"; - edition = "2018"; - sha256 = "0sqwa4nqxzm89nj8xd8sk4iz0hbrw3mb17b6hyc2w2d0zzsb6rca"; - authors = [ - "David Tolnay " - ]; - dependencies = [ - { - name = "proc-macro2"; - packageId = "proc-macro2"; - usesDefaultFeatures = false; - } - { - name = "quote"; - packageId = "quote"; - optional = true; - usesDefaultFeatures = false; - } - { - name = "unicode-xid"; - packageId = "unicode-xid"; - } - ]; - features = { - "default" = [ - "derive" - "parsing" - "printing" - "clone-impls" - "proc-macro" - ]; - "printing" = [ "quote" ]; - "proc-macro" = [ - "proc-macro2/proc-macro" - "quote/proc-macro" - ]; - "quote" = [ "dep:quote" ]; - "test" = [ "syn-test-suite/all-features" ]; - }; - resolvedDefaultFeatures = [ - "clone-impls" - "default" - "derive" - "extra-traits" - "full" - "parsing" - "printing" - "proc-macro" - "quote" - "visit" - ]; - }; - "synstructure" = rec { - crateName = "synstructure"; - version = "0.12.6"; - edition = "2018"; - sha256 = "03r1lydbf3japnlpc4wka7y90pmz1i0danaj3f9a7b431akdlszk"; - authors = [ - "Nika Layzell " - ]; - dependencies = [ - { - name = "proc-macro2"; - packageId = "proc-macro2"; - usesDefaultFeatures = false; - } - { - name = "quote"; - packageId = "quote"; - usesDefaultFeatures = false; - } - { - name = "syn"; - packageId = "syn"; - usesDefaultFeatures = false; - features = [ - "derive" - "parsing" - "printing" - "clone-impls" - "visit" - "extra-traits" - ]; - } - { - name = "unicode-xid"; - packageId = "unicode-xid"; - } - ]; - features = { - "default" = [ "proc-macro" ]; - "proc-macro" = [ - "proc-macro2/proc-macro" - "syn/proc-macro" - "quote/proc-macro" - ]; - }; - resolvedDefaultFeatures = [ - "default" - "proc-macro" - ]; - }; - "thiserror" = rec { - crateName = "thiserror"; - version = "1.0.30"; - edition = "2018"; - sha256 = "05y4wm29ck8flwq5k1q6nhwh00a3b30cz3xr0qvnbwad5vjsnjw5"; - authors = [ - "David Tolnay " - ]; - dependencies = [ - { - name = "thiserror-impl"; - packageId = "thiserror-impl"; - } - ]; - - }; - "thiserror-impl" = rec { - crateName = "thiserror-impl"; - version = "1.0.30"; - edition = "2018"; - sha256 = "0jviwmvx6wzawsj6c9msic7h419wmsbjagl9dzhpydkzc8zzscma"; - procMacro = true; - authors = [ - "David Tolnay " - ]; - dependencies = [ - { - name = "proc-macro2"; - packageId = "proc-macro2"; - } - { - name = "quote"; - packageId = "quote"; - } - { - name = "syn"; - packageId = "syn"; - } - ]; - - }; - "time" = rec { - crateName = "time"; - version = "0.3.7"; - edition = "2018"; - sha256 = "0gbmwlkj15dfhbqvxlzji1ffc1lidblpgg1q3b3378hgyfcbqk00"; - authors = [ - "Jacob Pratt " - "Time contributors" - ]; - dependencies = [ - { - name = "itoa"; - packageId = "itoa"; - optional = true; - } - { - name = "libc"; - packageId = "libc"; - target = { target, features }: (target."family" == "unix"); - } - { - name = "num_threads"; - packageId = "num_threads"; - target = { target, features }: (target."family" == "unix"); - } - { - name = "time-macros"; - packageId = "time-macros"; - optional = true; - } - ]; - features = { - "default" = [ "std" ]; - "formatting" = [ - "itoa" - "std" - ]; - "itoa" = [ "dep:itoa" ]; - "large-dates" = [ "time-macros/large-dates" ]; - "local-offset" = [ "std" ]; - "macros" = [ "time-macros" ]; - "quickcheck" = [ - "quickcheck-dep" - "alloc" - ]; - "quickcheck-dep" = [ "dep:quickcheck-dep" ]; - "rand" = [ "dep:rand" ]; - "serde" = [ "dep:serde" ]; - "serde-human-readable" = [ - "serde" - "formatting" - "parsing" - ]; - "serde-well-known" = [ - "serde/alloc" - "formatting" - "parsing" - ]; - "std" = [ "alloc" ]; - "time-macros" = [ "dep:time-macros" ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "default" - "formatting" - "itoa" - "macros" - "parsing" - "std" - "time-macros" - ]; - }; - "time-macros" = rec { - crateName = "time-macros"; - version = "0.2.3"; - edition = "2018"; - sha256 = "1mj7pv8y9j2csrh1l8aabras36pgysbnfy18330srh4g8sihrsr5"; - procMacro = true; - authors = [ - "Jacob Pratt " - "Time contributors" - ]; - features = { - }; - }; - "typenum" = rec { - crateName = "typenum"; - version = "1.15.0"; - edition = "2018"; - sha256 = "11yrvz1vd43gqv738yw1v75rzngjbs7iwcgzjy3cq5ywkv2imy6w"; - build = "build/main.rs"; - authors = [ - "Paho Lurie-Gregg " - "Andre Bogus " - ]; - features = { - "scale-info" = [ "dep:scale-info" ]; - "scale_info" = [ "scale-info/derive" ]; - }; - }; - "unicode-xid" = rec { - crateName = "unicode-xid"; - version = "0.2.2"; - edition = "2015"; - sha256 = "1wrkgcw557v311dkdb6n2hrix9dm2qdsb1zpw7pn79l03zb85jwc"; - authors = [ - "erick.tryzelaar " - "kwantam " - "Manish Goregaokar " - ]; - features = { - }; - resolvedDefaultFeatures = [ "default" ]; - }; - "untrusted" = rec { - crateName = "untrusted"; - version = "0.7.1"; - edition = "2018"; - sha256 = "0jkbqaj9d3v5a91pp3wp9mffvng1nhycx6sh4qkdd9qyr62ccmm1"; - libPath = "src/untrusted.rs"; - authors = [ - "Brian Smith " - ]; - - }; - "vcpkg" = rec { - crateName = "vcpkg"; - version = "0.2.15"; - edition = "2015"; - sha256 = "09i4nf5y8lig6xgj3f7fyrvzd3nlaw4znrihw8psidvv5yk4xkdc"; - authors = [ - "Jim McGrath " - ]; - - }; - "version_check" = rec { - crateName = "version_check"; - version = "0.9.4"; - edition = "2015"; - sha256 = "0gs8grwdlgh0xq660d7wr80x14vxbizmd8dbp29p2pdncx8lp1s9"; - authors = [ - "Sergio Benitez " - ]; - - }; - "wasi" = rec { - crateName = "wasi"; - version = "0.10.2+wasi-snapshot-preview1"; - edition = "2018"; - sha256 = "1ii7nff4y1mpcrxzzvbpgxm7a1nn3szjf1n21jnx37c2g6dbsvzx"; - authors = [ - "The Cranelift Project Developers" - ]; - features = { - "compiler_builtins" = [ "dep:compiler_builtins" ]; - "core" = [ "dep:core" ]; - "default" = [ "std" ]; - "rustc-dep-of-std" = [ - "compiler_builtins" - "core" - "rustc-std-workspace-alloc" - ]; - "rustc-std-workspace-alloc" = [ "dep:rustc-std-workspace-alloc" ]; - }; - resolvedDefaultFeatures = [ - "default" - "std" - ]; - }; - "wasm-bindgen" = rec { - crateName = "wasm-bindgen"; - version = "0.2.79"; - edition = "2018"; - sha256 = "01kc4lj2vlf0ra2w63izrgdlv8p6f8p15086hhyqln6q4dsazw95"; - authors = [ - "The wasm-bindgen Developers" - ]; - dependencies = [ - { - name = "cfg-if"; - packageId = "cfg-if"; - } - { - name = "wasm-bindgen-macro"; - packageId = "wasm-bindgen-macro"; - } - ]; - features = { - "default" = [ - "spans" - "std" - ]; - "enable-interning" = [ "std" ]; - "serde" = [ "dep:serde" ]; - "serde-serialize" = [ - "serde" - "serde_json" - "std" - ]; - "serde_json" = [ "dep:serde_json" ]; - "spans" = [ "wasm-bindgen-macro/spans" ]; - "strict-macro" = [ "wasm-bindgen-macro/strict-macro" ]; - "xxx_debug_only_print_generated_code" = [ - "wasm-bindgen-macro/xxx_debug_only_print_generated_code" - ]; - }; - resolvedDefaultFeatures = [ - "default" - "spans" - "std" - ]; - }; - "wasm-bindgen-backend" = rec { - crateName = "wasm-bindgen-backend"; - version = "0.2.79"; - edition = "2018"; - sha256 = "1jpdrl5jj01961jxhmvj7v25ws928fyfj8ms7izifnhg0ggw08cb"; - authors = [ - "The wasm-bindgen Developers" - ]; - dependencies = [ - { - name = "bumpalo"; - packageId = "bumpalo"; - } - { - name = "lazy_static"; - packageId = "lazy_static"; - } - { - name = "log"; - packageId = "log"; - } - { - name = "proc-macro2"; - packageId = "proc-macro2"; - } - { - name = "quote"; - packageId = "quote"; - } - { - name = "syn"; - packageId = "syn"; - features = [ "full" ]; - } - { - name = "wasm-bindgen-shared"; - packageId = "wasm-bindgen-shared"; - } - ]; - features = { - "extra-traits" = [ "syn/extra-traits" ]; - }; - resolvedDefaultFeatures = [ "spans" ]; - }; - "wasm-bindgen-macro" = rec { - crateName = "wasm-bindgen-macro"; - version = "0.2.79"; - edition = "2018"; - sha256 = "00gdh0dlf2r77mxwh08q0z01vz2z7mvrllmj4gjjx9a0kvb06hig"; - procMacro = true; - authors = [ - "The wasm-bindgen Developers" - ]; - dependencies = [ - { - name = "quote"; - packageId = "quote"; - } - { - name = "wasm-bindgen-macro-support"; - packageId = "wasm-bindgen-macro-support"; - } - ]; - features = { - "spans" = [ "wasm-bindgen-macro-support/spans" ]; - "strict-macro" = [ "wasm-bindgen-macro-support/strict-macro" ]; - }; - resolvedDefaultFeatures = [ "spans" ]; - }; - "wasm-bindgen-macro-support" = rec { - crateName = "wasm-bindgen-macro-support"; - version = "0.2.79"; - edition = "2018"; - sha256 = "1g1fjqvrkrf3j20z8nxsf60cypxg9dfvpbachl2b53908q6s7a5z"; - authors = [ - "The wasm-bindgen Developers" - ]; - dependencies = [ - { - name = "proc-macro2"; - packageId = "proc-macro2"; - } - { - name = "quote"; - packageId = "quote"; - } - { - name = "syn"; - packageId = "syn"; - features = [ - "visit" - "full" - ]; - } - { - name = "wasm-bindgen-backend"; - packageId = "wasm-bindgen-backend"; - } - { - name = "wasm-bindgen-shared"; - packageId = "wasm-bindgen-shared"; - } - ]; - features = { - "extra-traits" = [ "syn/extra-traits" ]; - "spans" = [ "wasm-bindgen-backend/spans" ]; - }; - resolvedDefaultFeatures = [ "spans" ]; - }; - "wasm-bindgen-shared" = rec { - crateName = "wasm-bindgen-shared"; - version = "0.2.79"; - edition = "2018"; - sha256 = "18h67l9b9jn06iw9r2p7bh9i0brh24lilcp4f26f4f24bh1qv59x"; - authors = [ - "The wasm-bindgen Developers" - ]; - - }; - "web-sys" = rec { - crateName = "web-sys"; - version = "0.3.56"; - edition = "2018"; - sha256 = "1sxqmwq773ss5m6vz7z95fdm6bqlix0s2awsy0j5gllxy8cv6q60"; - authors = [ - "The wasm-bindgen Developers" - ]; - dependencies = [ - { - name = "js-sys"; - packageId = "js-sys"; - } - { - name = "wasm-bindgen"; - packageId = "wasm-bindgen"; - } - ]; - features = { - "AbortSignal" = [ "EventTarget" ]; - "AnalyserNode" = [ - "AudioNode" - "EventTarget" - ]; - "Animation" = [ "EventTarget" ]; - "AnimationEvent" = [ "Event" ]; - "AnimationPlaybackEvent" = [ "Event" ]; - "Attr" = [ - "EventTarget" - "Node" - ]; - "AudioBufferSourceNode" = [ - "AudioNode" - "AudioScheduledSourceNode" - "EventTarget" - ]; - "AudioContext" = [ - "BaseAudioContext" - "EventTarget" - ]; - "AudioDestinationNode" = [ - "AudioNode" - "EventTarget" - ]; - "AudioNode" = [ "EventTarget" ]; - "AudioProcessingEvent" = [ "Event" ]; - "AudioScheduledSourceNode" = [ - "AudioNode" - "EventTarget" - ]; - "AudioStreamTrack" = [ - "EventTarget" - "MediaStreamTrack" - ]; - "AudioTrackList" = [ "EventTarget" ]; - "AudioWorklet" = [ "Worklet" ]; - "AudioWorkletGlobalScope" = [ "WorkletGlobalScope" ]; - "AudioWorkletNode" = [ - "AudioNode" - "EventTarget" - ]; - "AuthenticatorAssertionResponse" = [ "AuthenticatorResponse" ]; - "AuthenticatorAttestationResponse" = [ "AuthenticatorResponse" ]; - "BaseAudioContext" = [ "EventTarget" ]; - "BatteryManager" = [ "EventTarget" ]; - "BeforeUnloadEvent" = [ "Event" ]; - "BiquadFilterNode" = [ - "AudioNode" - "EventTarget" - ]; - "BlobEvent" = [ "Event" ]; - "Bluetooth" = [ "EventTarget" ]; - "BluetoothAdvertisingEvent" = [ "Event" ]; - "BluetoothDevice" = [ "EventTarget" ]; - "BluetoothPermissionResult" = [ - "EventTarget" - "PermissionStatus" - ]; - "BluetoothRemoteGattCharacteristic" = [ "EventTarget" ]; - "BluetoothRemoteGattService" = [ "EventTarget" ]; - "BroadcastChannel" = [ "EventTarget" ]; - "CanvasCaptureMediaStream" = [ - "EventTarget" - "MediaStream" - ]; - "CdataSection" = [ - "CharacterData" - "EventTarget" - "Node" - "Text" - ]; - "ChannelMergerNode" = [ - "AudioNode" - "EventTarget" - ]; - "ChannelSplitterNode" = [ - "AudioNode" - "EventTarget" - ]; - "CharacterData" = [ - "EventTarget" - "Node" - ]; - "ChromeWorker" = [ - "EventTarget" - "Worker" - ]; - "Clipboard" = [ "EventTarget" ]; - "ClipboardEvent" = [ "Event" ]; - "CloseEvent" = [ "Event" ]; - "Comment" = [ - "CharacterData" - "EventTarget" - "Node" - ]; - "CompositionEvent" = [ - "Event" - "UiEvent" - ]; - "ConstantSourceNode" = [ - "AudioNode" - "AudioScheduledSourceNode" - "EventTarget" - ]; - "ConvolverNode" = [ - "AudioNode" - "EventTarget" - ]; - "CssAnimation" = [ - "Animation" - "EventTarget" - ]; - "CssConditionRule" = [ - "CssGroupingRule" - "CssRule" - ]; - "CssCounterStyleRule" = [ "CssRule" ]; - "CssFontFaceRule" = [ "CssRule" ]; - "CssFontFeatureValuesRule" = [ "CssRule" ]; - "CssGroupingRule" = [ "CssRule" ]; - "CssImportRule" = [ "CssRule" ]; - "CssKeyframeRule" = [ "CssRule" ]; - "CssKeyframesRule" = [ "CssRule" ]; - "CssMediaRule" = [ - "CssConditionRule" - "CssGroupingRule" - "CssRule" - ]; - "CssNamespaceRule" = [ "CssRule" ]; - "CssPageRule" = [ "CssRule" ]; - "CssStyleRule" = [ "CssRule" ]; - "CssStyleSheet" = [ "StyleSheet" ]; - "CssSupportsRule" = [ - "CssConditionRule" - "CssGroupingRule" - "CssRule" - ]; - "CssTransition" = [ - "Animation" - "EventTarget" - ]; - "CustomEvent" = [ "Event" ]; - "DedicatedWorkerGlobalScope" = [ - "EventTarget" - "WorkerGlobalScope" - ]; - "DelayNode" = [ - "AudioNode" - "EventTarget" - ]; - "DeviceLightEvent" = [ "Event" ]; - "DeviceMotionEvent" = [ "Event" ]; - "DeviceOrientationEvent" = [ "Event" ]; - "DeviceProximityEvent" = [ "Event" ]; - "Document" = [ - "EventTarget" - "Node" - ]; - "DocumentFragment" = [ - "EventTarget" - "Node" - ]; - "DocumentTimeline" = [ "AnimationTimeline" ]; - "DocumentType" = [ - "EventTarget" - "Node" - ]; - "DomMatrix" = [ "DomMatrixReadOnly" ]; - "DomPoint" = [ "DomPointReadOnly" ]; - "DomRect" = [ "DomRectReadOnly" ]; - "DomRequest" = [ "EventTarget" ]; - "DragEvent" = [ - "Event" - "MouseEvent" - "UiEvent" - ]; - "DynamicsCompressorNode" = [ - "AudioNode" - "EventTarget" - ]; - "Element" = [ - "EventTarget" - "Node" - ]; - "ErrorEvent" = [ "Event" ]; - "EventSource" = [ "EventTarget" ]; - "ExtendableEvent" = [ "Event" ]; - "ExtendableMessageEvent" = [ - "Event" - "ExtendableEvent" - ]; - "FetchEvent" = [ - "Event" - "ExtendableEvent" - ]; - "FetchObserver" = [ "EventTarget" ]; - "File" = [ "Blob" ]; - "FileReader" = [ "EventTarget" ]; - "FileSystemDirectoryEntry" = [ "FileSystemEntry" ]; - "FileSystemFileEntry" = [ "FileSystemEntry" ]; - "FocusEvent" = [ - "Event" - "UiEvent" - ]; - "FontFaceSet" = [ "EventTarget" ]; - "FontFaceSetLoadEvent" = [ "Event" ]; - "GainNode" = [ - "AudioNode" - "EventTarget" - ]; - "GamepadAxisMoveEvent" = [ - "Event" - "GamepadEvent" - ]; - "GamepadButtonEvent" = [ - "Event" - "GamepadEvent" - ]; - "GamepadEvent" = [ "Event" ]; - "GpuDevice" = [ "EventTarget" ]; - "GpuUncapturedErrorEvent" = [ "Event" ]; - "HashChangeEvent" = [ "Event" ]; - "Hid" = [ "EventTarget" ]; - "HidConnectionEvent" = [ "Event" ]; - "HidDevice" = [ "EventTarget" ]; - "HidInputReportEvent" = [ "Event" ]; - "HtmlAnchorElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlAreaElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlAudioElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "HtmlMediaElement" - "Node" - ]; - "HtmlBaseElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlBodyElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlBrElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlButtonElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlCanvasElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlDListElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlDataElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlDataListElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlDetailsElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlDialogElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlDirectoryElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlDivElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlDocument" = [ - "Document" - "EventTarget" - "Node" - ]; - "HtmlElement" = [ - "Element" - "EventTarget" - "Node" - ]; - "HtmlEmbedElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlFieldSetElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlFontElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlFormControlsCollection" = [ "HtmlCollection" ]; - "HtmlFormElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlFrameElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlFrameSetElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlHeadElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlHeadingElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlHrElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlHtmlElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlIFrameElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlImageElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlInputElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlLabelElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlLegendElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlLiElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlLinkElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlMapElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlMediaElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlMenuElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlMenuItemElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlMetaElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlMeterElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlModElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlOListElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlObjectElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlOptGroupElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlOptionElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlOptionsCollection" = [ "HtmlCollection" ]; - "HtmlOutputElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlParagraphElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlParamElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlPictureElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlPreElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlProgressElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlQuoteElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlScriptElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlSelectElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlSlotElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlSourceElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlSpanElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlStyleElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlTableCaptionElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlTableCellElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlTableColElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlTableElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlTableRowElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlTableSectionElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlTemplateElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlTextAreaElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlTimeElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlTitleElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlTrackElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlUListElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlUnknownElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "Node" - ]; - "HtmlVideoElement" = [ - "Element" - "EventTarget" - "HtmlElement" - "HtmlMediaElement" - "Node" - ]; - "IdbCursorWithValue" = [ "IdbCursor" ]; - "IdbDatabase" = [ "EventTarget" ]; - "IdbFileHandle" = [ "EventTarget" ]; - "IdbFileRequest" = [ - "DomRequest" - "EventTarget" - ]; - "IdbLocaleAwareKeyRange" = [ "IdbKeyRange" ]; - "IdbMutableFile" = [ "EventTarget" ]; - "IdbOpenDbRequest" = [ - "EventTarget" - "IdbRequest" - ]; - "IdbRequest" = [ "EventTarget" ]; - "IdbTransaction" = [ "EventTarget" ]; - "IdbVersionChangeEvent" = [ "Event" ]; - "IirFilterNode" = [ - "AudioNode" - "EventTarget" - ]; - "ImageCaptureErrorEvent" = [ "Event" ]; - "InputEvent" = [ - "Event" - "UiEvent" - ]; - "KeyboardEvent" = [ - "Event" - "UiEvent" - ]; - "KeyframeEffect" = [ "AnimationEffect" ]; - "LocalMediaStream" = [ - "EventTarget" - "MediaStream" - ]; - "MediaDevices" = [ "EventTarget" ]; - "MediaElementAudioSourceNode" = [ - "AudioNode" - "EventTarget" - ]; - "MediaEncryptedEvent" = [ "Event" ]; - "MediaKeyError" = [ "Event" ]; - "MediaKeyMessageEvent" = [ "Event" ]; - "MediaKeySession" = [ "EventTarget" ]; - "MediaQueryList" = [ "EventTarget" ]; - "MediaQueryListEvent" = [ "Event" ]; - "MediaRecorder" = [ "EventTarget" ]; - "MediaRecorderErrorEvent" = [ "Event" ]; - "MediaSource" = [ "EventTarget" ]; - "MediaStream" = [ "EventTarget" ]; - "MediaStreamAudioDestinationNode" = [ - "AudioNode" - "EventTarget" - ]; - "MediaStreamAudioSourceNode" = [ - "AudioNode" - "EventTarget" - ]; - "MediaStreamEvent" = [ "Event" ]; - "MediaStreamTrack" = [ "EventTarget" ]; - "MediaStreamTrackEvent" = [ "Event" ]; - "MessageEvent" = [ "Event" ]; - "MessagePort" = [ "EventTarget" ]; - "MidiAccess" = [ "EventTarget" ]; - "MidiConnectionEvent" = [ "Event" ]; - "MidiInput" = [ - "EventTarget" - "MidiPort" - ]; - "MidiMessageEvent" = [ "Event" ]; - "MidiOutput" = [ - "EventTarget" - "MidiPort" - ]; - "MidiPort" = [ "EventTarget" ]; - "MouseEvent" = [ - "Event" - "UiEvent" - ]; - "MouseScrollEvent" = [ - "Event" - "MouseEvent" - "UiEvent" - ]; - "MutationEvent" = [ "Event" ]; - "NetworkInformation" = [ "EventTarget" ]; - "Node" = [ "EventTarget" ]; - "Notification" = [ "EventTarget" ]; - "NotificationEvent" = [ - "Event" - "ExtendableEvent" - ]; - "OfflineAudioCompletionEvent" = [ "Event" ]; - "OfflineAudioContext" = [ - "BaseAudioContext" - "EventTarget" - ]; - "OfflineResourceList" = [ "EventTarget" ]; - "OffscreenCanvas" = [ "EventTarget" ]; - "OscillatorNode" = [ - "AudioNode" - "AudioScheduledSourceNode" - "EventTarget" - ]; - "PageTransitionEvent" = [ "Event" ]; - "PaintWorkletGlobalScope" = [ "WorkletGlobalScope" ]; - "PannerNode" = [ - "AudioNode" - "EventTarget" - ]; - "PaymentMethodChangeEvent" = [ - "Event" - "PaymentRequestUpdateEvent" - ]; - "PaymentRequestUpdateEvent" = [ "Event" ]; - "Performance" = [ "EventTarget" ]; - "PerformanceMark" = [ "PerformanceEntry" ]; - "PerformanceMeasure" = [ "PerformanceEntry" ]; - "PerformanceNavigationTiming" = [ - "PerformanceEntry" - "PerformanceResourceTiming" - ]; - "PerformanceResourceTiming" = [ "PerformanceEntry" ]; - "PermissionStatus" = [ "EventTarget" ]; - "PointerEvent" = [ - "Event" - "MouseEvent" - "UiEvent" - ]; - "PopStateEvent" = [ "Event" ]; - "PopupBlockedEvent" = [ "Event" ]; - "PresentationAvailability" = [ "EventTarget" ]; - "PresentationConnection" = [ "EventTarget" ]; - "PresentationConnectionAvailableEvent" = [ "Event" ]; - "PresentationConnectionCloseEvent" = [ "Event" ]; - "PresentationConnectionList" = [ "EventTarget" ]; - "PresentationRequest" = [ "EventTarget" ]; - "ProcessingInstruction" = [ - "CharacterData" - "EventTarget" - "Node" - ]; - "ProgressEvent" = [ "Event" ]; - "PromiseRejectionEvent" = [ "Event" ]; - "PublicKeyCredential" = [ "Credential" ]; - "PushEvent" = [ - "Event" - "ExtendableEvent" - ]; - "RadioNodeList" = [ "NodeList" ]; - "RtcDataChannel" = [ "EventTarget" ]; - "RtcDataChannelEvent" = [ "Event" ]; - "RtcPeerConnection" = [ "EventTarget" ]; - "RtcPeerConnectionIceEvent" = [ "Event" ]; - "RtcTrackEvent" = [ "Event" ]; - "RtcdtmfSender" = [ "EventTarget" ]; - "RtcdtmfToneChangeEvent" = [ "Event" ]; - "Screen" = [ "EventTarget" ]; - "ScreenOrientation" = [ "EventTarget" ]; - "ScriptProcessorNode" = [ - "AudioNode" - "EventTarget" - ]; - "ScrollAreaEvent" = [ - "Event" - "UiEvent" - ]; - "SecurityPolicyViolationEvent" = [ "Event" ]; - "ServiceWorker" = [ "EventTarget" ]; - "ServiceWorkerContainer" = [ "EventTarget" ]; - "ServiceWorkerGlobalScope" = [ - "EventTarget" - "WorkerGlobalScope" - ]; - "ServiceWorkerRegistration" = [ "EventTarget" ]; - "ShadowRoot" = [ - "DocumentFragment" - "EventTarget" - "Node" - ]; - "SharedWorker" = [ "EventTarget" ]; - "SharedWorkerGlobalScope" = [ - "EventTarget" - "WorkerGlobalScope" - ]; - "SourceBuffer" = [ "EventTarget" ]; - "SourceBufferList" = [ "EventTarget" ]; - "SpeechRecognition" = [ "EventTarget" ]; - "SpeechRecognitionError" = [ "Event" ]; - "SpeechRecognitionEvent" = [ "Event" ]; - "SpeechSynthesis" = [ "EventTarget" ]; - "SpeechSynthesisErrorEvent" = [ - "Event" - "SpeechSynthesisEvent" - ]; - "SpeechSynthesisEvent" = [ "Event" ]; - "SpeechSynthesisUtterance" = [ "EventTarget" ]; - "StereoPannerNode" = [ - "AudioNode" - "EventTarget" - ]; - "StorageEvent" = [ "Event" ]; - "SvgAnimateElement" = [ - "Element" - "EventTarget" - "Node" - "SvgAnimationElement" - "SvgElement" - ]; - "SvgAnimateMotionElement" = [ - "Element" - "EventTarget" - "Node" - "SvgAnimationElement" - "SvgElement" - ]; - "SvgAnimateTransformElement" = [ - "Element" - "EventTarget" - "Node" - "SvgAnimationElement" - "SvgElement" - ]; - "SvgAnimationElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgCircleElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGeometryElement" - "SvgGraphicsElement" - ]; - "SvgClipPathElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgComponentTransferFunctionElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgDefsElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - ]; - "SvgDescElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgElement" = [ - "Element" - "EventTarget" - "Node" - ]; - "SvgEllipseElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGeometryElement" - "SvgGraphicsElement" - ]; - "SvgFilterElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgForeignObjectElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - ]; - "SvgGeometryElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - ]; - "SvgGradientElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgGraphicsElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgImageElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - ]; - "SvgLineElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGeometryElement" - "SvgGraphicsElement" - ]; - "SvgLinearGradientElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGradientElement" - ]; - "SvgMarkerElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgMaskElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgMetadataElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgPathElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGeometryElement" - "SvgGraphicsElement" - ]; - "SvgPathSegArcAbs" = [ "SvgPathSeg" ]; - "SvgPathSegArcRel" = [ "SvgPathSeg" ]; - "SvgPathSegClosePath" = [ "SvgPathSeg" ]; - "SvgPathSegCurvetoCubicAbs" = [ "SvgPathSeg" ]; - "SvgPathSegCurvetoCubicRel" = [ "SvgPathSeg" ]; - "SvgPathSegCurvetoCubicSmoothAbs" = [ "SvgPathSeg" ]; - "SvgPathSegCurvetoCubicSmoothRel" = [ "SvgPathSeg" ]; - "SvgPathSegCurvetoQuadraticAbs" = [ "SvgPathSeg" ]; - "SvgPathSegCurvetoQuadraticRel" = [ "SvgPathSeg" ]; - "SvgPathSegCurvetoQuadraticSmoothAbs" = [ "SvgPathSeg" ]; - "SvgPathSegCurvetoQuadraticSmoothRel" = [ "SvgPathSeg" ]; - "SvgPathSegLinetoAbs" = [ "SvgPathSeg" ]; - "SvgPathSegLinetoHorizontalAbs" = [ "SvgPathSeg" ]; - "SvgPathSegLinetoHorizontalRel" = [ "SvgPathSeg" ]; - "SvgPathSegLinetoRel" = [ "SvgPathSeg" ]; - "SvgPathSegLinetoVerticalAbs" = [ "SvgPathSeg" ]; - "SvgPathSegLinetoVerticalRel" = [ "SvgPathSeg" ]; - "SvgPathSegMovetoAbs" = [ "SvgPathSeg" ]; - "SvgPathSegMovetoRel" = [ "SvgPathSeg" ]; - "SvgPatternElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgPolygonElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGeometryElement" - "SvgGraphicsElement" - ]; - "SvgPolylineElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGeometryElement" - "SvgGraphicsElement" - ]; - "SvgRadialGradientElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGradientElement" - ]; - "SvgRectElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGeometryElement" - "SvgGraphicsElement" - ]; - "SvgScriptElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgSetElement" = [ - "Element" - "EventTarget" - "Node" - "SvgAnimationElement" - "SvgElement" - ]; - "SvgStopElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgStyleElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgSwitchElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - ]; - "SvgSymbolElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgTextContentElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - ]; - "SvgTextElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - "SvgTextContentElement" - "SvgTextPositioningElement" - ]; - "SvgTextPathElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - "SvgTextContentElement" - ]; - "SvgTextPositioningElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - "SvgTextContentElement" - ]; - "SvgTitleElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgUseElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - ]; - "SvgViewElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgaElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - ]; - "SvgfeBlendElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeColorMatrixElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeComponentTransferElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeCompositeElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeConvolveMatrixElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeDiffuseLightingElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeDisplacementMapElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeDistantLightElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeDropShadowElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeFloodElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeFuncAElement" = [ - "Element" - "EventTarget" - "Node" - "SvgComponentTransferFunctionElement" - "SvgElement" - ]; - "SvgfeFuncBElement" = [ - "Element" - "EventTarget" - "Node" - "SvgComponentTransferFunctionElement" - "SvgElement" - ]; - "SvgfeFuncGElement" = [ - "Element" - "EventTarget" - "Node" - "SvgComponentTransferFunctionElement" - "SvgElement" - ]; - "SvgfeFuncRElement" = [ - "Element" - "EventTarget" - "Node" - "SvgComponentTransferFunctionElement" - "SvgElement" - ]; - "SvgfeGaussianBlurElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeImageElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeMergeElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeMergeNodeElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeMorphologyElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeOffsetElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfePointLightElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeSpecularLightingElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeSpotLightElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeTileElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgfeTurbulenceElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvggElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - ]; - "SvgmPathElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - ]; - "SvgsvgElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - ]; - "SvgtSpanElement" = [ - "Element" - "EventTarget" - "Node" - "SvgElement" - "SvgGraphicsElement" - "SvgTextContentElement" - "SvgTextPositioningElement" - ]; - "TcpServerSocket" = [ "EventTarget" ]; - "TcpServerSocketEvent" = [ "Event" ]; - "TcpSocket" = [ "EventTarget" ]; - "TcpSocketErrorEvent" = [ "Event" ]; - "TcpSocketEvent" = [ "Event" ]; - "Text" = [ - "CharacterData" - "EventTarget" - "Node" - ]; - "TextTrack" = [ "EventTarget" ]; - "TextTrackCue" = [ "EventTarget" ]; - "TextTrackList" = [ "EventTarget" ]; - "TimeEvent" = [ "Event" ]; - "TouchEvent" = [ - "Event" - "UiEvent" - ]; - "TrackEvent" = [ "Event" ]; - "TransitionEvent" = [ "Event" ]; - "UiEvent" = [ "Event" ]; - "Usb" = [ "EventTarget" ]; - "UsbConnectionEvent" = [ "Event" ]; - "UsbPermissionResult" = [ - "EventTarget" - "PermissionStatus" - ]; - "UserProximityEvent" = [ "Event" ]; - "ValueEvent" = [ "Event" ]; - "VideoStreamTrack" = [ - "EventTarget" - "MediaStreamTrack" - ]; - "VideoTrackList" = [ "EventTarget" ]; - "VrDisplay" = [ "EventTarget" ]; - "VttCue" = [ - "EventTarget" - "TextTrackCue" - ]; - "WakeLockSentinel" = [ "EventTarget" ]; - "WaveShaperNode" = [ - "AudioNode" - "EventTarget" - ]; - "WebGlContextEvent" = [ "Event" ]; - "WebKitCssMatrix" = [ - "DomMatrix" - "DomMatrixReadOnly" - ]; - "WebSocket" = [ "EventTarget" ]; - "WheelEvent" = [ - "Event" - "MouseEvent" - "UiEvent" - ]; - "Window" = [ "EventTarget" ]; - "WindowClient" = [ "Client" ]; - "Worker" = [ "EventTarget" ]; - "WorkerDebuggerGlobalScope" = [ "EventTarget" ]; - "WorkerGlobalScope" = [ "EventTarget" ]; - "XmlDocument" = [ - "Document" - "EventTarget" - "Node" - ]; - "XmlHttpRequest" = [ - "EventTarget" - "XmlHttpRequestEventTarget" - ]; - "XmlHttpRequestEventTarget" = [ "EventTarget" ]; - "XmlHttpRequestUpload" = [ - "EventTarget" - "XmlHttpRequestEventTarget" - ]; - "Xr" = [ "EventTarget" ]; - "XrBoundedReferenceSpace" = [ - "EventTarget" - "XrReferenceSpace" - "XrSpace" - ]; - "XrInputSourceEvent" = [ "Event" ]; - "XrInputSourcesChangeEvent" = [ "Event" ]; - "XrReferenceSpace" = [ - "EventTarget" - "XrSpace" - ]; - "XrReferenceSpaceEvent" = [ "Event" ]; - "XrSession" = [ "EventTarget" ]; - "XrSessionEvent" = [ "Event" ]; - "XrSpace" = [ "EventTarget" ]; - "XrViewerPose" = [ "XrPose" ]; - }; - resolvedDefaultFeatures = [ - "Crypto" - "EventTarget" - "Window" - ]; - }; - "webpki" = rec { - crateName = "webpki"; - version = "0.22.0"; - edition = "2018"; - sha256 = "1gd1gxip5kgdwmrvhj5gjxij2mgg2mavq1ych4q1h272ja0xg5gh"; - authors = [ - "Brian Smith " - ]; - dependencies = [ - { - name = "ring"; - packageId = "ring"; - usesDefaultFeatures = false; - } - { - name = "untrusted"; - packageId = "untrusted"; - } - ]; - features = { - "alloc" = [ "ring/alloc" ]; - "std" = [ "alloc" ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "std" - ]; - }; - "winapi" = rec { - crateName = "winapi"; - version = "0.3.9"; - edition = "2015"; - sha256 = "06gl025x418lchw1wxj64ycr7gha83m44cjr5sarhynd9xkrm0sw"; - authors = [ - "Peter Atashian " - ]; - dependencies = [ - { - name = "winapi-i686-pc-windows-gnu"; - packageId = "winapi-i686-pc-windows-gnu"; - target = { target, features }: (stdenv.hostPlatform.config == "i686-pc-windows-gnu"); - } - { - name = "winapi-x86_64-pc-windows-gnu"; - packageId = "winapi-x86_64-pc-windows-gnu"; - target = { target, features }: (stdenv.hostPlatform.config == "x86_64-pc-windows-gnu"); - } - ]; - features = { - "debug" = [ "impl-debug" ]; - }; - resolvedDefaultFeatures = [ - "ntsecapi" - "wtypesbase" - ]; - }; - "winapi-i686-pc-windows-gnu" = rec { - crateName = "winapi-i686-pc-windows-gnu"; - version = "0.4.0"; - edition = "2015"; - sha256 = "1dmpa6mvcvzz16zg6d5vrfy4bxgg541wxrcip7cnshi06v38ffxc"; - authors = [ - "Peter Atashian " - ]; - - }; - "winapi-x86_64-pc-windows-gnu" = rec { - crateName = "winapi-x86_64-pc-windows-gnu"; - version = "0.4.0"; - edition = "2015"; - sha256 = "0gqq64czqb64kskjryj8isp62m2sgvx25yyj3kpc2myh85w24bki"; - authors = [ - "Peter Atashian " - ]; - - }; - "x509-parser" = rec { - crateName = "x509-parser"; - version = "0.13.0"; - edition = "2018"; - sha256 = "0f3fqbv92q3a3s51md94sw3vgzs934agl4ii5a6ym364mkdlpwg5"; - authors = [ - "Pierre Chifflier " - ]; - dependencies = [ - { - name = "asn1-rs"; - packageId = "asn1-rs"; - features = [ "datetime" ]; - } - { - name = "base64"; - packageId = "base64"; - } - { - name = "data-encoding"; - packageId = "data-encoding"; - } - { - name = "der-parser"; - packageId = "der-parser"; - features = [ "bigint" ]; - } - { - name = "lazy_static"; - packageId = "lazy_static"; - } - { - name = "nom"; - packageId = "nom"; - } - { - name = "oid-registry"; - packageId = "oid-registry"; - features = [ - "crypto" - "x509" - ]; - } - { - name = "ring"; - packageId = "ring"; - optional = true; - } - { - name = "rusticata-macros"; - packageId = "rusticata-macros"; - } - { - name = "thiserror"; - packageId = "thiserror"; - } - { - name = "time"; - packageId = "time"; - features = [ "formatting" ]; - } - ]; - features = { - "ring" = [ "dep:ring" ]; - "verify" = [ "ring" ]; - }; - resolvedDefaultFeatures = [ - "default" - "ring" - "verify" - ]; - }; - "yasna" = rec { - crateName = "yasna"; - version = "0.5.0"; - edition = "2018"; - sha256 = "0k1gk11hq4rwlppv9f50bz8bnmgr73r66idpp7rybly96si38v9l"; - authors = [ - "Masaki Hara " - ]; - dependencies = [ - { - name = "time"; - packageId = "time"; - optional = true; - usesDefaultFeatures = false; - features = [ "std" ]; - } - ]; - features = { - "bit-vec" = [ "dep:bit-vec" ]; - "num-bigint" = [ "dep:num-bigint" ]; - "time" = [ "dep:time" ]; - }; - resolvedDefaultFeatures = [ - "default" - "std" - "time" - ]; - }; - "zeroize" = rec { - crateName = "zeroize"; - version = "1.4.3"; - edition = "2018"; - sha256 = "068nvl3n5hk6lfn5y24grf2c7anzzqfzjjccscq3md7rqp79v3fn"; - authors = [ - "The RustCrypto Project Developers" - ]; - dependencies = [ - { - name = "zeroize_derive"; - packageId = "zeroize_derive"; - optional = true; - } - ]; - features = { - "default" = [ "alloc" ]; - "zeroize_derive" = [ "dep:zeroize_derive" ]; - }; - resolvedDefaultFeatures = [ - "alloc" - "default" - "zeroize_derive" - ]; - }; - "zeroize_derive" = rec { - crateName = "zeroize_derive"; - version = "1.3.1"; - edition = "2018"; - sha256 = "1nzdqyryjnqcrqz0vhddpkd8sybhn0bd8rbd6l33rdhhxwzz3s41"; - procMacro = true; - authors = [ - "The RustCrypto Project Developers" - ]; - dependencies = [ - { - name = "proc-macro2"; - packageId = "proc-macro2"; - } - { - name = "quote"; - packageId = "quote"; - } - { - name = "syn"; - packageId = "syn"; - } - { - name = "synstructure"; - packageId = "synstructure"; - } - ]; - - }; - }; - - # - # crate2nix/default.nix (excerpt start) - # - - /* - Target (platform) data for conditional dependencies. - This corresponds roughly to what buildRustCrate is setting. - */ - defaultTarget = { - unix = true; - windows = false; - fuchsia = true; - test = false; - - # This doesn't appear to be officially documented anywhere yet. - # See https://github.com/rust-lang-nursery/rust-forge/issues/101. - os = if stdenv.hostPlatform.isDarwin then "macos" else stdenv.hostPlatform.parsed.kernel.name; - arch = stdenv.hostPlatform.parsed.cpu.name; - family = "unix"; - env = "gnu"; - endian = - if stdenv.hostPlatform.parsed.cpu.significantByte.name == "littleEndian" then "little" else "big"; - pointer_width = toString stdenv.hostPlatform.parsed.cpu.bits; - vendor = stdenv.hostPlatform.parsed.vendor.name; - debug_assertions = false; - }; - - # Filters common temp files and build files. - # TODO(pkolloch): Substitute with gitignore filter - sourceFilter = - name: type: - let - baseName = builtins.baseNameOf (builtins.toString name); - in - !( - # Filter out git - baseName == ".gitignore" - || (type == "directory" && baseName == ".git") - - # Filter out build results - || ( - type == "directory" - && ( - baseName == "target" - || baseName == "_site" - || baseName == ".sass-cache" - || baseName == ".jekyll-metadata" - || baseName == "build-artifacts" - ) - ) - - # Filter out nix-build result symlinks - || (type == "symlink" && lib.hasPrefix "result" baseName) - - # Filter out IDE config - || (type == "directory" && (baseName == ".idea" || baseName == ".vscode")) - || lib.hasSuffix ".iml" baseName - - # Filter out nix build files - || baseName == "Cargo.nix" - - # Filter out editor backup / swap files. - || lib.hasSuffix "~" baseName - || builtins.match "^\\.sw[a-z]$$" baseName != null - || builtins.match "^\\..*\\.sw[a-z]$$" baseName != null - || lib.hasSuffix ".tmp" baseName - || lib.hasSuffix ".bak" baseName - || baseName == "tests.nix" - ); - - /* - Returns a crate which depends on successful test execution - of crate given as the second argument. - - testCrateFlags: list of flags to pass to the test executable - testInputs: list of packages that should be available during test execution - */ - crateWithTest = - { - crate, - testCrate, - testCrateFlags, - testInputs, - testPreRun, - testPostRun, - }: - assert builtins.typeOf testCrateFlags == "list"; - assert builtins.typeOf testInputs == "list"; - assert builtins.typeOf testPreRun == "string"; - assert builtins.typeOf testPostRun == "string"; - let - # override the `crate` so that it will build and execute tests instead of - # building the actual lib and bin targets We just have to pass `--test` - # to rustc and it will do the right thing. We execute the tests and copy - # their log and the test executables to $out for later inspection. - test = - let - drv = testCrate.override (_: { - buildTests = true; - }); - # If the user hasn't set any pre/post commands, we don't want to - # insert empty lines. This means that any existing users of crate2nix - # don't get a spurious rebuild unless they set these explicitly. - testCommand = pkgs.lib.concatStringsSep "\n" ( - pkgs.lib.filter (s: s != "") [ - testPreRun - "$f $testCrateFlags 2>&1 | tee -a $out" - testPostRun - ] - ); - in - pkgs.runCommand "run-tests-${testCrate.name}" - { - inherit testCrateFlags; - buildInputs = testInputs; - } - '' - set -ex - - export RUST_BACKTRACE=1 - - # recreate a file hierarchy as when running tests with cargo - - # the source for test data - ${pkgs.xorg.lndir}/bin/lndir ${crate.src} - - # build outputs - testRoot=target/debug - mkdir -p $testRoot - - # executables of the crate - # we copy to prevent std::env::current_exe() to resolve to a store location - for i in ${crate}/bin/*; do - cp "$i" "$testRoot" - done - chmod +w -R . - - # test harness executables are suffixed with a hash, like cargo does - # this allows to prevent name collision with the main - # executables of the crate - hash=$(basename $out) - for file in ${drv}/tests/*; do - f=$testRoot/$(basename $file)-$hash - cp $file $f - ${testCommand} - done - ''; - in - pkgs.runCommand "${crate.name}-linked" - { - inherit (crate) outputs crateName; - passthru = (crate.passthru or { }) // { - inherit test; - }; - } - '' - echo tested by ${test} - ${lib.concatMapStringsSep "\n" (output: "ln -s ${crate.${output}} ${"$"}${output}") crate.outputs} - ''; - - # A restricted overridable version of builtRustCratesWithFeatures. - buildRustCrateWithFeatures = - { - packageId, - features ? rootFeatures, - crateOverrides ? defaultCrateOverrides, - buildRustCrateForPkgsFunc ? null, - runTests ? false, - testCrateFlags ? [ ], - testInputs ? [ ], - # Any command to run immediatelly before a test is executed. - testPreRun ? "", - # Any command run immediatelly after a test is executed. - testPostRun ? "", - }: - lib.makeOverridable - ( - { - features, - crateOverrides, - runTests, - testCrateFlags, - testInputs, - testPreRun, - testPostRun, - }: - let - buildRustCrateForPkgsFuncOverriden = - if buildRustCrateForPkgsFunc != null then - buildRustCrateForPkgsFunc - else - ( - if crateOverrides == pkgs.defaultCrateOverrides then - buildRustCrateForPkgs - else - pkgs: - (buildRustCrateForPkgs pkgs).override { - defaultCrateOverrides = crateOverrides; - } - ); - builtRustCrates = builtRustCratesWithFeatures { - inherit packageId features; - buildRustCrateForPkgsFunc = buildRustCrateForPkgsFuncOverriden; - runTests = false; - }; - builtTestRustCrates = builtRustCratesWithFeatures { - inherit packageId features; - buildRustCrateForPkgsFunc = buildRustCrateForPkgsFuncOverriden; - runTests = true; - }; - drv = builtRustCrates.crates.${packageId}; - testDrv = builtTestRustCrates.crates.${packageId}; - derivation = - if runTests then - crateWithTest { - crate = drv; - testCrate = testDrv; - inherit - testCrateFlags - testInputs - testPreRun - testPostRun - ; - } - else - drv; - in - derivation - ) - { - inherit - features - crateOverrides - runTests - testCrateFlags - testInputs - testPreRun - testPostRun - ; - }; - - /* - Returns an attr set with packageId mapped to the result of buildRustCrateForPkgsFunc - for the corresponding crate. - */ - builtRustCratesWithFeatures = - { - packageId, - features, - crateConfigs ? crates, - buildRustCrateForPkgsFunc, - runTests, - target ? defaultTarget, - }@args: - assert (builtins.isAttrs crateConfigs); - assert (builtins.isString packageId); - assert (builtins.isList features); - assert (builtins.isAttrs target); - assert (builtins.isBool runTests); - let - rootPackageId = packageId; - mergedFeatures = mergePackageFeatures ( - args - // { - inherit rootPackageId; - target = target // { - test = runTests; - }; - } - ); - # Memoize built packages so that reappearing packages are only built once. - builtByPackageIdByPkgs = mkBuiltByPackageIdByPkgs pkgs; - mkBuiltByPackageIdByPkgs = - pkgs: - let - self = { - crates = lib.mapAttrs ( - packageId: value: buildByPackageIdForPkgsImpl self pkgs packageId - ) crateConfigs; - build = mkBuiltByPackageIdByPkgs pkgs.buildPackages; - }; - in - self; - buildByPackageIdForPkgsImpl = - self: pkgs: packageId: - let - features = mergedFeatures."${packageId}" or [ ]; - crateConfig' = crateConfigs."${packageId}"; - crateConfig = builtins.removeAttrs crateConfig' [ - "resolvedDefaultFeatures" - "devDependencies" - ]; - devDependencies = lib.optionals (runTests && packageId == rootPackageId) ( - crateConfig'.devDependencies or [ ] - ); - dependencies = dependencyDerivations { - inherit features target; - buildByPackageId = - depPackageId: - # proc_macro crates must be compiled for the build architecture - if crateConfigs.${depPackageId}.procMacro or false then - self.build.crates.${depPackageId} - else - self.crates.${depPackageId}; - dependencies = (crateConfig.dependencies or [ ]) ++ devDependencies; - }; - buildDependencies = dependencyDerivations { - inherit features target; - buildByPackageId = depPackageId: self.build.crates.${depPackageId}; - dependencies = crateConfig.buildDependencies or [ ]; - }; - filterEnabledDependenciesForThis = - dependencies: - filterEnabledDependencies { - inherit dependencies features target; - }; - dependenciesWithRenames = lib.filter (d: d ? "rename") ( - filterEnabledDependenciesForThis ( - (crateConfig.buildDependencies or [ ]) ++ (crateConfig.dependencies or [ ]) ++ devDependencies - ) - ); - # Crate renames have the form: - # - # { - # crate_name = [ - # { version = "1.2.3"; rename = "crate_name01"; } - # ]; - # # ... - # } - crateRenames = - let - grouped = lib.groupBy (dependency: dependency.name) dependenciesWithRenames; - versionAndRename = - dep: - let - package = crateConfigs."${dep.packageId}"; - in - { - inherit (dep) rename; - version = package.version; - }; - in - lib.mapAttrs (name: choices: builtins.map versionAndRename choices) grouped; - in - buildRustCrateForPkgsFunc pkgs ( - crateConfig - // { - src = - crateConfig.src or (pkgs.fetchurl rec { - name = "${crateConfig.crateName}-${crateConfig.version}.tar.gz"; - # https://www.pietroalbini.org/blog/downloading-crates-io/ - # Not rate-limited, CDN URL. - url = "https://static.crates.io/crates/${crateConfig.crateName}/${crateConfig.crateName}-${crateConfig.version}.crate"; - sha256 = - assert (lib.assertMsg (crateConfig ? sha256) "Missing sha256 for ${name}"); - crateConfig.sha256; - }); - extraRustcOpts = - lib.lists.optional (targetFeatures != [ ]) - "-C target-feature=${lib.concatMapStringsSep "," (x: "+${x}") targetFeatures}"; - inherit - features - dependencies - buildDependencies - crateRenames - release - ; - } - ); - in - builtByPackageIdByPkgs; - - # Returns the actual derivations for the given dependencies. - dependencyDerivations = - { - buildByPackageId, - features, - dependencies, - target, - }: - assert (builtins.isList features); - assert (builtins.isList dependencies); - assert (builtins.isAttrs target); - let - enabledDependencies = filterEnabledDependencies { - inherit dependencies features target; - }; - depDerivation = dependency: buildByPackageId dependency.packageId; - in - map depDerivation enabledDependencies; - - /* - Returns a sanitized version of val with all values substituted that cannot - be serialized as JSON. - */ - sanitizeForJson = - val: - if builtins.isAttrs val then - lib.mapAttrs (n: v: sanitizeForJson v) val - else if builtins.isList val then - builtins.map sanitizeForJson val - else if builtins.isFunction val then - "function" - else - val; - - # Returns various tools to debug a crate. - debugCrate = - { - packageId, - target ? defaultTarget, - }: - assert (builtins.isString packageId); - let - debug = rec { - # The built tree as passed to buildRustCrate. - buildTree = buildRustCrateWithFeatures { - buildRustCrateForPkgsFunc = _: lib.id; - inherit packageId; - }; - sanitizedBuildTree = sanitizeForJson buildTree; - dependencyTree = sanitizeForJson (buildRustCrateWithFeatures { - buildRustCrateForPkgsFunc = _: crate: { - "01_crateName" = crate.crateName or false; - "02_features" = crate.features or [ ]; - "03_dependencies" = crate.dependencies or [ ]; - }; - inherit packageId; - }); - mergedPackageFeatures = mergePackageFeatures { - features = rootFeatures; - inherit packageId target; - }; - diffedDefaultPackageFeatures = diffDefaultPackageFeatures { - inherit packageId target; - }; - }; - in - { - internal = debug; - }; - - /* - Returns differences between cargo default features and crate2nix default - features. - - This is useful for verifying the feature resolution in crate2nix. - */ - diffDefaultPackageFeatures = - { - crateConfigs ? crates, - packageId, - target, - }: - assert (builtins.isAttrs crateConfigs); - let - prefixValues = prefix: lib.mapAttrs (n: v: { "${prefix}" = v; }); - mergedFeatures = prefixValues "crate2nix" (mergePackageFeatures { - inherit crateConfigs packageId target; - features = [ "default" ]; - }); - configs = prefixValues "cargo" crateConfigs; - combined = lib.foldAttrs (a: b: a // b) { } [ - mergedFeatures - configs - ]; - onlyInCargo = builtins.attrNames ( - lib.filterAttrs (n: v: !(v ? "crate2nix") && (v ? "cargo")) combined - ); - onlyInCrate2Nix = builtins.attrNames ( - lib.filterAttrs (n: v: (v ? "crate2nix") && !(v ? "cargo")) combined - ); - differentFeatures = lib.filterAttrs ( - n: v: - (v ? "crate2nix") - && (v ? "cargo") - && (v.crate2nix.features or [ ]) != (v."cargo".resolved_default_features or [ ]) - ) combined; - in - builtins.toJSON { - inherit onlyInCargo onlyInCrate2Nix differentFeatures; - }; - - /* - Returns an attrset mapping packageId to the list of enabled features. - - If multiple paths to a dependency enable different features, the - corresponding feature sets are merged. Features in rust are additive. - */ - mergePackageFeatures = - { - crateConfigs ? crates, - packageId, - rootPackageId ? packageId, - features ? rootFeatures, - dependencyPath ? [ crates.${packageId}.crateName ], - featuresByPackageId ? { }, - target, - # Adds devDependencies to the crate with rootPackageId. - runTests ? false, - ... - }@args: - assert (builtins.isAttrs crateConfigs); - assert (builtins.isString packageId); - assert (builtins.isString rootPackageId); - assert (builtins.isList features); - assert (builtins.isList dependencyPath); - assert (builtins.isAttrs featuresByPackageId); - assert (builtins.isAttrs target); - assert (builtins.isBool runTests); - let - crateConfig = crateConfigs."${packageId}" or (builtins.throw "Package not found: ${packageId}"); - expandedFeatures = expandFeatures (crateConfig.features or { }) features; - enabledFeatures = enableFeatures (crateConfig.dependencies or [ ]) expandedFeatures; - depWithResolvedFeatures = - dependency: - let - packageId = dependency.packageId; - features = dependencyFeatures enabledFeatures dependency; - in - { - inherit packageId features; - }; - resolveDependencies = - cache: path: dependencies: - assert (builtins.isAttrs cache); - assert (builtins.isList dependencies); - let - enabledDependencies = filterEnabledDependencies { - inherit dependencies target; - features = enabledFeatures; - }; - directDependencies = map depWithResolvedFeatures enabledDependencies; - foldOverCache = op: lib.foldl op cache directDependencies; - in - foldOverCache ( - cache: - { packageId, features }: - let - cacheFeatures = cache.${packageId} or [ ]; - combinedFeatures = sortedUnique (cacheFeatures ++ features); - in - if cache ? ${packageId} && cache.${packageId} == combinedFeatures then - cache - else - mergePackageFeatures { - features = combinedFeatures; - featuresByPackageId = cache; - inherit - crateConfigs - packageId - target - runTests - rootPackageId - ; - } - ); - cacheWithSelf = - let - cacheFeatures = featuresByPackageId.${packageId} or [ ]; - combinedFeatures = sortedUnique (cacheFeatures ++ enabledFeatures); - in - featuresByPackageId - // { - "${packageId}" = combinedFeatures; - }; - cacheWithDependencies = resolveDependencies cacheWithSelf "dep" ( - crateConfig.dependencies or [ ] - ++ lib.optionals (runTests && packageId == rootPackageId) (crateConfig.devDependencies or [ ]) - ); - cacheWithAll = resolveDependencies cacheWithDependencies "build" ( - crateConfig.buildDependencies or [ ] - ); - in - cacheWithAll; - - # Returns the enabled dependencies given the enabled features. - filterEnabledDependencies = - { - dependencies, - features, - target, - }: - assert (builtins.isList dependencies); - assert (builtins.isList features); - assert (builtins.isAttrs target); - - lib.filter ( - dep: - let - targetFunc = dep.target or (features: true); - in - targetFunc { inherit features target; } - && (!(dep.optional or false) || builtins.any (doesFeatureEnableDependency dep) features) - ) dependencies; - - # Returns whether the given feature should enable the given dependency. - doesFeatureEnableDependency = - dependency: feature: - let - name = dependency.rename or dependency.name; - prefix = "${name}/"; - len = builtins.stringLength prefix; - startsWithPrefix = builtins.substring 0 len feature == prefix; - in - feature == name || startsWithPrefix; - - /* - Returns the expanded features for the given inputFeatures by applying the - rules in featureMap. - - featureMap is an attribute set which maps feature names to lists of further - feature names to enable in case this feature is selected. - */ - expandFeatures = - featureMap: inputFeatures: - assert (builtins.isAttrs featureMap); - assert (builtins.isList inputFeatures); - let - expandFeature = - feature: - assert (builtins.isString feature); - [ feature ] ++ (expandFeatures featureMap (featureMap."${feature}" or [ ])); - outFeatures = lib.concatMap expandFeature inputFeatures; - in - sortedUnique outFeatures; - - /* - This function adds optional dependencies as features if they are enabled - indirectly by dependency features. This function mimics Cargo's behavior - described in a note at: - https://doc.rust-lang.org/nightly/cargo/reference/features.html#dependency-features - */ - enableFeatures = - dependencies: features: - assert (builtins.isList features); - assert (builtins.isList dependencies); - let - additionalFeatures = lib.concatMap ( - dependency: - assert (builtins.isAttrs dependency); - let - enabled = builtins.any (doesFeatureEnableDependency dependency) features; - in - if (dependency.optional or false) && enabled then - [ (dependency.rename or dependency.name) ] - else - [ ] - ) dependencies; - in - sortedUnique (features ++ additionalFeatures); - - /* - Returns the actual features for the given dependency. - - features: The features of the crate that refers this dependency. - */ - dependencyFeatures = - features: dependency: - assert (builtins.isList features); - assert (builtins.isAttrs dependency); - let - defaultOrNil = if dependency.usesDefaultFeatures or true then [ "default" ] else [ ]; - explicitFeatures = dependency.features or [ ]; - additionalDependencyFeatures = - let - dependencyPrefix = (dependency.rename or dependency.name) + "/"; - dependencyFeatures = builtins.filter (f: lib.hasPrefix dependencyPrefix f) features; - in - builtins.map (lib.removePrefix dependencyPrefix) dependencyFeatures; - in - defaultOrNil ++ explicitFeatures ++ additionalDependencyFeatures; - - # Sorts and removes duplicates from a list of strings. - sortedUnique = - features: - assert (builtins.isList features); - assert (builtins.all builtins.isString features); - let - outFeaturesSet = lib.foldl (set: feature: set // { "${feature}" = 1; }) { } features; - outFeaturesUnique = builtins.attrNames outFeaturesSet; - in - builtins.sort (a: b: a < b) outFeaturesUnique; - - deprecationWarning = - message: value: - if strictDeprecation then - builtins.throw "strictDeprecation enabled, aborting: ${message}" - else - builtins.trace message value; - - # - # crate2nix/default.nix (excerpt end) - # - }; -} diff --git a/pkgs/build-support/rust/default-crate-overrides.nix b/pkgs/build-support/rust/default-crate-overrides.nix deleted file mode 100644 index 407f7e652c381..0000000000000 --- a/pkgs/build-support/rust/default-crate-overrides.nix +++ /dev/null @@ -1,372 +0,0 @@ -{ lib -, stdenv -, alsa-lib -, atk -, autoconf -, automake -, cairo -, capnproto -, clang -, cmake -, curl -, darwin -, dbus -, dbus-glib -, fontconfig -, foundationdb -, freetype -, gdk-pixbuf -, glib -, gmp -, gobject-introspection -, graphene -, gtk3 -, gtk4 -, libevdev -, libgit2 -, libsodium -, libsoup_3 -, libssh2 -, libtool -, linux-pam -, llvmPackages -, nettle -, openssl -, pango -, pkg-config -, postgresql -, protobuf -, python3 -, rdkafka -, seatd # =libseat -, sqlite -, udev -, webkitgtk_4_1 -, zlib -, buildPackages -, ... -}: - -let - inherit (darwin.apple_sdk.frameworks) CoreFoundation Security; -in -{ - alsa-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ alsa-lib ]; - }; - - cairo-rs = attrs: { - buildInputs = [ cairo ]; - }; - - cairo-sys-rs = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ cairo ]; - extraLinkFlags = [ "-L${zlib.out}/lib" ]; - }; - - capnp-rpc = attrs: { - nativeBuildInputs = [ capnproto ]; - }; - - cargo = attrs: { - buildInputs = [ openssl zlib curl ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ CoreFoundation Security ]; - }; - - libz-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ zlib ]; - extraLinkFlags = [ "-L${zlib.out}/lib" ]; - }; - - curl-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ zlib curl ]; - propagatedBuildInputs = [ curl zlib ]; - extraLinkFlags = [ "-L${zlib.out}/lib" ]; - }; - - dbus = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ dbus ]; - }; - - evdev-sys = attrs: { - nativeBuildInputs = [ - pkg-config - ] ++ lib.optionals (stdenv.buildPlatform.config != stdenv.hostPlatform.config) [ - python3 - autoconf - automake - libtool - ]; - buildInputs = [ libevdev ]; - - # This prevents libevdev's build.rs from trying to `git fetch` when HOST!=TARGET - prePatch = '' - touch libevdev/.git - ''; - }; - - expat-sys = attrs: { - nativeBuildInputs = [ cmake ]; - }; - - foundationdb-sys = attrs: { - buildInputs = [ foundationdb ]; - # needed for 0.4+ release, when the FFI bindings are auto-generated - # - # patchPhase = '' - # substituteInPlace ./foundationdb-sys/build.rs \ - # --replace /usr/local/include ${foundationdb.dev}/include - # ''; - }; - - foundationdb = attrs: { - buildInputs = [ foundationdb ]; - }; - - freetype-sys = attrs: { - nativeBuildInputs = [ cmake ]; - buildInputs = [ freetype ]; - }; - - glib-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ glib ]; - extraLinkFlags = [ "-L${zlib.out}/lib" ]; - }; - - gobject-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ dbus-glib ]; - }; - - gio-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ dbus-glib ]; - }; - - gdk-pixbuf = attrs: { - buildInputs = [ dbus-glib gdk-pixbuf ]; - }; - - gdk-pixbuf-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ gdk-pixbuf ]; - }; - - gdk-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ gtk3 ]; # libgdk-3 - }; - - gdkx11-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ gtk3 ]; - }; - - gtk-sys = attrs: { - buildInputs = [ gtk3 ]; - nativeBuildInputs = [ pkg-config ]; - }; - - gtk4-sys = attrs: { - buildInputs = [ gtk4 ]; - nativeBuildInputs = [ pkg-config ]; - }; - - gdk4-sys = attrs: { - buildInputs = [ gtk4 ]; - nativeBuildInputs = [ pkg-config ]; - }; - - gsk4-sys = attrs: { - buildInputs = [ gtk4 ]; - nativeBuildInputs = [ pkg-config ]; - }; - - libgit2-sys = attrs: { - LIBGIT2_SYS_USE_PKG_CONFIG = true; - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ openssl zlib libgit2 ]; - }; - - libseat-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ seatd ]; - }; - - libsqlite3-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ sqlite ]; - }; - - libssh2-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ openssl zlib libssh2 ]; - }; - - libdbus-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ dbus ]; - }; - - libudev-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ udev ]; - }; - - graphene-sys = attrs: { - nativeBuildInputs = [ pkg-config gobject-introspection ]; - buildInputs = [ graphene ]; - }; - - javascriptcore-rs-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ webkitgtk_4_1 ]; - }; - - nettle-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ nettle clang ]; - LIBCLANG_PATH = "${lib.getLib llvmPackages.libclang}/lib"; - }; - - openssl = attrs: { - buildInputs = [ openssl ]; - }; - - openssl-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ openssl ]; - }; - - opentelemetry-proto = attrs: { - nativeBuildInputs = [ protobuf ]; - }; - - pam-sys = attr: { - buildInputs = [ linux-pam ]; - }; - - pango-sys = attr: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ pango ]; - }; - - pq-sys = attr: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ postgresql ]; - }; - - prost-build = attr: { - nativeBuildInputs = [ protobuf ]; - }; - - prost-wkt-types = attr: { - nativeBuildInputs = [ protobuf ]; - }; - - rdkafka-sys = attr: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ rdkafka ]; - }; - - rink = attrs: { - buildInputs = [ gmp ]; - crateBin = [{ name = "rink"; path = "src/bin/rink.rs"; }]; - }; - - security-framework-sys = attr: { - propagatedBuildInputs = lib.optional stdenv.hostPlatform.isDarwin Security; - }; - - sequoia-openpgp = attrs: { - buildInputs = [ gmp ]; - }; - - sequoia-openpgp-ffi = attrs: { - buildInputs = [ gmp ]; - }; - - sequoia-ipc = attrs: { - buildInputs = [ gmp ]; - }; - - sequoia-guide = attrs: { - buildInputs = [ gmp ]; - }; - - pangocairo-sys = attr: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ pango ]; - }; - - sequoia-store = attrs: { - nativeBuildInputs = [ capnproto ]; - buildInputs = [ sqlite gmp ]; - }; - - sequoia-sq = attrs: { - buildInputs = [ sqlite gmp ]; - }; - - sequoia-tool = attrs: { - nativeBuildInputs = [ capnproto ]; - buildInputs = [ sqlite gmp ]; - }; - - serde_derive = attrs: { - buildInputs = lib.optional stdenv.hostPlatform.isDarwin Security; - }; - - servo-fontconfig-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ freetype fontconfig ]; - }; - - soup3-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ libsoup_3 ]; - extraLinkFlags = [ "-L${zlib.out}/lib" ]; - }; - - thrussh-libsodium = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ libsodium ]; - }; - - tonic-reflection = attrs: { - nativeBuildInputs = [ protobuf ]; - }; - - webkit2gtk-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ webkitgtk_4_1 ]; - extraLinkFlags = [ "-L${zlib.out}/lib" ]; - }; - - xcb = attrs: { - buildInputs = [ python3 ]; - }; - - atk-sys = attrs: { - nativeBuildInputs = [ pkg-config ]; - buildInputs = [ atk ]; - }; - - # Assumes it can run Command::new(env::var("CARGO")).arg("locate-project") - # https://github.com/bkchr/proc-macro-crate/blame/master/src/lib.rs#L244 - proc-macro-crate = attrs: lib.optionalAttrs (lib.versionAtLeast attrs.version "2.0") { - prePatch = (attrs.prePatch or "") + '' - substituteInPlace \ - src/lib.rs \ - --replace-fail \ - 'env::var("CARGO").map_err(|_| Error::CargoEnvVariableNotSet)?' \ - '"${lib.getBin buildPackages.cargo}/bin/cargo"' - ''; - }; -} diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix index 5f5e1bc07ba53..3b6685ba7d922 100644 --- a/pkgs/test/default.nix +++ b/pkgs/test/default.nix @@ -148,7 +148,6 @@ with pkgs; __recurseIntoDerivationForReleaseJobs = true; }; - buildRustCrate = callPackage ../build-support/rust/build-rust-crate/test { }; importCargoLock = callPackage ../build-support/rust/test/import-cargo-lock { }; vim = callPackage ./vim { }; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 69c43cafe524f..8d67a83f55d0b 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -180,6 +180,7 @@ mapAliases { buildFHSUserEnv = lib.warnOnInstantiate "'buildFHSUserEnv' has been renamed to 'buildFHSEnv' and will be removed in 25.11" buildFHSEnv; buildFHSUserEnvChroot = lib.warnOnInstantiate "'buildFHSUserEnvChroot' has been renamed to 'buildFHSEnvChroot' and will be removed in 25.11" buildFHSEnvChroot; buildFHSUserEnvBubblewrap = lib.warnOnInstantiate "'buildFHSUserEnvBubblewrap' has been renamed to 'buildFHSEnvBubblewrap' and will be removed in 25.11" buildFHSEnvBubblewrap; + buildRustCrate = throw "'buildRustCrate' has been removed from nixpkgs and will be maintained out of tree"; # Added 2025-01-14 # bitwarden_rs renamed to vaultwarden with release 1.21.0 (2021-04-30) bitwarden_rs = vaultwarden; @@ -295,6 +296,7 @@ mapAliases { deadpixi-sam = deadpixi-sam-unstable; debugedit-unstable = throw "'debugedit-unstable' has been renamed to/replaced by 'debugedit'"; # Converted to throw 2024-10-17 + defaultCrateOverrides = throw "'defaultCrateOverrides' have been removed from nixpkgs and will be maintained out of tree"; # Added 2025-01-14 deltachat-electron = throw "'deltachat-electron' has been renamed to/replaced by 'deltachat-desktop'"; # Converted to throw 2024-10-17 demjson = with python3Packages; toPythonApplication demjson; # Added 2022-01-18 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 68b022b96e8f6..cff73b955577b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6644,20 +6644,6 @@ with pkgs; makeRustPlatform = callPackage ../development/compilers/rust/make-rust-platform.nix { }; - buildRustCrate = - let - # Returns a true if the builder's rustc was built with support for the target. - targetAlreadyIncluded = lib.elem stdenv.hostPlatform.rust.rustcTarget - (lib.splitString "," (lib.removePrefix "--target=" ( - lib.elemAt (lib.filter (f: lib.hasPrefix "--target=" f) pkgsBuildBuild.rustc.unwrapped.configureFlags) 0 - ))); - in - callPackage ../build-support/rust/build-rust-crate ({ } // lib.optionalAttrs (stdenv.hostPlatform.libc == null) { - stdenv = stdenvNoCC; # Some build targets without libc will fail to evaluate with a normal stdenv. - } // lib.optionalAttrs targetAlreadyIncluded { inherit (pkgsBuildBuild) rustc cargo; } # Optimization. - ); - buildRustCrateHelpers = callPackage ../build-support/rust/build-rust-crate/helpers.nix { }; - cargo-web = callPackage ../development/tools/rust/cargo-web { inherit (darwin.apple_sdk.frameworks) CoreServices Security; }; @@ -6667,8 +6653,6 @@ with pkgs; inherit (linuxPackages) perf; }; - defaultCrateOverrides = callPackage ../build-support/rust/default-crate-overrides.nix { }; - cargo-audit = callPackage ../development/tools/rust/cargo-audit { inherit (darwin.apple_sdk.frameworks) Security SystemConfiguration; };