From 38144352c18068ed65c429218b14eac70f3eb892 Mon Sep 17 00:00:00 2001 From: GrandAdmiralBee Date: Tue, 16 Jun 2026 13:21:53 +0300 Subject: [PATCH 1/5] docs: add PR template --- .github/pull_request_template.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..f336a9fbd --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +## Goal + + +## Changes +- + +## Testing + + +## Checklist +- [ ] Title is a clear sentence (≤ 70 chars) +- [ ] Commits are signed (`git log --show-signature`) +- [ ] `submissions/labN.md` updated From 0a23580b0d23fcb07f12381d8c7948e33096b384 Mon Sep 17 00:00:00 2001 From: GrandAdmiralBee Date: Tue, 16 Jun 2026 13:22:22 +0300 Subject: [PATCH 2/5] env: add nix devenv files --- .devenv/bash-bash | 1 + .devenv/bootstrap/bootstrapLib.nix | 571 ++++ .devenv/bootstrap/default.nix | 19 + .devenv/bootstrap/resolve-lock.nix | 157 ++ .devenv/gc/shell | 1 + .../gc/task-config-devenv-config-task-config | 1 + .devenv/imports.txt | 0 .devenv/input-paths.txt | 6 + .devenv/load-exports | 1 + .devenv/nix-eval-cache.db | Bin 0 -> 114688 bytes .devenv/nixpkgs-config-99f33fda17d41bc9.nix | 17 + .devenv/profile | 1 + .devenv/run | 1 + .devenv/shell-2e40cf41831d6351.sh | 2313 +++++++++++++++++ .devenv/shell-57d2e7b48bb8f8cf.sh | 2313 +++++++++++++++++ .devenv/shell-71ddd0fa90f49aae.sh | 2313 +++++++++++++++++ .devenv/shell-92a0ad1c011413a7.sh | 2313 +++++++++++++++++ .devenv/state/files.json | 1 + .devenv/state/tasks.db | Bin 0 -> 36864 bytes .devenv/task-names.txt | 5 + .envrc | 14 + devenv.lock | 65 + devenv.nix | 21 + devenv.yaml | 3 + 24 files changed, 10137 insertions(+) create mode 120000 .devenv/bash-bash create mode 100644 .devenv/bootstrap/bootstrapLib.nix create mode 100644 .devenv/bootstrap/default.nix create mode 100644 .devenv/bootstrap/resolve-lock.nix create mode 120000 .devenv/gc/shell create mode 120000 .devenv/gc/task-config-devenv-config-task-config create mode 100644 .devenv/imports.txt create mode 100644 .devenv/input-paths.txt create mode 100755 .devenv/load-exports create mode 100644 .devenv/nix-eval-cache.db create mode 100644 .devenv/nixpkgs-config-99f33fda17d41bc9.nix create mode 120000 .devenv/profile create mode 120000 .devenv/run create mode 100755 .devenv/shell-2e40cf41831d6351.sh create mode 100755 .devenv/shell-57d2e7b48bb8f8cf.sh create mode 100755 .devenv/shell-71ddd0fa90f49aae.sh create mode 100755 .devenv/shell-92a0ad1c011413a7.sh create mode 100644 .devenv/state/files.json create mode 100644 .devenv/state/tasks.db create mode 100644 .devenv/task-names.txt create mode 100644 .envrc create mode 100644 devenv.lock create mode 100644 devenv.nix create mode 100644 devenv.yaml diff --git a/.devenv/bash-bash b/.devenv/bash-bash new file mode 120000 index 000000000..44874b719 --- /dev/null +++ b/.devenv/bash-bash @@ -0,0 +1 @@ +/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9 \ No newline at end of file diff --git a/.devenv/bootstrap/bootstrapLib.nix b/.devenv/bootstrap/bootstrapLib.nix new file mode 100644 index 000000000..74505d417 --- /dev/null +++ b/.devenv/bootstrap/bootstrapLib.nix @@ -0,0 +1,571 @@ +# Shared library functions for devenv evaluation +{ inputs }: + +rec { + # Helper to get overlays for a given input + getOverlays = + inputName: inputAttrs: + let + lib = inputs.nixpkgs.lib; + in + map + ( + overlay: + let + input = + inputs.${inputName} or (throw "No such input `${inputName}` while trying to configure overlays."); + in + input.overlays.${overlay} + or (throw "Input `${inputName}` has no overlay called `${overlay}`. Supported overlays: ${lib.concatStringsSep ", " (builtins.attrNames input.overlays)}") + ) inputAttrs.overlays or [ ]; + + # Main function to create devenv configuration for a specific system with profiles support + # This is the full-featured version used by default.nix + mkDevenvForSystem = + { version + , is_development_version ? false + , system + , devenv_root + , git_root ? null + , devenv_dotfile + , devenv_dotfile_path + , devenv_tmpdir + , devenv_runtime + , devenv_state ? null + , devenv_istesting ? false + , devenv_direnvrc_latest_version + , container_name ? null + , active_profiles ? [ ] + , hostname + , username + , cli_options ? [ ] + , skip_local_src ? false + , secretspec ? null + , devenv_inputs ? { } + , devenv_imports ? [ ] + , impure ? false + , nixpkgs_config ? { } + , lock_fingerprint ? null + , primops ? { } + }: + let + inherit (inputs) nixpkgs; + lib = nixpkgs.lib; + targetSystem = system; + + overlays = lib.flatten (lib.mapAttrsToList getOverlays devenv_inputs); + + # Helper to create pkgs for a given system with nixpkgs_config + mkPkgsForSystem = + evalSystem: + import nixpkgs { + system = evalSystem; + config = nixpkgs_config // { + allowUnfreePredicate = + if nixpkgs_config.allowUnfree or false then + (_: true) + else if (nixpkgs_config.permittedUnfreePackages or [ ]) != [ ] then + (pkg: builtins.elem (lib.getName pkg) (nixpkgs_config.permittedUnfreePackages or [ ])) + else + (_: false); + allowInsecurePredicate = + if (nixpkgs_config.permittedInsecurePackages or [ ]) != [ ] then + (pkg: builtins.elem (lib.getName pkg) (nixpkgs_config.permittedInsecurePackages or [ ])) + else + (_: false); + } // lib.optionalAttrs ((nixpkgs_config.allowlistedLicenses or [ ]) != [ ]) { + allowlistedLicenses = map (name: lib.licenses.${name}) (nixpkgs_config.allowlistedLicenses or [ ]); + } // lib.optionalAttrs ((nixpkgs_config.blocklistedLicenses or [ ]) != [ ]) { + blocklistedLicenses = map (name: lib.licenses.${name}) (nixpkgs_config.blocklistedLicenses or [ ]); + }; + inherit overlays; + }; + + pkgsBootstrap = mkPkgsForSystem targetSystem; + + # Helper to import a path, trying .nix first then /devenv.nix + # Returns a list of modules, including devenv.local.nix when present + tryImport = + resolvedPath: basePath: + if lib.hasSuffix ".nix" basePath then + [ (import resolvedPath) ] + else + let + devenvpath = resolvedPath + "/devenv.nix"; + localpath = resolvedPath + "/devenv.local.nix"; + in + if builtins.pathExists devenvpath then + [ (import devenvpath) ] ++ lib.optional (builtins.pathExists localpath) (import localpath) + else + throw (basePath + "/devenv.nix file does not exist"); + + importModule = + path: + if lib.hasPrefix "path:" path then + # path: prefix indicates a local filesystem path - strip it and import directly + let + actualPath = builtins.substring 5 999999 path; + in + tryImport (/. + actualPath) path + else if lib.hasPrefix "/" path then + # Absolute path - import directly (avoids input resolution and NAR hash computation) + tryImport (/. + path) path + else if lib.hasPrefix "./" path then + # Relative paths are relative to devenv_root, not bootstrap directory + let + relPath = builtins.substring 1 255 path; + in + tryImport (/. + devenv_root + relPath) path + else if lib.hasPrefix "../" path then + # Parent relative paths also relative to devenv_root + tryImport (/. + devenv_root + "/${path}") path + else + let + paths = lib.splitString "/" path; + name = builtins.head paths; + input = inputs.${name} or (throw "Unknown input ${name}"); + subpath = "/${lib.concatStringsSep "/" (builtins.tail paths)}"; + devenvpath = input + subpath; + in + tryImport devenvpath path; + + # Common modules shared between main evaluation and cross-system evaluation + mkCommonModules = + evalPkgs: + [ + ( + { config, ... }: + { + _module.args.pkgs = evalPkgs.appendOverlays (config.overlays or [ ]); + _module.args.secretspec = secretspec; + _module.args.devenvPrimops = primops; + } + ) + (inputs.devenv.modules + /top-level.nix) + ( + { options, ... }: + { + config.devenv = lib.mkMerge [ + { + root = devenv_root; + dotfile = devenv_dotfile; + } + ( + if builtins.hasAttr "cli" options.devenv then + { + cli.version = version; + cli.isDevelopment = is_development_version; + } + else + { + cliVersion = version; + } + ) + (lib.optionalAttrs (builtins.hasAttr "tmpdir" options.devenv) { + tmpdir = devenv_tmpdir; + }) + (lib.optionalAttrs (builtins.hasAttr "isTesting" options.devenv) { + isTesting = devenv_istesting; + }) + (lib.optionalAttrs (builtins.hasAttr "runtime" options.devenv) { + runtime = devenv_runtime; + }) + (lib.optionalAttrs (builtins.hasAttr "state" options.devenv && devenv_state != null) { + state = lib.mkForce devenv_state; + }) + (lib.optionalAttrs (builtins.hasAttr "direnvrcLatestVersion" options.devenv) { + direnvrcLatestVersion = devenv_direnvrc_latest_version; + }) + ]; + } + ) + ( + { options, ... }: + { + config = lib.mkMerge [ + (lib.optionalAttrs (builtins.hasAttr "git" options) { + git.root = git_root; + }) + ]; + } + ) + (lib.optionalAttrs (container_name != null) { + container.isBuilding = lib.mkForce true; + containers.${container_name}.isBuilding = true; + }) + ] + ++ (lib.flatten (map importModule devenv_imports)) + ++ (if !skip_local_src then (importModule (devenv_root + "/devenv.nix")) else [ ]) + ++ [ + ( + let + localPath = devenv_root + "/devenv.local.nix"; + in + if builtins.pathExists localPath then import localPath else { } + ) + cli_options + ]; + + # Phase 1: Base evaluation to extract profile definitions + baseProject = lib.evalModules { + specialArgs = inputs // { + inherit inputs secretspec primops; + }; + modules = mkCommonModules pkgsBootstrap; + }; + + # Phase 2: Extract and apply profiles using extendModules with priority overrides + project = + let + # Build ordered list of profile names: hostname -> user -> manual + manualProfiles = active_profiles; + currentHostname = hostname; + currentUsername = username; + hostnameProfiles = lib.optional + ( + currentHostname != null + && currentHostname != "" + && builtins.hasAttr currentHostname (baseProject.config.profiles.hostname or { }) + ) "hostname.${currentHostname}"; + userProfiles = lib.optional + ( + currentUsername != null + && currentUsername != "" + && builtins.hasAttr currentUsername (baseProject.config.profiles.user or { }) + ) "user.${currentUsername}"; + + # Ordered list of profiles to activate + orderedProfiles = hostnameProfiles ++ userProfiles ++ manualProfiles; + + # Resolve profile extends with cycle detection + resolveProfileExtends = + profileName: visited: + if builtins.elem profileName visited then + throw "Circular dependency detected in profile extends: ${lib.concatStringsSep " -> " visited} -> ${profileName}" + else + let + profile = getProfileConfig profileName; + extends = profile.extends or [ ]; + newVisited = visited ++ [ profileName ]; + extendedProfiles = lib.flatten (map (name: resolveProfileExtends name newVisited) extends); + in + extendedProfiles ++ [ profileName ]; + + # Get profile configuration by name from baseProject + getProfileConfig = + profileName: + if lib.hasPrefix "hostname." profileName then + let + name = lib.removePrefix "hostname." profileName; + in + baseProject.config.profiles.hostname.${name} + else if lib.hasPrefix "user." profileName then + let + name = lib.removePrefix "user." profileName; + in + baseProject.config.profiles.user.${name} + else + let + availableProfiles = builtins.attrNames (baseProject.config.profiles or { }); + hostnameProfiles = map (n: "hostname.${n}") ( + builtins.attrNames (baseProject.config.profiles.hostname or { }) + ); + userProfiles = map (n: "user.${n}") (builtins.attrNames (baseProject.config.profiles.user or { })); + allAvailableProfiles = availableProfiles ++ hostnameProfiles ++ userProfiles; + in + baseProject.config.profiles.${profileName} + or (throw "Profile '${profileName}' not found. Available profiles: ${lib.concatStringsSep ", " allAvailableProfiles}"); + + # Fold over ordered profiles to build final list with extends + expandedProfiles = lib.foldl' + ( + acc: profileName: + let + allProfileNames = resolveProfileExtends profileName [ ]; + in + acc ++ allProfileNames + ) [ ] + orderedProfiles; + + # Map over expanded profiles and apply priorities + allPrioritizedModules = lib.imap0 + ( + index: profileName: + let + profilePriority = (lib.modules.defaultOverridePriority - 1) - index; + profileConfig = getProfileConfig profileName; + + typeNeedsOverride = + type: + if type == null then + false + else + let + typeName = type.name or type._type or ""; + + isLeafType = builtins.elem typeName [ + "str" + "int" + "bool" + "enum" + "path" + "package" + "float" + "anything" + ]; + in + if isLeafType then + true + else if typeName == "nullOr" then + let + innerType = + type.elemType + or (if type ? nestedTypes && type.nestedTypes ? elemType then type.nestedTypes.elemType else null); + in + if innerType != null then typeNeedsOverride innerType else false + else + false; + + pathNeedsOverride = + optionPath: + let + directOption = lib.attrByPath optionPath null baseProject.options; + in + if directOption != null && lib.isOption directOption then + typeNeedsOverride directOption.type + else if optionPath != [ ] then + let + parentPath = lib.init optionPath; + parentOption = lib.attrByPath parentPath null baseProject.options; + in + if parentOption != null && lib.isOption parentOption then + let + freeformType = parentOption.type.freeformType or parentOption.type.nestedTypes.freeformType or null; + elementType = + if freeformType ? elemType then + freeformType.elemType + else if freeformType ? nestedTypes && freeformType.nestedTypes ? elemType then + freeformType.nestedTypes.elemType + else + freeformType; + in + typeNeedsOverride elementType + else + false + else + false; + + applyModuleOverride = + config: + if builtins.isFunction config then + let + wrapper = args: applyOverrideRecursive (config args) [ ]; + in + lib.mirrorFunctionArgs config wrapper + else + applyOverrideRecursive config [ ]; + + applyOverrideRecursive = + config: optionPath: + if lib.isAttrs config && config ? _type then + config + else if lib.isAttrs config then + lib.mapAttrs (name: value: applyOverrideRecursive value (optionPath ++ [ name ])) config + else if pathNeedsOverride optionPath then + lib.mkOverride profilePriority config + else + config; + + prioritizedConfig = ( + profileConfig.module + // { + imports = lib.map + ( + importItem: + importItem + // { + imports = lib.map (nestedImport: applyModuleOverride nestedImport) (importItem.imports or [ ]); + } + ) + (profileConfig.module.imports or [ ]); + } + ); + in + prioritizedConfig + ) + expandedProfiles; + in + if allPrioritizedModules == [ ] then + baseProject + else + baseProject.extendModules { modules = allPrioritizedModules; }; + + config = project.config; + + # Apply config overlays to pkgs + pkgs = pkgsBootstrap.appendOverlays (config.overlays or [ ]); + + options = pkgs.nixosOptionsDoc { + options = builtins.removeAttrs project.options [ "_module" ]; + warningsAreErrors = false; + transformOptions = + let + isDocType = + v: + builtins.elem v [ + "literalDocBook" + "literalExpression" + "literalMD" + "mdDoc" + ]; + in + lib.attrsets.mapAttrs ( + _: v: + if v ? _type && isDocType v._type then + v.text + else if v ? _type && v._type == "derivation" then + v.name + else + v + ); + }; + + build = + options: config: + lib.concatMapAttrs + ( + name: option: + if lib.isOption option then + let + typeName = option.type.name or ""; + in + if + builtins.elem typeName [ + "output" + "outputOf" + ] + then + { + ${name} = config.${name}; + } + else + { } + else if builtins.isAttrs option && !lib.isDerivation option then + let + v = build option config.${name}; + in + if v != { } then { ${name} = v; } else { } + else + { } + ) + options; + + # Helper to evaluate devenv for a specific system (for cross-compilation, e.g. macOS building Linux containers) + evalForSystem = + evalSystem: + let + evalPkgs = mkPkgsForSystem evalSystem; + evalProject = lib.evalModules { + specialArgs = inputs // { + inherit inputs secretspec primops; + }; + modules = mkCommonModules evalPkgs; + }; + in + { + config = evalProject.config; + }; + + # All supported systems for cross-compilation (lazily evaluated) + allSystems = [ + "x86_64-linux" + "aarch64-linux" + "x86_64-darwin" + "aarch64-darwin" + ]; + + # Generate perSystem entries for all systems (only evaluated when accessed) + perSystemConfigs = lib.genAttrs allSystems ( + perSystem: if perSystem == targetSystem then { config = config; } else evalForSystem perSystem + ); + in + { + inherit + pkgs + config + options + project + ; + bash = pkgs.bash; + shell = config.shell; + optionsJSON = options.optionsJSON; + info = config.info; + ci = config.ciDerivation; + build = build project.options config; + devenv = { + # Backwards compatibility: wrap config in devenv attribute for code expecting devenv.config.* + config = config; + # perSystem structure for cross-compilation (e.g. macOS building Linux containers) + perSystem = perSystemConfigs; + }; + }; + + # Simplified devenv evaluation for inputs + # This is a lightweight version suitable for evaluating an input's devenv.nix + mkDevenvForInput = + { + # The input to evaluate (must have outPath and sourceInfo) + input + , # All resolved inputs (for specialArgs) + allInputs + , # System to evaluate for + system ? builtins.currentSystem + , # Nixpkgs to use (defaults to allInputs.nixpkgs) + nixpkgs ? allInputs.nixpkgs or (throw "nixpkgs input required") + , # Devenv modules (defaults to allInputs.devenv) + devenv ? allInputs.devenv or (throw "devenv input required") + , + }: + let + devenvPath = input.outPath + "/devenv.nix"; + hasDevenv = builtins.pathExists devenvPath; + in + if !hasDevenv then + throw '' + Input does not have a devenv.nix file. + Expected file at: ${devenvPath} + + To use this input's devenv configuration, the input must provide a devenv.nix file. + '' + else + let + pkgs = import nixpkgs { + inherit system; + config = { }; + }; + lib = pkgs.lib; + + project = lib.evalModules { + specialArgs = allInputs // { + inputs = allInputs; + secretspec = null; + }; + modules = [ + ( + { config, ... }: + { + _module.args.pkgs = pkgs.appendOverlays (config.overlays or [ ]); + } + ) + (devenv.outPath + "/src/modules/top-level.nix") + (import devenvPath) + ]; + }; + in + { + inherit pkgs; + config = project.config; + options = project.options; + inherit project; + }; +} diff --git a/.devenv/bootstrap/default.nix b/.devenv/bootstrap/default.nix new file mode 100644 index 000000000..7010be36d --- /dev/null +++ b/.devenv/bootstrap/default.nix @@ -0,0 +1,19 @@ +args@{ system +, # The project root (location of devenv.nix) + devenv_root +, ... +}: + +let + inherit + (import ./resolve-lock.nix { + src = devenv_root; + inherit system; + }) + inputs + ; + + bootstrapLib = import ./bootstrapLib.nix { inherit inputs; }; +in + +bootstrapLib.mkDevenvForSystem args diff --git a/.devenv/bootstrap/resolve-lock.nix b/.devenv/bootstrap/resolve-lock.nix new file mode 100644 index 000000000..fee5ebc33 --- /dev/null +++ b/.devenv/bootstrap/resolve-lock.nix @@ -0,0 +1,157 @@ +# Adapted from https://git.lix.systems/lix-project/flake-compat/src/branch/main/default.nix +{ src +, system ? builtins.currentSystem or "unknown-system" +, +}: + +let + lockFilePath = src + "/devenv.lock"; + + lockFile = builtins.fromJSON (builtins.readFile lockFilePath); + + rootSrc = { + lastModified = 0; + lastModifiedDate = formatSecondsSinceEpoch 0; + # *hacker voice*: it's definitely a store path, I promise (actually a + # nixlang path value, likely not pointing at the store). + outPath = src; + }; + + # Format number of seconds in the Unix epoch as %Y%m%d%H%M%S. + formatSecondsSinceEpoch = + t: + let + rem = x: y: x - x / y * y; + days = t / 86400; + secondsInDay = rem t 86400; + hours = secondsInDay / 3600; + minutes = (rem secondsInDay 3600) / 60; + seconds = rem t 60; + + # Courtesy of https://stackoverflow.com/a/32158604. + z = days + 719468; + era = (if z >= 0 then z else z - 146096) / 146097; + doe = z - era * 146097; + yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365; + y = yoe + era * 400; + doy = doe - (365 * yoe + yoe / 4 - yoe / 100); + mp = (5 * doy + 2) / 153; + d = doy - (153 * mp + 2) / 5 + 1; + m = mp + (if mp < 10 then 3 else -9); + y' = y + (if m <= 2 then 1 else 0); + + pad = s: if builtins.stringLength s < 2 then "0" + s else s; + in + "${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}${pad (toString minutes)}${pad (toString seconds)}"; + + allNodes = builtins.mapAttrs + ( + key: node: + let + sourceInfo = + if key == lockFile.root then + rootSrc + # Path inputs pointing to project root (path = ".") should use rootSrc + # to avoid fetchTree hashing the entire project directory + else if node.locked.type or null == "path" && node.locked.path or null == "." then + rootSrc + else + let + locked = node.locked; + isRelativePath = p: p != null && (builtins.substring 0 2 p == "./" || builtins.substring 0 3 p == "../"); + # Resolve relative paths against src + resolvedLocked = locked + // (if locked.type or null == "path" && isRelativePath (locked.path or null) + then { path = toString src + "/${locked.path}"; } + else { }) + // (if locked.type or null == "git" && isRelativePath (locked.url or null) + then { url = toString src + "/${locked.url}"; } + else { }); + in + builtins.fetchTree (node.info or { } // removeAttrs resolvedLocked [ "dir" ]); + + subdir = if key == lockFile.root then "" else node.locked.dir or ""; + + outPath = sourceInfo + ((if subdir == "" then "" else "/") + subdir); + + # Resolve a input spec into a node name. An input spec is + # either a node name, or a 'follows' path from the root + # node. + resolveInput = + inputSpec: if builtins.isList inputSpec then getInputByPath lockFile.root inputSpec else inputSpec; + + # Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the + # root node, returning the final node. + getInputByPath = + nodeName: path: + if path == [ ] then + nodeName + else + getInputByPath + # Since this could be a 'follows' input, call resolveInput. + (resolveInput lockFile.nodes.${nodeName}.inputs.${builtins.head path}) + (builtins.tail path); + + inputs = builtins.mapAttrs (inputName: inputSpec: allNodes.${resolveInput inputSpec}) ( + node.inputs or { } + ); + + # Only import flake.nix for non-root nodes (root doesn't need it) + flake = if key == lockFile.root then null else import (outPath + "/flake.nix"); + + outputs = if key == lockFile.root then { } else flake.outputs (inputs // { self = result; }); + + # Lazy devenv evaluation for this input + devenvEval = + let + bootstrapLib = import ./bootstrapLib.nix { inputs = inputs; }; + in + bootstrapLib.mkDevenvForInput { + input = { inherit outPath sourceInfo; }; + allInputs = inputs; + inherit system; + }; + + result = + outputs + // sourceInfo + // { + inherit outPath; + inherit inputs; + inherit outputs; + inherit sourceInfo; + _type = "flake"; + devenv = devenvEval; + }; + + nonFlakeResult = sourceInfo // { + inherit outPath; + inherit inputs; + inherit sourceInfo; + _type = "flake"; + devenv = devenvEval; + }; + + in + if node.flake or true && key != lockFile.root then + assert builtins.isFunction flake.outputs; + result + else + nonFlakeResult + ) + lockFile.nodes; + + result = + if !(builtins.pathExists lockFilePath) then + throw "${lockFilePath} does not exist" + else if lockFile.version >= 5 && lockFile.version <= 7 then + allNodes.${lockFile.root} + else + throw "lock file '${lockFilePath}' has unsupported version ${toString lockFile.version}"; + +in +{ + inputs = result.inputs or { } // { + self = result; + }; +} diff --git a/.devenv/gc/shell b/.devenv/gc/shell new file mode 120000 index 000000000..04508fd54 --- /dev/null +++ b/.devenv/gc/shell @@ -0,0 +1 @@ +/nix/store/rzm9y544fhkplfr1lfz9z4wi31ari70m-devenv-shell \ No newline at end of file diff --git a/.devenv/gc/task-config-devenv-config-task-config b/.devenv/gc/task-config-devenv-config-task-config new file mode 120000 index 000000000..f03122cc8 --- /dev/null +++ b/.devenv/gc/task-config-devenv-config-task-config @@ -0,0 +1 @@ +/nix/store/67gwkyrn8qfd381zka7lgr23bm2d2v2a-tasks.json \ No newline at end of file diff --git a/.devenv/imports.txt b/.devenv/imports.txt new file mode 100644 index 000000000..e69de29bb diff --git a/.devenv/input-paths.txt b/.devenv/input-paths.txt new file mode 100644 index 000000000..501f75f01 --- /dev/null +++ b/.devenv/input-paths.txt @@ -0,0 +1,6 @@ +/home/karim/Dev/DevOps-Intro/.devenv/bootstrap/bootstrapLib.nix +/home/karim/Dev/DevOps-Intro/.devenv/bootstrap/default.nix +/home/karim/Dev/DevOps-Intro/devenv.lock +/home/karim/Dev/DevOps-Intro/devenv.nix +/home/karim/Dev/DevOps-Intro/devenv.yaml +/home/karim/Dev/DevOps-Intro/.env \ No newline at end of file diff --git a/.devenv/load-exports b/.devenv/load-exports new file mode 100755 index 000000000..8b1378917 --- /dev/null +++ b/.devenv/load-exports @@ -0,0 +1 @@ + diff --git a/.devenv/nix-eval-cache.db b/.devenv/nix-eval-cache.db new file mode 100644 index 0000000000000000000000000000000000000000..55f89414146465686fce880bf6e04dee43ad949c GIT binary patch literal 114688 zcmeI*4Rl-8eE@KMJiR9=v2Mth^Wg+VfhHc2{l4@*0-+?12nNRvw!=rD=)BKZu`D~1 z?AW24)Cq8U7##z8#!jItg%%E_l&EHl4>;Cu3 zu_fF2C`o$~^4E#(U($QJ@4nx?@5%S-U8U#pj(o*S`h%qbtCCa#^8%qz;G$$Q5D0|e z-URn~aF0zq<{%!v1rI+sN(=>BKKDUGtTiw{_*5YAgmxsH&9SYKTZQ~y&t-3ecMlJ_Rs~844V~Sl7c#jyd-2BY z9lgo59Ne>}xtZ?7#a-Rm_AQ-szt`69bTceXCcCp2XS=hV zZP}h$leKxby11(oHqwy={;mRO;KD}g8eO^lsENv7To123-4NSGz$)eV;yJTidom?~iyK1FHYrv~E zk7`=q#GtmE!D7WLR&sq-xsR^WcFD%>wVK*I)s$hS)2yk{ou=)qVKKC`^JcWOY8xA} zDt$RWUx0&{wYj{@s%vUtYK8iDPd2ov71q{e-#k8Vk_fv0}t>I5C zU3|;})gL#rm8gD=<_!yZTB4)1{i*Hes*Qi@g+&K8ED##cJ1=;%G}Zd27EkkBIJ5mv zt@}GW0P3m$+V}Lc6|J7HQ(e%IkoF=|eSsmOrS-6@rNDfX2HBb2&WvE$5*QLi#%}Z+! zpHG@U8R8pz(nmUka_|S|Xl@|Cvt(8BgT-=An*K_7e{)c1Os9i4M%dvrefjj~p}IqB z`cl>%N+w6VQW-Xv+|<4WTJrQGDw%Y>vQx?r(IU+}PbHK2V!2`!3UDmYID{jy&vW|A!vo2>W4ZcHZ`5;!X{mCw zKXbVFhkIS|<_0)i_=Yb8$b)24;-`t>L>Qjn4FymD1yBG5Pyhu`00mG01yJDkD6o?k zA{ixC2+to#a{~dVBHUgH2o?}7G*6hYH3MJist%^xLz^7a9yH3`Oxk+-|GDH z=gf1zSG+Cx!OBhG6ZH!tM&?s&{!+wj$~ zwk7i)`0(K4&z}?Y-t2hh(7_Gw+`i|~YoF^HT@-nr^Ee?QO>A*%cfc(T4yB#JfdQ-N zrrD6dESuS|^Yu&9&mX+~qCaTbyZfDU=AXUeiVF@7U)Z%{@&8;nddK!#S`QptcijWu zeDAYg`fTpGH~K$}-281fEJRu-HY475(S#r!3OV9d{^XI1|C+p7`Pq}Ht3Ta-&oeJ) zUwZ$Z;ivCjeDmGk{o~^D2S>j@KC*rIzSqu8JR{xkx1ATskqd5dLP8|Xw$k?xtKNS7 z@K%Z=@MRs0TF$a7pZUg%w=`||${!tazwuw+y8i9!u6%gQea-Lxr0}&%%;yePzWk*} z$A9|Rug=Lo{M75umO2N2@xa0n6bQNl6`;L(L~kueZ#O+Ib-RHZc3(YijI@fR7=jd zrlo2b(bOH$mtYzYOv`G4>%sl}&X$T*?w@$P-X6{uT*KCEE#uj`q-egP+ZoGMMNiA< zzF}u%-LXX1HeH&TYe=f(su|gq?2Mtiy6qaGlWHyIM_bEq9lF=5={xuIkClqXZr@c5 zX>Y%!7j~9p#U7Adc|^9-bnE37I%y!aOIrER__bUdc5~Hu!}uajHY``nIIe3Ow&>fo zq02@_ksL#`byqZD?+nk>3=?)vlP%d$Y)#ELhUrMArHD`(nDBM-cS*JP*!`+iRP9mS zv5nC^zQ40?WY?}Sf2^Pn$oVwgEPRz%@k*9c$&YyHOp7vP!tSkjaDOpOcdv20;XoVb z>oy1*8Ss@Ps6$a!6-`%FTa`so^E?nXY(tbJ#dSng@qF3LSdM1+rZ20$16%P5g%ho; z>r-xNBuBqCPOY!4IMtSl*50D-_YIV!vOVgQhW7Lq3tGRc7GXZ)P`cWP(yS0IkVk4= z3TA!Gl2d8#fH{^?Rll!)sNk2Rg1^_?tM17wl2yv<;y_(akPDqLII}#4W?33EYR$Fx z6s111wAaxJ1>G#E1xIyv*5{IjJW@B%_O#y*QSdbYzM9izOP5qtc2(E#6-PE)S<`h* z(LB|ZO;2+S8ICI5l1*E7EZb02S#~mxl!11oOO`irz|b$e^P`$2Lx~(mQZ?NW4cjtB z*>gnOG!;+NG~ZDb#kNh|lTFPweAu+7={9Ulv1D8G_3KkZmeX(T^y=L+CABzEG(c*P z;aieavenUD&WPde)2eJ{rG*@ z;U1v?3ZMWApa2S>01BW03ZMWAoE8FEZoDCQqJxwXmdl9_0dg#t6CG&_vs_Me_$ag) zTw*6WHiG^C)8ZJwLZSc)pa2S>01BW03ZMWApum|Rfc^hjFCRHM{eOD>e|&B*K%ORd zBz}|F-SBe5y$zq3`^a1cUc?&;pa2S>01BW03ZMWApuopVK#U84&S(S2we}4Tc&+_# z75zZ#W^aVvyN1f?_F|HqgJ~wZslaRxn8@M7W%!aN+b~x`RWq)nsJ`cBG)s5jMa%VJwuh|wmgsAS zW=axlcnRBO;kVi4!l2Wy!)yyn*A2r|b(mqH!LHj9%oA`mxRM^HpoE_xrIN2mG3k4@H6&7svE z9IU{9eq{}{(jOWuz-$w`Gc-#JY9nL13K;1I%t5e3n4w^cj;2YX>sWA^y&=JT8rSeN zMFl-YR!l{dv`ofv6g8tjaf+-+b2unc;G-1D^?Yl%P@$z!MOn5~BO@uED4I63AQzsA zt_1UdpqewXVZd}HQKVCsL{-&X)pBgfkUiOuVXhP9h0?5eaC~0)qXJD*b>wYYBu$lc z%TW!OH04PO%-nzpRIY8Smf?sQ+f{VkbVZn|;OTV6lVd5iqrjnH8FX@o%Gw$$k{%M^ z@S1jXP0XmGQ=x|Xca~cR;r}BjSYzed%2t9xp!ay+NUMV0>G%KfL^wcRAP*Ctd?NAl zL^$ziVt?X_MDxe%M2CBW0w{n2D1ZVefC4Ch0w{n2XS~3<;m+VO2Y=%0!q*;st(x(k z*m>a{$F(waXQRiPF&&5yq_BTn8BdOc@NkuU{OE5v_Si?{liYaVx6Pzxw1WF6g_u6R z5S|Wov@wCuns9Hdwo;F@GWP$^_~Rb|Pyhu`00mG01yBG5Pyhwa90BbAvmY=$%C!$4 z01BYMnIwSy|1+t!abHmY1yBG5Pyhu`00mG01yBG5Pyhu`00mG01yBG5 zPyhu`00mG01yBG5Pyhu`00mG01yBG5Pyhu`00mG01yBG5Pyhu`00mG01yBG5Pyhu` z00mG01yBG5PH}-Kl#jrD8Qhn{Jpp(6Ujv*4_XTjDKg(ly32!KX0w{n2D1ZVefC4Ch z0w{n2D1ZVefC4Ch0w{n2D1ZVefC4Ch0w{n2D1ZVefC4Ch0w{n2D1ZVefC4Ch0w{n2 zD1ZVefC4Ch0w{n2D1ZVefC4Ch0w{n2D1ZVdLx4{5PbEGKkPpZ^$jjt;@-O5E z3&NM;#;;;A$|qSA__JB$_?0Y%`4u#BF}{h#D8HOV zfnUZV$1i0u%rBua9OD~VjPi?F6!=9f#`%RTa{K}o!~A?2Loxm=7Nh(;76qQL$nyyn zBYXpk96y)EFh7UIP$Uj97K+5UKr9%GL}`dd1R8`0PXix`&;Th7TqI0GI1-{E#04S5 z;!rQC#GwHBko=mwO%9Tukr&9nk{^=4Cr^;?kgt=kkbB7I$*tr@@@Y~b1#&IvB^|^i zo5=-4CF{sJq=_sfa|s8T;0*;(00mG01yBG5Pyhu`00mG01x`T$feX_9f2taztEy2* zRwH+IHHKHR$i-GvW3;Inh2_=AEvv@xQWnFpCDj;htVUsRHO3cJBe$>`!wXmp#pYLI z^sH(W=2at4sxgwNMy{b6!*i=KG>7Mc(2tMvTr3!j#aM_&Sr7ykc%Fp_j0V6e9LGX9 z%t9!{aj}X1Ke;eK4w3iBuV4h=4e}~n1MqL;$K+Y^PjD5$6XY++H_6vv9N^E$pOQOZ zB;aQ98L}6~0*a)M*f1V&1=&U}h4Fw3Pr)k2BB1~Zpa2S>01BW03ZMWApa2S>z)28@ zgkb<7#nM$QO|tZCmae2Jw}PcjEM3mhWh`Av)9@0OHnMavOBb5uIGTiM5(&vrPHs90 zpqK>;pa2S>01BW03ZMWApa2S>01BK+0<@zYV;%n}>-Y<--a}m$6sI_f1Y*xBdp`kv5tRuqT^5d^Kn+F z7)_&5nhF901BW03ZMWApuj04utMMiL8*ZY_hj3;v%NjrvTeDEhr6T|52kone0~EL>TJJi z+htpNavM83x~|N1c6Ii2ZSQW&?vk4B+7=N4!A0Y+(j{G6v%cZ0z9N~nZYqwWIErFq zWY?1n+mk&@vt&!sJ%he%$%^kdmSak$;Yhx$%DS(5G{@x}Y&8uTZq8nj?Ytt_*45d& zvAr|fO&6{T^MM!?>BuG8*A)^1FJkl5iALoLL zf^2XivX~2|gENK|xF#-ke((qb3gH+RTNI=t3895tEFGIZ25@>2VrfwT1yBG5Pyhu` z00mG01yBG5Pyhu`00mG01yBG5Pyhu`00mG01yBG5PyhvH6R2MQ|Kj1_|NkZY4}h /dev/null)" ]; then + echo "Removing empty $srcParent/ and (possibly) its parents"; + rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; + fi; + done; + done +} +nixLog () +{ + + [[ -z ${NIX_LOG_FD-} ]] && return 0; + local callerName="${FUNCNAME[1]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" +} +_pruneLibtoolFiles () +{ + + if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then + return; + fi; + find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; +} +getHostRoleEnvHook () +{ + + getRole "$depHostOffset" +} +runOneHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook ret=1; + for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + if _eval "$hook" "$@"; then + ret=0; + break; + fi; + done; + return "$ret" +} +substituteAll () +{ + + local input="$1"; + local output="$2"; + local -a args=(); + _allFlags; + substitute "$input" "$output" "${args[@]}" +} +bintoolsWrapper_addLDVars () +{ + + local role_post; + getHostRoleEnvHook; + if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; + fi; + if [[ -d "$1/lib" ]]; then + local -a glob=($1/lib/lib*); + if [ "${#glob[*]}" -gt 0 ]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib"; + fi; + fi +} +fixupPhase () +{ + + local output; + for output in $(getAllOutputNames); + do + if [ -e "${!output}" ]; then + chmod -R u+w,u-s,g-s "${!output}"; + fi; + done; + runHook preFixup; + local output; + for output in $(getAllOutputNames); + do + prefix="${!output}" runHook fixupOutput; + done; + recordPropagatedDependencies; + if [ -n "${setupHook:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; + fi; + if [ -n "${setupHooks:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + local hook; + for hook in ${setupHooks[@]}; + do + local content; + consumeEntire content < "$hook"; + substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; + unset -v content; + done; + unset -v hook; + fi; + if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then + mkdir -p "${!outputBin}/nix-support"; + printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; + fi; + runHook postFixup +} +fixLibtool () +{ + + local search_path; + for flag in $NIX_LDFLAGS; + do + case $flag in + -L*) + search_path+=" ${flag#-L}" + ;; + esac; + done; + sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' +} +installPhase () +{ + + runHook preInstall; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom installPhase, doing nothing"; + runHook postInstall; + return; + else + foundMakefile=1; + fi; + if [ -n "$prefix" ]; then + mkdir -p "$prefix"; + fi; + local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; + echoCmd 'install flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + runHook postInstall +} +nixNoticeLog () +{ + + _nixLogWithLevel 2 "$*" +} +getHostRole () +{ + + getRole "$hostOffset" +} +noBrokenSymlinksInAllOutputs () +{ + + if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then + for output in $(getAllOutputNames); + do + noBrokenSymlinks "${!output}"; + done; + fi +} +_multioutDevs () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then + return; + fi; + moveToOutput include "${!outputInclude}"; + moveToOutput lib/pkgconfig "${!outputDev}"; + moveToOutput share/pkgconfig "${!outputDev}"; + moveToOutput lib/cmake "${!outputDev}"; + moveToOutput share/aclocal "${!outputDev}"; + for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; + do + echo "Patching '$f' includedir to output ${!outputInclude}"; + sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; + done +} +buildPhase () +{ + + runHook preBuild; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom buildPhase, doing nothing"; + else + foundMakefile=1; + local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; + echoCmd 'build flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postBuild +} +ccWrapper_addCVars () +{ + + local role_post; + getHostRoleEnvHook; + local found=; + if [ -d "$1/include" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; + found=1; + fi; + if [ -d "$1/Library/Frameworks" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; + found=1; + fi; + if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then + local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; + export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; + fi +} +concatTo () +{ + + local -; + set -o noglob; + local -n targetref="$1"; + shift; + local arg default name type; + for arg in "$@"; + do + IFS="=" read -r name default <<< "$arg"; + local -n nameref="$name"; + if [[ -z "${nameref[*]}" && -n "$default" ]]; then + targetref+=("$default"); + else + if type=$(declare -p "$name" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; + return 1 + ;; + -a*) + targetref+=("${nameref[@]}") + ;; + *) + if [[ "$name" = *"Array" ]]; then + nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; + targetref+=(${nameref+"${nameref[@]}"}); + else + targetref+=(${nameref-}); + fi + ;; + esac; + fi; + fi; + done +} +nixChattyLog () +{ + + _nixLogWithLevel 5 "$*" +} +prependToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=("$@" ${nameref+"${nameref[@]}"}); + else + nameref="$* ${nameref-}"; + fi +} +definePhases () +{ + + if [ -z "${phases[*]:-}" ]; then + phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; + fi +} +substituteInPlace () +{ + + local -a fileNames=(); + for arg in "$@"; + do + if [[ "$arg" = "--"* ]]; then + break; + fi; + fileNames+=("$arg"); + shift; + done; + if ! [[ "${#fileNames[@]}" -gt 0 ]]; then + echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; + return 1; + fi; + for file in "${fileNames[@]}"; + do + substitute "$file" "$file" "$@"; + done +} +nixVomitLog () +{ + + _nixLogWithLevel 7 "$*" +} +_addToEnv () +{ + + local depHostOffset depTargetOffset; + local pkg; + for depHostOffset in "${allPlatOffsets[@]}"; + do + local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; + local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; + for depTargetOffset in "${allPlatOffsets[@]}"; + do + (( depHostOffset <= depTargetOffset )) || continue; + local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; + if [[ -z "${strictDeps-}" ]]; then + local visitedPkgs=""; + for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; + do + if [[ "$visitedPkgs" = *"$pkg"* ]]; then + continue; + fi; + runHook "${!hookRef}" "$pkg"; + visitedPkgs+=" $pkg"; + done; + else + local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + runHook "${!hookRef}" "$pkg"; + done; + fi; + done; + done +} +addToSearchPath () +{ + + addToSearchPathWithCustomDelimiter ":" "$@" +} +_makeSymlinksRelative () +{ + + local prefixes; + prefixes=(); + for output in $(getAllOutputNames); + do + [ ! -e "${!output}" ] && continue; + prefixes+=("${!output}"); + done; + find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' + output="$1" + link="$2" + + linkTarget=$(readlink "$link") + + # only touch links that point inside the same output tree + [[ $linkTarget == "$output"/* ]] || exit 0 + + if [ ! -e "$linkTarget" ]; then + echo "the symlink $link is broken, it points to $linkTarget (which is missing)" + fi + + echo "making symlink relative: $link" + ln -snrf "$linkTarget" "$link" + ' _ +} +_multioutConfig () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then + return; + fi; + if [ -z "${shareDocName:-}" ]; then + local confScript="${configureScript:-}"; + if [ -z "$confScript" ] && [ -x ./configure ]; then + confScript=./configure; + fi; + if [ -f "$confScript" ]; then + local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; + fi; + if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then + shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; + fi; + fi; + prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; + prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal +} +_logHook () +{ + + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + local hookKind="$1"; + local hookExpr="$2"; + shift 2; + if declare -F "$hookExpr" > /dev/null 2>&1; then + nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; + else + if type -p "$hookExpr" > /dev/null; then + nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; + else + if [[ "$hookExpr" != "_callImplicitHook"* ]]; then + local exprToOutput; + if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then + exprToOutput="$hookExpr"; + else + local hookExprLine; + while IFS= read -r hookExprLine; do + hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; + if [[ -n "$hookExprLine" ]]; then + exprToOutput+="$hookExprLine\\n "; + fi; + done <<< "$hookExpr"; + exprToOutput="${exprToOutput%%\\n }"; + fi; + nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; + fi; + fi; + fi +} +distPhase () +{ + + runHook preDist; + local flagsArray=(); + concatTo flagsArray distFlags distFlagsArray distTarget=dist; + echo 'dist flags: %q' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + if [ "${dontCopyDist:-0}" != 1 ]; then + mkdir -p "$out/tarballs"; + cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; + fi; + runHook postDist +} +echoCmd () +{ + + printf "%s:" "$1"; + shift; + printf ' %q' "$@"; + echo +} +mapOffset () +{ + + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi +} +nixWarnLog () +{ + + _nixLogWithLevel 1 "$*" +} +_moveLib64 () +{ + + if [ "${dontMoveLib64-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then + return; + fi; + echo "moving $prefix/lib64/* to $prefix/lib"; + mkdir -p $prefix/lib; + shopt -s dotglob; + for i in $prefix/lib64/*; + do + mv --no-clobber "$i" $prefix/lib; + done; + shopt -u dotglob; + rmdir $prefix/lib64; + ln -s lib $prefix/lib64 +} +isMachO () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then + return 0; + else + return 1; + fi; + fi; + fi +} +isScript () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 2 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" =~ \#! ]]; then + return 0; + else + return 1; + fi +} +exitHandler () +{ + + exitCode="$?"; + set +e; + if [ -n "${showBuildStats:-}" ]; then + read -r -d '' -a buildTimes < <(times); + echo "build times:"; + echo "user time for the shell ${buildTimes[0]}"; + echo "system time for the shell ${buildTimes[1]}"; + echo "user time for all child processes ${buildTimes[2]}"; + echo "system time for all child processes ${buildTimes[3]}"; + fi; + if (( "$exitCode" != 0 )); then + runHook failureHook; + if [ -n "${succeedOnFailure:-}" ]; then + echo "build failed with exit code $exitCode (ignored)"; + mkdir -p "$out/nix-support"; + printf "%s" "$exitCode" > "$out/nix-support/failed"; + exit 0; + fi; + else + runHook exitHook; + fi; + return "$exitCode" +} +auditTmpdir () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "checking for references to $TMPDIR/ in $dir..."; + local tmpdir elf_fifo script_fifo; + tmpdir="$(mktemp -d)"; + elf_fifo="$tmpdir/elf"; + script_fifo="$tmpdir/script"; + mkfifo "$elf_fifo" "$script_fifo"; + ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do + if isELF "$file"; then + printf '%s\0' "$file" 1>&3; + else + if isScript "$file"; then + filename=${file##*/}; + dir=${file%/*}; + if [ -e "$dir/.$filename-wrapped" ]; then + printf '%s\0' "$file" 1>&4; + fi; + fi; + fi; + done; + exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then + echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$elf_fifo" ) & local pid_elf=$!; + local pid_script; + ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if grep -q -F "$TMPDIR/" "$1"; then + echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$script_fifo" ) & local pid_script=$!; + wait "$pid_elf" || { + echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + wait "$pid_script" || { + echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + rm -r "$tmpdir" +} +appendToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=(${nameref+"${nameref[@]}"} "$@"); + else + nameref="${nameref-} $*"; + fi +} +isELF () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [ "$magic" = 'ELF' ]; then + return 0; + else + return 1; + fi +} +_addRpathPrefix () +{ + + if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then + export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; + fi +} +_multioutDocs () +{ + + local REMOVE=REMOVE; + moveToOutput share/info "${!outputInfo}"; + moveToOutput share/doc "${!outputDoc}"; + moveToOutput share/gtk-doc "${!outputDevdoc}"; + moveToOutput share/devhelp/books "${!outputDevdoc}"; + moveToOutput share/man "${!outputMan}"; + moveToOutput share/man/man3 "${!outputDevman}" +} +configurePhase () +{ + + runHook preConfigure; + : "${configureScript=}"; + if [[ -z "$configureScript" && -x ./configure ]]; then + configureScript=./configure; + fi; + if [ -z "${dontFixLibtool:-}" ]; then + export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; + local i; + find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do + echo "fixing libtool script $i"; + fixLibtool "$i"; + done; + CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); + find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; + rm -f "$CONFIGURE_MTIME_REFERENCE"; + fi; + if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then + local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; + if [ "${prefixKeyOrDefault: -1}" = " " ]; then + prependToVar configureFlags "$prefix"; + prependToVar configureFlags "${prefixKeyOrDefault::-1}"; + else + prependToVar configureFlags "$prefixKeyOrDefault$prefix"; + fi; + fi; + if [[ -f "$configureScript" ]]; then + if [ -z "${dontAddDisableDepTrack:-}" ]; then + if grep -q dependency-tracking "$configureScript"; then + prependToVar configureFlags --disable-dependency-tracking; + fi; + fi; + if [ -z "${dontDisableStatic:-}" ]; then + if grep -q enable-static "$configureScript"; then + prependToVar configureFlags --disable-static; + fi; + fi; + if [ -z "${dontPatchShebangsInConfigure:-}" ]; then + patchShebangs --build "$configureScript"; + fi; + fi; + if [ -n "$configureScript" ]; then + local -a flagsArray; + concatTo flagsArray configureFlags configureFlagsArray; + echoCmd 'configure flags' "${flagsArray[@]}"; + $configureScript "${flagsArray[@]}"; + unset flagsArray; + else + echo "no configure script, doing nothing"; + fi; + runHook postConfigure +} +noBrokenSymlinks () +{ + + local -r output="${1:?}"; + local path; + local pathParent; + local symlinkTarget; + local -i numDanglingSymlinks=0; + local -i numReflexiveSymlinks=0; + local -i numUnreadableSymlinks=0; + if [[ ! -e $output ]]; then + nixWarnLog "skipping non-existent output $output"; + return 0; + fi; + nixInfoLog "running on $output"; + while IFS= read -r -d '' path; do + pathParent="$(dirname "$path")"; + if ! symlinkTarget="$(readlink "$path")"; then + nixErrorLog "the symlink $path is unreadable"; + numUnreadableSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget == /* ]]; then + nixInfoLog "symlink $path points to absolute target $symlinkTarget"; + else + nixInfoLog "symlink $path points to relative target $symlinkTarget"; + symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; + fi; + if [[ $symlinkTarget = "$TMPDIR"/* ]]; then + nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; + numDanglingSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then + nixInfoLog "symlink $path points outside the Nix store; ignoring"; + continue; + fi; + if [[ $path == "$symlinkTarget" ]]; then + nixErrorLog "the symlink $path is reflexive"; + numReflexiveSymlinks+=1; + else + if [[ ! -e $symlinkTarget ]]; then + nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; + numDanglingSymlinks+=1; + else + nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; + fi; + fi; + done < <(find "$output" -type l -print0); + if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then + nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; + exit 1; + fi; + return 0 +} +patchELF () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "shrinking RPATHs of ELF executables and libraries in $dir"; + local i; + while IFS= read -r -d '' i; do + if [[ "$i" =~ .build-id ]]; then + continue; + fi; + if ! isELF "$i"; then + continue; + fi; + echo "shrinking $i"; + patchelf --shrink-rpath "$i" || true; + done < <(find "$dir" -type f -print0) +} +_callImplicitHook () +{ + + local def="$1"; + local hookName="$2"; + if declare -F "$hookName" > /dev/null; then + nixTalkativeLog "calling implicit '$hookName' function hook"; + "$hookName"; + else + if type -p "$hookName" > /dev/null; then + nixTalkativeLog "sourcing implicit '$hookName' script hook"; + source "$hookName"; + else + if [ -n "${!hookName:-}" ]; then + nixTalkativeLog "evaling implicit '$hookName' string hook"; + eval "${!hookName}"; + else + return "$def"; + fi; + fi; + fi +} +_moveSystemdUserUnits () +{ + + if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then + return; + fi; + if [ ! -e "${prefix:?}/lib/systemd/user" ]; then + return; + fi; + local source="$prefix/lib/systemd/user"; + local target="$prefix/share/systemd/user"; + echo "moving $source/* to $target"; + mkdir -p "$target"; + ( shopt -s dotglob; + for i in "$source"/*; + do + mv "$i" "$target"; + done ); + rmdir "$source"; + ln -s "$target" "$source" +} +patchShebangs () +{ + + local pathName; + local update=false; + while [[ $# -gt 0 ]]; do + case "$1" in + --host) + pathName=HOST_PATH; + shift + ;; + --build) + pathName=PATH; + shift + ;; + --update) + update=true; + shift + ;; + --) + shift; + break + ;; + -* | --*) + echo "Unknown option $1 supplied to patchShebangs" 1>&2; + return 1 + ;; + *) + break + ;; + esac; + done; + echo "patching script interpreter paths in $@"; + local f; + local oldPath; + local newPath; + local arg0; + local args; + local oldInterpreterLine; + local newInterpreterLine; + if [[ $# -eq 0 ]]; then + echo "No arguments supplied to patchShebangs" 1>&2; + return 0; + fi; + local f; + while IFS= read -r -d '' f; do + isScript "$f" || continue; + read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; + read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; + if [[ -z "${pathName:-}" ]]; then + if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then + pathName=HOST_PATH; + else + pathName=PATH; + fi; + fi; + if [[ "$oldPath" == *"/bin/env" ]]; then + if [[ $arg0 == "-S" ]]; then + arg0=${args%% *}; + [[ "$args" == *" "* ]] && args=${args#* } || args=; + newPath="$(PATH="${!pathName}" type -P "env" || true)"; + args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; + else + if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then + echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; + exit 1; + else + newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; + fi; + fi; + else + if [[ -z $oldPath ]]; then + oldPath="/bin/sh"; + fi; + newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; + args="$arg0 $args"; + fi; + newInterpreterLine="$newPath $args"; + newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; + if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then + if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then + echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; + escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; + timestamp=$(stat --printf "%y" "$f"); + tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); + sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; + local restoreReadOnly; + if [[ ! -w "$f" ]]; then + chmod +w "$f"; + restoreReadOnly=true; + fi; + cat "$tmpFile" > "$f"; + rm "$tmpFile"; + if [[ -n "${restoreReadOnly:-}" ]]; then + chmod -w "$f"; + fi; + touch --date "$timestamp" "$f"; + fi; + fi; + done < <(find "$@" -type f -perm -0100 -print0) +} +concatStringsSep () +{ + + local sep="$1"; + local name="$2"; + local type oldifs; + if type=$(declare -p "$name" 2> /dev/null); then + local -n nameref="$name"; + case "${type#* }" in + -A*) + echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; + return 1 + ;; + -a*) + local IFS="$(printf '\036')" + ;; + *) + local IFS=" " + ;; + esac; + local ifs_separated="${nameref[*]}"; + echo -n "${ifs_separated//"$IFS"/"$sep"}"; + fi +} +pkgConfigWrapper_addPkgConfigPath () +{ + + local role_post; + getHostRoleEnvHook; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" +} +getTargetRoleEnvHook () +{ + + getRole "$depTargetOffset" +} +printLines () +{ + + (( "$#" > 0 )) || return 0; + printf '%s\n' "$@" +} +printPhases () +{ + + definePhases; + local phase; + for phase in ${phases[*]}; + do + printf '%s\n' "$phase"; + done +} +nixDebugLog () +{ + + _nixLogWithLevel 6 "$*" +} +nixErrorLog () +{ + + _nixLogWithLevel 0 "$*" +} +printWords () +{ + + (( "$#" > 0 )) || return 0; + printf '%s ' "$@" +} +recordPropagatedDependencies () +{ + + declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); + declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); + local propagatedInputsIndex; + for propagatedInputsIndex in "${!flatVars[@]}"; + do + local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; + local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; + [[ -n "${!propagatedInputsSlice}" ]] || continue; + mkdir -p "${!outputDev}/nix-support"; + printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; + done +} +runPhase () +{ + + local curPhase="$*"; + if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then + return; + fi; + if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then + return; + fi; + if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then + return; + fi; + if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then + return; + fi; + if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then + return; + fi; + if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then + return; + fi; + showPhaseHeader "$curPhase"; + dumpVars; + local startTime endTime; + startTime=$(date +"%s"); + eval "${!curPhase:-$curPhase}"; + endTime=$(date +"%s"); + showPhaseFooter "$curPhase" "$startTime" "$endTime"; + if [ "$curPhase" = unpackPhase ]; then + [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; + cd -- "${sourceRoot:-.}"; + fi +} +_allFlags () +{ + + export system pname name version; + while IFS='' read -r varName; do + nixTalkativeLog "@${varName}@ -> ${!varName}"; + args+=("--subst-var" "$varName"); + done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') +} +substituteAllStream () +{ + + local -a args=(); + _allFlags; + substituteStream "$1" "$2" "${args[@]}" +} +_assignFirst () +{ + + local varName="$1"; + local _var; + local REMOVE=REMOVE; + shift; + for _var in "$@"; + do + if [ -n "${!_var-}" ]; then + eval "${varName}"="${_var}"; + return; + fi; + done; + echo; + echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; + echo " The following variables were all unset or empty:"; + echo " $*"; + if [ -z "${out:-}" ]; then + echo ' If you do not want an "out" output in your derivation, make sure to define'; + echo ' the other specific required outputs. This can be achieved by picking one'; + echo " of the above as an output."; + echo ' You do not have to remove "out" if you want to have a different default'; + echo ' output, because the first output is taken as a default.'; + echo; + fi; + return 1 +} +getTargetRole () +{ + + getRole "$targetOffset" +} +nixTalkativeLog () +{ + + _nixLogWithLevel 4 "$*" +} +sysconfigdataHook () +{ + + if [ "$1" = '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' ]; then + export _PYTHON_HOST_PLATFORM='linux-x86_64'; + export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; + fi +} +toPythonPath () +{ + + local paths="$1"; + local result=; + for i in $paths; + do + p="$i/lib/python3.13/site-packages"; + result="${result}${result:+:}$p"; + done; + echo $result +} +addToSearchPathWithCustomDelimiter () +{ + + local delimiter="$1"; + local varName="$2"; + local dir="$3"; + if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then + export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; + fi +} +updateAutotoolsGnuConfigScriptsPhase () +{ + + if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then + return; + fi; + for script in config.sub config.guess; + do + for f in $(find . -type f -name "$script"); + do + echo "Updating Autotools / GNU config script to a newer upstream version: $f"; + cp -f "/nix/store/kppfbp4x7mhfz1q5zswavxxxq71v2f7c-gnu-config-2024-01-01/$script" "$f"; + done; + done +} +addPythonPath () +{ + + addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.13/site-packages +} +showPhaseFooter () +{ + + local phase="$1"; + local startTime="$2"; + local endTime="$3"; + local delta=$(( endTime - startTime )); + (( delta < 30 )) && return; + local H=$((delta/3600)); + local M=$((delta%3600/60)); + local S=$((delta%60)); + echo -n "$phase completed in "; + (( H > 0 )) && echo -n "$H hours "; + (( M > 0 )) && echo -n "$M minutes "; + echo "$S seconds" +} +getAllOutputNames () +{ + + if [ -n "$__structuredAttrs" ]; then + echo "${!outputs[*]}"; + else + echo "$outputs"; + fi +} +stripHash () +{ + + local strippedName casematchOpt=0; + strippedName="$(basename -- "$1")"; + shopt -q nocasematch && casematchOpt=1; + shopt -u nocasematch; + if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then + echo "${strippedName:33}"; + else + echo "$strippedName"; + fi; + if (( casematchOpt )); then + shopt -s nocasematch; + fi +} +dumpVars () +{ + + if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then + local old_umask; + old_umask=$(umask); + umask 0077; + export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; + umask "$old_umask"; + fi +} +showPhaseHeader () +{ + + local phase="$1"; + echo "Running phase: $phase"; + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" +} +_multioutPropagateDev () +{ + + if [ "$(getAllOutputNames)" = "out" ]; then + return; + fi; + local outputFirst; + for outputFirst in $(getAllOutputNames); + do + break; + done; + local propagaterOutput="$outputDev"; + if [ -z "$propagaterOutput" ]; then + propagaterOutput="$outputFirst"; + fi; + if [ -z "${propagatedBuildOutputs+1}" ]; then + local po_dirty="$outputBin $outputInclude $outputLib"; + set +o pipefail; + propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; + set -o pipefail; + fi; + if [ -z "$propagatedBuildOutputs" ]; then + return; + fi; + mkdir -p "${!propagaterOutput}"/nix-support; + for output in $propagatedBuildOutputs; + do + echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; + done +} +substitute () +{ + + local input="$1"; + local output="$2"; + shift 2; + if [ ! -f "$input" ]; then + echo "substitute(): ERROR: file '$input' does not exist" 1>&2; + return 1; + fi; + local content; + consumeEntire content < "$input"; + if [ -e "$output" ]; then + chmod +w "$output"; + fi; + substituteStream content "file '$input'" "$@" > "$output" +} +getTargetRoleWrapper () +{ + + case $targetOffset in + -1) + export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 + ;; + 0) + export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 + ;; + 1) + export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 + ;; + *) + echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +runHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook; + for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + _eval "$hook" "$@"; + done; + return 0 +} +patchPhase () +{ + + runHook prePatch; + local -a patchesArray; + concatTo patchesArray patches; + local -a flagsArray; + concatTo flagsArray patchFlags=-p1; + for i in "${patchesArray[@]}"; + do + echo "applying patch $i"; + local uncompress=cat; + case "$i" in + *.gz) + uncompress="gzip -d" + ;; + *.bz2) + uncompress="bzip2 -d" + ;; + *.xz) + uncompress="xz -d" + ;; + *.lzma) + uncompress="lzma -d" + ;; + esac; + $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; + done; + runHook postPatch +} +stripDirs () +{ + + local cmd="$1"; + local ranlibCmd="$2"; + local paths="$3"; + local stripFlags="$4"; + local excludeFlags=(); + local pathsNew=; + [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; + [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; + local pattern; + if [ -n "${stripExclude:-}" ]; then + for pattern in "${stripExclude[@]}"; + do + excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); + done; + fi; + local p; + for p in ${paths}; + do + if [ -e "$prefix/$p" ]; then + pathsNew="${pathsNew} $prefix/$p"; + fi; + done; + paths=${pathsNew}; + if [ -n "${paths}" ]; then + echo "stripping (with command $cmd and flags $stripFlags) in $paths"; + local striperr; + striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; + find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; + [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); + rm "$striperr"; + find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; + fi +} +unpackFile () +{ + + curSrc="$1"; + echo "unpacking source archive $curSrc"; + if ! runOneHook unpackCmd "$curSrc"; then + echo "do not know how to unpack source archive $curSrc"; + exit 1; + fi +} +_doStrip () +{ + + local -ra flags=(dontStripHost dontStripTarget); + local -ra debugDirs=(stripDebugList stripDebugListTarget); + local -ra allDirs=(stripAllList stripAllListTarget); + local -ra stripCmds=(STRIP STRIP_FOR_TARGET); + local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); + stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; + stripDebugListTarget=${stripDebugListTarget[*]:-}; + stripAllList=${stripAllList[*]:-}; + stripAllListTarget=${stripAllListTarget[*]:-}; + local i; + for i in ${!stripCmds[@]}; + do + local -n flag="${flags[$i]}"; + local -n debugDirList="${debugDirs[$i]}"; + local -n allDirList="${allDirs[$i]}"; + local -n stripCmd="${stripCmds[$i]}"; + local -n ranlibCmd="${ranlibCmds[$i]}"; + if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then + continue; + fi; + stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; + stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; + done +} +unpackPhase () +{ + + runHook preUnpack; + if [ -z "${srcs:-}" ]; then + if [ -z "${src:-}" ]; then + echo 'variable $src or $srcs should point to the source'; + exit 1; + fi; + srcs="$src"; + fi; + local -a srcsArray; + concatTo srcsArray srcs; + local dirsBefore=""; + for i in *; + do + if [ -d "$i" ]; then + dirsBefore="$dirsBefore $i "; + fi; + done; + for i in "${srcsArray[@]}"; + do + unpackFile "$i"; + done; + : "${sourceRoot=}"; + if [ -n "${setSourceRoot:-}" ]; then + runOneHook setSourceRoot; + else + if [ -z "$sourceRoot" ]; then + for i in *; + do + if [ -d "$i" ]; then + case $dirsBefore in + *\ $i\ *) + + ;; + *) + if [ -n "$sourceRoot" ]; then + echo "unpacker produced multiple directories"; + exit 1; + fi; + sourceRoot="$i" + ;; + esac; + fi; + done; + fi; + fi; + if [ -z "$sourceRoot" ]; then + echo "unpacker appears to have produced no directories"; + exit 1; + fi; + echo "source root is $sourceRoot"; + if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then + chmod -R u+w -- "$sourceRoot"; + fi; + runHook postUnpack +} +consumeEntire () +{ + + if IFS='' read -r -d '' "$1"; then + echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; + return 1; + fi +} +activatePackage () +{ + + local pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + if [ -f "$pkg" ]; then + nixTalkativeLog "sourcing setup hook '$pkg'"; + source "$pkg"; + fi; + if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then + addToSearchPath _PATH "$pkg/bin"; + fi; + if (( hostOffset <= -1 )); then + addToSearchPath _XDG_DATA_DIRS "$pkg/share"; + fi; + if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then + addToSearchPath _HOST_PATH "$pkg/bin"; + fi; + if [[ -f "$pkg/nix-support/setup-hook" ]]; then + nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; + source "$pkg/nix-support/setup-hook"; + fi +} +updateSourceDateEpoch () +{ + + local path="$1"; + [[ $path == -* ]] && path="./$path"; + local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); + local time="${res[0]//\.[0-9]*/}"; + local newestFile="${res[1]}"; + if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then + echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; + export SOURCE_DATE_EPOCH="$time"; + local now="$(date +%s)"; + if [ "$time" -gt $((now - 60)) ]; then + echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; + fi; + fi +} +_moveSbin () +{ + + if [ "${dontMoveSbin-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then + return; + fi; + echo "moving $prefix/sbin/* to $prefix/bin"; + mkdir -p $prefix/bin; + shopt -s dotglob; + for i in $prefix/sbin/*; + do + mv "$i" $prefix/bin; + done; + shopt -u dotglob; + rmdir $prefix/sbin; + ln -s bin $prefix/sbin +} +_activatePkgs () +{ + + local hostOffset targetOffset; + local pkg; + for hostOffset in "${allPlatOffsets[@]}"; + do + local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; + for targetOffset in "${allPlatOffsets[@]}"; + do + (( hostOffset <= targetOffset )) || continue; + local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + activatePackage "$pkg" "$hostOffset" "$targetOffset"; + done; + done; + done +} +checkPhase () +{ + + runHook preCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom checkPhase, doing nothing"; + runHook postCheck; + return; + fi; + if [[ -z "${checkTarget:-}" ]]; then + if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then + checkTarget="check"; + else + if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then + checkTarget="test"; + fi; + fi; + fi; + if [[ -z "${checkTarget:-}" ]]; then + echo "no check/test target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; + echoCmd 'check flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postCheck +} +_updateSourceDateEpochFromSourceRoot () +{ + + if [ -n "$sourceRoot" ]; then + updateSourceDateEpoch "$sourceRoot"; + fi +} +_eval () +{ + + if declare -F "$1" > /dev/null 2>&1; then + "$@"; + else + eval "$1"; + fi +} +_overrideFirst () +{ + + if [ -z "${!1-}" ]; then + _assignFirst "$@"; + fi +} +addEnvHooks () +{ + + local depHostOffset="$1"; + shift; + local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; + local pkgHookVar; + for pkgHookVar in "${!pkgHookVarsSlice}"; + do + eval "${pkgHookVar}s"'+=("$@")'; + done +} +compressManPages () +{ + + local dir="$1"; + if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then + return; + fi; + echo "gzipping man pages under $dir/share/man/"; + find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; + find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do + local target; + target="$(readlink -f "$f")"; + if [ -f "$target".gz ]; then + ln -sf "$target".gz "$f".gz && rm "$f"; + fi; + done +} +patchShebangsAuto () +{ + + if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then + if [[ "$output" != out && "$output" = "$outputDev" ]]; then + patchShebangs --build "$prefix"; + else + patchShebangs --host "$prefix"; + fi; + fi +} +installCheckPhase () +{ + + runHook preInstallCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom installCheckPhase, doing nothing"; + else + if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then + echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; + echoCmd 'installcheck flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + fi; + runHook postInstallCheck +} +findInputs () +{ + + local -r pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + local varVar="${pkgAccumVarVars[hostOffset + 1]}"; + local varRef="$varVar[$((targetOffset - hostOffset))]"; + local var="${!varRef}"; + unset -v varVar varRef; + local varSlice="$var[*]"; + case " ${!varSlice-} " in + *" $pkg "*) + return 0 + ;; + esac; + unset -v varSlice; + eval "$var"'+=("$pkg")'; + if ! [ -e "$pkg" ]; then + echo "build input $pkg does not exist" 1>&2; + exit 1; + fi; + function mapOffset () + { + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi + }; + local relHostOffset; + for relHostOffset in "${allPlatOffsets[@]}"; + do + local files="${propagatedDepFilesVars[relHostOffset + 1]}"; + local hostOffsetNext; + mapOffset "$relHostOffset" hostOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + local relTargetOffset; + for relTargetOffset in "${allPlatOffsets[@]}"; + do + (( "$relHostOffset" <= "$relTargetOffset" )) || continue; + local fileRef="${files}[$relTargetOffset - $relHostOffset]"; + local file="${!fileRef}"; + unset -v fileRef; + local targetOffsetNext; + mapOffset "$relTargetOffset" targetOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + [[ -f "$pkg/nix-support/$file" ]] || continue; + local pkgNext; + read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; + for pkgNext in $pkgNext; + do + findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; + done; + done; + done +} +getRole () +{ + + case $1 in + -1) + role_post='_FOR_BUILD' + ;; + 0) + role_post='' + ;; + 1) + role_post='_FOR_TARGET' + ;; + *) + echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +nixInfoLog () +{ + + _nixLogWithLevel 3 "$*" +} +_moveToShare () +{ + + if [ -n "$__structuredAttrs" ]; then + if [ -z "${forceShare-}" ]; then + forceShare=(man doc info); + fi; + else + forceShare=(${forceShare:-man doc info}); + fi; + if [[ -z "$out" ]]; then + return; + fi; + for d in "${forceShare[@]}"; + do + if [ -d "$out/$d" ]; then + if [ -d "$out/share/$d" ]; then + echo "both $d/ and share/$d/ exist!"; + else + echo "moving $out/$d to $out/share/$d"; + mkdir -p $out/share; + mv $out/$d $out/share/; + fi; + fi; + done +} +_nixLogWithLevel () +{ + + [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; + local logLevel; + case "${1:?}" in + 0) + logLevel=ERROR + ;; + 1) + logLevel=WARN + ;; + 2) + logLevel=NOTICE + ;; + 3) + logLevel=INFO + ;; + 4) + logLevel=TALKATIVE + ;; + 5) + logLevel=CHATTY + ;; + 6) + logLevel=DEBUG + ;; + 7) + logLevel=VOMIT + ;; + *) + echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; + return 1 + ;; + esac; + local callerName="${FUNCNAME[2]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" +} +substituteStream () +{ + + local var=$1; + local description=$2; + shift 2; + while (( "$#" )); do + local replace_mode="$1"; + case "$1" in + --replace) + if ! "$_substituteStream_has_warned_replace_deprecation"; then + echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; + _substituteStream_has_warned_replace_deprecation=true; + fi; + replace_mode='--replace-warn' + ;& + --replace-quiet | --replace-warn | --replace-fail) + pattern="$2"; + replacement="$3"; + shift 3; + if ! [[ "${!var}" == *"$pattern"* ]]; then + if [ "$replace_mode" == --replace-warn ]; then + printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + else + if [ "$replace_mode" == --replace-fail ]; then + printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + return 1; + fi; + fi; + fi; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var) + local varName="$2"; + shift 2; + if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then + echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; + return 1; + fi; + if [ -z ${!varName+x} ]; then + echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; + return 1; + fi; + pattern="@$varName@"; + replacement="${!varName}"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var-by) + pattern="@$2@"; + replacement="$3"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; + shift 3 + ;; + *) + echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; + return 1 + ;; + esac; + done; + printf "%s" "${!var}" +} +substituteAllInPlace () +{ + + local fileName="$1"; + shift; + substituteAll "$fileName" "$fileName" "$@" +} +_defaultUnpack () +{ + + local fn="$1"; + local destination; + if [ -d "$fn" ]; then + destination="$(stripHash "$fn")"; + if [ -e "$destination" ]; then + echo "Cannot copy $fn to $destination: destination already exists!"; + echo "Did you specify two \"srcs\" with the same \"name\"?"; + return 1; + fi; + cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; + else + case "$fn" in + *.tar.xz | *.tar.lzma | *.txz) + ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; + true ) | tar xf - --mode=+w --warning=no-timestamp + ;; + *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) + tar xf "$fn" --mode=+w --warning=no-timestamp + ;; + *) + return 1 + ;; + esac; + fi +} +PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" +XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" + +eval "${shellHook:-}" +shopt -s expand_aliases + +exec /tmp/devenv-envlxtyGe/script \ No newline at end of file diff --git a/.devenv/shell-57d2e7b48bb8f8cf.sh b/.devenv/shell-57d2e7b48bb8f8cf.sh new file mode 100755 index 000000000..24a0f2aa9 --- /dev/null +++ b/.devenv/shell-57d2e7b48bb8f8cf.sh @@ -0,0 +1,2313 @@ +if [ -n "$PS1" ] && [ -e $HOME/.bashrc ]; then + source $HOME/.bashrc; +fi + +shopt -u expand_aliases +PATH=${PATH:-} +nix_saved_PATH="$PATH" +XDG_DATA_DIRS=${XDG_DATA_DIRS:-} +nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" +declare -a envHostTargetHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +DEVENV_TASK_FILE='/nix/store/67gwkyrn8qfd381zka7lgr23bm2d2v2a-tasks.json' +export DEVENV_TASK_FILE +preferLocalBuild='1' +export preferLocalBuild +IFS=' +' +depsHostHostPropagated='' +export depsHostHostPropagated +buildInputs='' +export buildInputs +outputLib='out' +outputDevdoc='REMOVE' +RANLIB='ranlib' +export RANLIB +declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelative' '_multioutPropagateDev' ) +DEVENV_RUNTIME='/run/user/1000/devenv-303d476' +export DEVENV_RUNTIME +PATH='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/bin:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/bin:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/bin:/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin:/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0/bin:/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0/bin:/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1/bin:/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0/bin:/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22/bin:/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1/bin:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/bin:/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1/bin:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/bin:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/bin:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/bin:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/bin:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/bin:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/bin:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/bin:/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin/bin:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/bin:/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin/bin:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/bin:/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin/bin:/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin/bin:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/bin:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/bin:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/bin:/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0/bin:/nix/store/sanx9fg8mry8mq92zhlm5qvb83qlxrlx-gcc-15.2.0/bin:/nix/store/pf30k3mg7n6bibc1k6609gyq7glk00k2-glibc-2.42-61-bin/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46/bin:/nix/store/p2vkw5s89ff1fs2d2rxqxiqil9s0jpcm-binutils-2.46/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' +export PATH +PKG_CONFIG='pkg-config' +export PKG_CONFIG +phases='buildPhase' +export phases +NIX_BUILD_CORES='4' +export NIX_BUILD_CORES +mesonFlags='' +export mesonFlags +defaultBuildInputs='' +STRIP='strip' +export STRIP +outputInfo='out' +declare -a envTargetTargetHooks=() +AS='as' +export AS +_substituteStream_has_warned_replace_deprecation='false' +name='devenv-shell-env' +export name +outputDev='out' +outputInclude='out' +HOST_PATH='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' +export HOST_PATH +declare -a pkgsTargetTarget=() +initialPath='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10 /nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0 /nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12 /nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9 /nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12 /nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0 /nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35 /nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14 /nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin /nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1 /nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9 /nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8 /nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin /nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45' +doCheck='' +export doCheck +declare -a envHostHostHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +declare -a pkgsBuildBuild=() +READELF='readelf' +export READELF +pkg='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' +NIX_HARDENING_ENABLE='bindnow format fortify fortify3 libcxxhardeningfast pic relro stackclashprotection stackprotector strictflexarrays1 strictoverflow zerocallusedregs' +export NIX_HARDENING_ENABLE +depsTargetTarget='' +export depsTargetTarget +outputs='out' +export outputs +GOTOOLDIR='/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin' +export GOTOOLDIR +declare -a preConfigureHooks=('_multioutConfig' ) +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +shellHook=' +export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}" + + +# Override temp directories that stdenv set to NIX_BUILD_TOP. +# Only reset those that still point to the Nix build dir; leave +# any user/CI-supplied value intact so child processes (e.g. +# `devenv processes wait`) compute the same runtime directory. +for var in TMP TMPDIR TEMP TEMPDIR; do + if [ -n "${!var-}" ] && [ "${!var}" = "${NIX_BUILD_TOP-}" ]; then + export "$var"=/tmp + fi +done +if [ -n "${NIX_BUILD_TOP-}" ]; then + unset NIX_BUILD_TOP +fi + +# set path to locales on non-NixOS Linux hosts +if [ -z "${LOCALE_ARCHIVE-}" ]; then + export LOCALE_ARCHIVE=/nix/store/sp7b84c2jnbskd6dm2n5splgipg9d1f0-glibc-locales-2.42-61/lib/locale/locale-archive +fi + + +# direnv helper +if [ ! type -p direnv &>/dev/null && -f .envrc ]; then + echo "An .envrc file was detected, but the direnv command is not installed." + echo "To use this configuration, please install direnv: https://direnv.net/docs/installation.html" +fi + +mkdir -p "$DEVENV_STATE" +if [ ! -L "$DEVENV_DOTFILE/profile" ] || [ "$(/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin/readlink $DEVENV_DOTFILE/profile)" != "/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile" ] +then + ln -snf /nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile "$DEVENV_DOTFILE/profile" +fi +unset HOST_PATH NIX_BUILD_CORES __structuredAttrs buildInputs buildPhase builder depsBuildBuild depsBuildBuildPropagated depsBuildTarget depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget depsTargetTargetPropagated dontAddDisableDepTrack doCheck doInstallCheck nativeBuildInputs out outputs patches phases preferLocalBuild propagatedBuildInputs propagatedNativeBuildInputs shell shellHook stdenv strictDeps + +mkdir -p /run/user/1000/devenv-303d476 +ln -snf /run/user/1000/devenv-303d476 /home/karim/Dev/DevOps-Intro/.devenv/run + + +export PATH=$GOPATH/bin:$PATH + +echo "✨ devenv 2.0.6 is out of date. Please update to 2.1.2: https://devenv.sh/getting-started/#installation" >&2 + + +# Check whether the direnv integration is out of date. +{ + if [[ ":${DIRENV_ACTIVE-}:" == *":/home/karim/Dev/DevOps-Intro:"* ]]; then + if [[ ! "${DEVENV_NO_DIRENVRC_OUTDATED_WARNING-}" == 1 && ! "${DEVENV_DIRENVRC_ROLLING_UPGRADE-}" == 1 ]]; then + if [[ ${DEVENV_DIRENVRC_VERSION:-0} -lt 2 ]]; then + direnv_line=$(grep --color=never -E "source_url.*cachix/devenv" .envrc || echo "") + + echo "✨ The direnv integration in your .envrc is out of date." + echo "" + echo -n "RECOMMENDED: devenv can now auto-upgrade the direnv integration. " + if [[ -n "$direnv_line" ]]; then + echo "To enable this feature, replace the following line in your .envrc:" + echo "" + echo " $direnv_line" + echo "" + echo "with:" + echo "" + echo " eval \"\$(devenv direnvrc)\"" + else + echo "To enable this feature, replace the \`source_url\` line that fetches the direnvrc integration in your .envrc with:" + echo "" + echo " eval \"$(devenv direnvrc)\"" + fi + echo "" + echo "If you prefer to continue managing the integration manually, follow the upgrade instructions at https://devenv.sh/integrations/direnv/." + echo "" + echo "To disable this message:" + echo "" + echo " Add the following environment to your .envrc before \`use devenv\`:" + echo "" + echo " export DEVENV_NO_DIRENVRC_OUTDATED_WARNING=1" + echo "" + echo " Or set the following option in your devenv configuration:" + echo "" + echo " devenv.warnOnNewVersion = false;" + echo "" + fi + fi + fi +} >&2 + +echo "── DevOps-Intro devenv ──" +go version +git --version +echo "QuickNotes: cd app && go run ." + +' +export shellHook +depsBuildBuildPropagated='' +export depsBuildBuildPropagated +depsBuildTarget='' +export depsBuildTarget +outputMan='out' +propagatedNativeBuildInputs='' +export propagatedNativeBuildInputs +declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) +OBJDUMP='objdump' +export OBJDUMP +preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' +outputBin='out' +PYTHONHASHSEED='0' +export PYTHONHASHSEED +PYTHONNOUSERSITE='1' +export PYTHONNOUSERSITE +depsBuildTargetPropagated='' +export depsBuildTargetPropagated +outputDoc='out' +NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +PKG_CONFIG_PATH='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/lib/pkgconfig:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/pkgconfig:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/lib/pkgconfig:/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/lib/pkgconfig:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/lib/pkgconfig:/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/lib/pkgconfig:/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/lib/pkgconfig:/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/lib/pkgconfig:/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/lib/pkgconfig:/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/lib/pkgconfig:/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/lib/pkgconfig:/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/lib/pkgconfig:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share/pkgconfig:/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/lib/pkgconfig:/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/lib/pkgconfig' +export PKG_CONFIG_PATH +NIX_CFLAGS_COMPILE=' -frandom-seed=86aa67916d -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include' +export NIX_CFLAGS_COMPILE +configureFlags='' +export configureFlags +AR='ar' +export AR +declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) +nativeBuildInputs='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev /nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2 /nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1 /nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0 /nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0 /nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0 /nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1 /nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0 /nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22 /nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1 /nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0 /nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12 /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev /nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0 /nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' +export nativeBuildInputs +declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) +declare -a unpackCmdHooks=('_defaultUnpack' ) +PYTHONPATH='/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/python3.13/site-packages' +export PYTHONPATH +NIX_LDFLAGS='-rpath /nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib' +export NIX_LDFLAGS +propagatedBuildInputs='' +export propagatedBuildInputs +declare -a envBuildHostHooks=('addPythonPath' 'sysconfigdataHook' ) +declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) +depsHostHost='' +export depsHostHost +LINENO='79' +declare -a pkgsBuildHost=('/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev' '/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9' '/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2' '/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1' '/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0' '/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0' '/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0' '/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1' '/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0' '/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22' '/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1' '/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0' '/nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev' '/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1' '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' '/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev' '/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev' '/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib' '/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0' '/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev' '/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib' '/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1' '/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev' '/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib' '/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1' '/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev' '/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0' '/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev' '/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0' '/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev' '/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin' '/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8' '/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev' '/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin' '/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1' '/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev' '/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26' '/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5' '/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev' '/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1' '/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev' '/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2' '/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev' '/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin' '/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7' '/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin' '/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0' '/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev' '/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin' '/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1' '/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0' '/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' '/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2' '/nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' '/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' ) +NIX_BINTOOLS='/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' +export NIX_BINTOOLS +XDG_DATA_DIRS='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/share:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/share:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/share:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/share:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/share:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/share:/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/share:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/share:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/share:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/share:/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/share:/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26/share:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/share:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share:/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/share:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/share:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/share:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/share:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/share' +export XDG_DATA_DIRS +builder='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export builder +patches='' +export patches +NIX_NO_SELF_RPATH='1' +DETERMINISTIC_BUILD='1' +export DETERMINISTIC_BUILD +DEVENV_PROFILE='/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile' +export DEVENV_PROFILE +STRINGS='strings' +export STRINGS +declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) +doInstallCheck='' +export doInstallCheck +system='x86_64-linux' +export system +NIX_CC='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' +export NIX_CC +dontAddDisableDepTrack='1' +export dontAddDisableDepTrack +DEVENV_TASKS='' +export DEVENV_TASKS +prefix='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' +strictDeps='' +export strictDeps +DEVENV_ROOT='/home/karim/Dev/DevOps-Intro' +export DEVENV_ROOT +cmakeFlags='' +export cmakeFlags +out='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' +export out +declare -a pkgsBuildTarget=() +OSTYPE='linux-gnu' +CC='gcc' +export CC +OPTERR='1' +depsTargetTargetPropagated='' +export depsTargetTargetPropagated +SIZE='size' +export SIZE +hardeningDisable='' +export hardeningDisable +MACHTYPE='x86_64-pc-linux-gnu' +PS4='+ ' +outputDevman='out' +depsBuildBuild='' +export depsBuildBuild +DEVENV_STATE='/home/karim/Dev/DevOps-Intro/.devenv/state' +export DEVENV_STATE +NIX_ENFORCE_NO_NATIVE='1' +export NIX_ENFORCE_NO_NATIVE +buildPhase='{ echo "------------------------------------------------------------"; + echo " WARNING: the existence of this path is not guaranteed."; + echo " It is an internal implementation detail for pkgs.mkShell."; + echo "------------------------------------------------------------"; + echo; + # Record all build inputs as runtime dependencies + export; +} >> "$out" +' +export buildPhase +stdenv='/nix/store/w708nqm6lvvikrq8d3x45g96hzfij0r8-stdenv-linux' +export stdenv +_PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu' +export _PYTHON_SYSCONFIGDATA_NAME +GOROOT='/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share/go/' +export GOROOT +BASH='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +declare -a envBuildTargetHooks=('addPythonPath' 'sysconfigdataHook' ) +_PYTHON_HOST_PLATFORM='linux-x86_64' +export _PYTHON_HOST_PLATFORM +declare -a pkgsHostTarget=() +DEVENV_DOTFILE='/home/karim/Dev/DevOps-Intro/.devenv' +export DEVENV_DOTFILE +CXX='g++' +export CXX +NM='nm' +export NM +GOTOOLCHAIN='local' +export GOTOOLCHAIN +SOURCE_DATE_EPOCH='315532800' +export SOURCE_DATE_EPOCH +shell='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export shell +OBJCOPY='objcopy' +export OBJCOPY +declare -a pkgsHostHost=() +HOSTTYPE='x86_64' +IN_NIX_SHELL='impure' +export IN_NIX_SHELL +SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export SHELL +CONFIG_SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export CONFIG_SHELL +OLDPWD='' +export OLDPWD +declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) +LD='ld' +export LD +defaultNativeBuildInputs='/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2 /nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' +declare -a envBuildBuildHooks=('addPythonPath' 'sysconfigdataHook' ) +__structuredAttrs='' +export __structuredAttrs +NIX_STORE='/nix/store' +export NIX_STORE +GOPATH='/home/karim/Dev/DevOps-Intro/.devenv/state/go' +export GOPATH +fixupPhase () +{ + + local output; + for output in $(getAllOutputNames); + do + if [ -e "${!output}" ]; then + chmod -R u+w,u-s,g-s "${!output}"; + fi; + done; + runHook preFixup; + local output; + for output in $(getAllOutputNames); + do + prefix="${!output}" runHook fixupOutput; + done; + recordPropagatedDependencies; + if [ -n "${setupHook:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; + fi; + if [ -n "${setupHooks:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + local hook; + for hook in ${setupHooks[@]}; + do + local content; + consumeEntire content < "$hook"; + substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; + unset -v content; + done; + unset -v hook; + fi; + if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then + mkdir -p "${!outputBin}/nix-support"; + printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; + fi; + runHook postFixup +} +printWords () +{ + + (( "$#" > 0 )) || return 0; + printf '%s ' "$@" +} +runHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook; + for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + _eval "$hook" "$@"; + done; + return 0 +} +printLines () +{ + + (( "$#" > 0 )) || return 0; + printf '%s\n' "$@" +} +addToSearchPathWithCustomDelimiter () +{ + + local delimiter="$1"; + local varName="$2"; + local dir="$3"; + if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then + export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; + fi +} +stripDirs () +{ + + local cmd="$1"; + local ranlibCmd="$2"; + local paths="$3"; + local stripFlags="$4"; + local excludeFlags=(); + local pathsNew=; + [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; + [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; + local pattern; + if [ -n "${stripExclude:-}" ]; then + for pattern in "${stripExclude[@]}"; + do + excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); + done; + fi; + local p; + for p in ${paths}; + do + if [ -e "$prefix/$p" ]; then + pathsNew="${pathsNew} $prefix/$p"; + fi; + done; + paths=${pathsNew}; + if [ -n "${paths}" ]; then + echo "stripping (with command $cmd and flags $stripFlags) in $paths"; + local striperr; + striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; + find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; + [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); + rm "$striperr"; + find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; + fi +} +substituteAll () +{ + + local input="$1"; + local output="$2"; + local -a args=(); + _allFlags; + substitute "$input" "$output" "${args[@]}" +} +_defaultUnpack () +{ + + local fn="$1"; + local destination; + if [ -d "$fn" ]; then + destination="$(stripHash "$fn")"; + if [ -e "$destination" ]; then + echo "Cannot copy $fn to $destination: destination already exists!"; + echo "Did you specify two \"srcs\" with the same \"name\"?"; + return 1; + fi; + cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; + else + case "$fn" in + *.tar.xz | *.tar.lzma | *.txz) + ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; + true ) | tar xf - --mode=+w --warning=no-timestamp + ;; + *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) + tar xf "$fn" --mode=+w --warning=no-timestamp + ;; + *) + return 1 + ;; + esac; + fi +} +_activatePkgs () +{ + + local hostOffset targetOffset; + local pkg; + for hostOffset in "${allPlatOffsets[@]}"; + do + local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; + for targetOffset in "${allPlatOffsets[@]}"; + do + (( hostOffset <= targetOffset )) || continue; + local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + activatePackage "$pkg" "$hostOffset" "$targetOffset"; + done; + done; + done +} +_doStrip () +{ + + local -ra flags=(dontStripHost dontStripTarget); + local -ra debugDirs=(stripDebugList stripDebugListTarget); + local -ra allDirs=(stripAllList stripAllListTarget); + local -ra stripCmds=(STRIP STRIP_FOR_TARGET); + local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); + stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; + stripDebugListTarget=${stripDebugListTarget[*]:-}; + stripAllList=${stripAllList[*]:-}; + stripAllListTarget=${stripAllListTarget[*]:-}; + local i; + for i in ${!stripCmds[@]}; + do + local -n flag="${flags[$i]}"; + local -n debugDirList="${debugDirs[$i]}"; + local -n allDirList="${allDirs[$i]}"; + local -n stripCmd="${stripCmds[$i]}"; + local -n ranlibCmd="${ranlibCmds[$i]}"; + if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then + continue; + fi; + stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; + stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; + done +} +_multioutPropagateDev () +{ + + if [ "$(getAllOutputNames)" = "out" ]; then + return; + fi; + local outputFirst; + for outputFirst in $(getAllOutputNames); + do + break; + done; + local propagaterOutput="$outputDev"; + if [ -z "$propagaterOutput" ]; then + propagaterOutput="$outputFirst"; + fi; + if [ -z "${propagatedBuildOutputs+1}" ]; then + local po_dirty="$outputBin $outputInclude $outputLib"; + set +o pipefail; + propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; + set -o pipefail; + fi; + if [ -z "$propagatedBuildOutputs" ]; then + return; + fi; + mkdir -p "${!propagaterOutput}"/nix-support; + for output in $propagatedBuildOutputs; + do + echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; + done +} +compressManPages () +{ + + local dir="$1"; + if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then + return; + fi; + echo "gzipping man pages under $dir/share/man/"; + find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; + find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do + local target; + target="$(readlink -f "$f")"; + if [ -f "$target".gz ]; then + ln -sf "$target".gz "$f".gz && rm "$f"; + fi; + done +} +_multioutDevs () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then + return; + fi; + moveToOutput include "${!outputInclude}"; + moveToOutput lib/pkgconfig "${!outputDev}"; + moveToOutput share/pkgconfig "${!outputDev}"; + moveToOutput lib/cmake "${!outputDev}"; + moveToOutput share/aclocal "${!outputDev}"; + for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; + do + echo "Patching '$f' includedir to output ${!outputInclude}"; + sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; + done +} +concatTo () +{ + + local -; + set -o noglob; + local -n targetref="$1"; + shift; + local arg default name type; + for arg in "$@"; + do + IFS="=" read -r name default <<< "$arg"; + local -n nameref="$name"; + if [[ -z "${nameref[*]}" && -n "$default" ]]; then + targetref+=("$default"); + else + if type=$(declare -p "$name" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; + return 1 + ;; + -a*) + targetref+=("${nameref[@]}") + ;; + *) + if [[ "$name" = *"Array" ]]; then + nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; + targetref+=(${nameref+"${nameref[@]}"}); + else + targetref+=(${nameref-}); + fi + ;; + esac; + fi; + fi; + done +} +definePhases () +{ + + if [ -z "${phases[*]:-}" ]; then + phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; + fi +} +prependToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=("$@" ${nameref+"${nameref[@]}"}); + else + nameref="$* ${nameref-}"; + fi +} +ccWrapper_addCVars () +{ + + local role_post; + getHostRoleEnvHook; + local found=; + if [ -d "$1/include" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; + found=1; + fi; + if [ -d "$1/Library/Frameworks" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; + found=1; + fi; + if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then + local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; + export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; + fi +} +_moveLib64 () +{ + + if [ "${dontMoveLib64-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then + return; + fi; + echo "moving $prefix/lib64/* to $prefix/lib"; + mkdir -p $prefix/lib; + shopt -s dotglob; + for i in $prefix/lib64/*; + do + mv --no-clobber "$i" $prefix/lib; + done; + shopt -u dotglob; + rmdir $prefix/lib64; + ln -s lib $prefix/lib64 +} +recordPropagatedDependencies () +{ + + declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); + declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); + local propagatedInputsIndex; + for propagatedInputsIndex in "${!flatVars[@]}"; + do + local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; + local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; + [[ -n "${!propagatedInputsSlice}" ]] || continue; + mkdir -p "${!outputDev}/nix-support"; + printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; + done +} +substituteAllStream () +{ + + local -a args=(); + _allFlags; + substituteStream "$1" "$2" "${args[@]}" +} +substituteInPlace () +{ + + local -a fileNames=(); + for arg in "$@"; + do + if [[ "$arg" = "--"* ]]; then + break; + fi; + fileNames+=("$arg"); + shift; + done; + if ! [[ "${#fileNames[@]}" -gt 0 ]]; then + echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; + return 1; + fi; + for file in "${fileNames[@]}"; + do + substitute "$file" "$file" "$@"; + done +} +installCheckPhase () +{ + + runHook preInstallCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom installCheckPhase, doing nothing"; + else + if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then + echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; + echoCmd 'installcheck flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + fi; + runHook postInstallCheck +} +_eval () +{ + + if declare -F "$1" > /dev/null 2>&1; then + "$@"; + else + eval "$1"; + fi +} +auditTmpdir () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "checking for references to $TMPDIR/ in $dir..."; + local tmpdir elf_fifo script_fifo; + tmpdir="$(mktemp -d)"; + elf_fifo="$tmpdir/elf"; + script_fifo="$tmpdir/script"; + mkfifo "$elf_fifo" "$script_fifo"; + ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do + if isELF "$file"; then + printf '%s\0' "$file" 1>&3; + else + if isScript "$file"; then + filename=${file##*/}; + dir=${file%/*}; + if [ -e "$dir/.$filename-wrapped" ]; then + printf '%s\0' "$file" 1>&4; + fi; + fi; + fi; + done; + exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then + echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$elf_fifo" ) & local pid_elf=$!; + local pid_script; + ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if grep -q -F "$TMPDIR/" "$1"; then + echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$script_fifo" ) & local pid_script=$!; + wait "$pid_elf" || { + echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + wait "$pid_script" || { + echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + rm -r "$tmpdir" +} +configurePhase () +{ + + runHook preConfigure; + : "${configureScript=}"; + if [[ -z "$configureScript" && -x ./configure ]]; then + configureScript=./configure; + fi; + if [ -z "${dontFixLibtool:-}" ]; then + export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; + local i; + find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do + echo "fixing libtool script $i"; + fixLibtool "$i"; + done; + CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); + find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; + rm -f "$CONFIGURE_MTIME_REFERENCE"; + fi; + if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then + local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; + if [ "${prefixKeyOrDefault: -1}" = " " ]; then + prependToVar configureFlags "$prefix"; + prependToVar configureFlags "${prefixKeyOrDefault::-1}"; + else + prependToVar configureFlags "$prefixKeyOrDefault$prefix"; + fi; + fi; + if [[ -f "$configureScript" ]]; then + if [ -z "${dontAddDisableDepTrack:-}" ]; then + if grep -q dependency-tracking "$configureScript"; then + prependToVar configureFlags --disable-dependency-tracking; + fi; + fi; + if [ -z "${dontDisableStatic:-}" ]; then + if grep -q enable-static "$configureScript"; then + prependToVar configureFlags --disable-static; + fi; + fi; + if [ -z "${dontPatchShebangsInConfigure:-}" ]; then + patchShebangs --build "$configureScript"; + fi; + fi; + if [ -n "$configureScript" ]; then + local -a flagsArray; + concatTo flagsArray configureFlags configureFlagsArray; + echoCmd 'configure flags' "${flagsArray[@]}"; + $configureScript "${flagsArray[@]}"; + unset flagsArray; + else + echo "no configure script, doing nothing"; + fi; + runHook postConfigure +} +_addToEnv () +{ + + local depHostOffset depTargetOffset; + local pkg; + for depHostOffset in "${allPlatOffsets[@]}"; + do + local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; + local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; + for depTargetOffset in "${allPlatOffsets[@]}"; + do + (( depHostOffset <= depTargetOffset )) || continue; + local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; + if [[ -z "${strictDeps-}" ]]; then + local visitedPkgs=""; + for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; + do + if [[ "$visitedPkgs" = *"$pkg"* ]]; then + continue; + fi; + runHook "${!hookRef}" "$pkg"; + visitedPkgs+=" $pkg"; + done; + else + local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + runHook "${!hookRef}" "$pkg"; + done; + fi; + done; + done +} +runOneHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook ret=1; + for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + if _eval "$hook" "$@"; then + ret=0; + break; + fi; + done; + return "$ret" +} +nixWarnLog () +{ + + _nixLogWithLevel 1 "$*" +} +_moveToShare () +{ + + if [ -n "$__structuredAttrs" ]; then + if [ -z "${forceShare-}" ]; then + forceShare=(man doc info); + fi; + else + forceShare=(${forceShare:-man doc info}); + fi; + if [[ -z "$out" ]]; then + return; + fi; + for d in "${forceShare[@]}"; + do + if [ -d "$out/$d" ]; then + if [ -d "$out/share/$d" ]; then + echo "both $d/ and share/$d/ exist!"; + else + echo "moving $out/$d to $out/share/$d"; + mkdir -p $out/share; + mv $out/$d $out/share/; + fi; + fi; + done +} +runPhase () +{ + + local curPhase="$*"; + if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then + return; + fi; + if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then + return; + fi; + if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then + return; + fi; + if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then + return; + fi; + if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then + return; + fi; + if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then + return; + fi; + showPhaseHeader "$curPhase"; + dumpVars; + local startTime endTime; + startTime=$(date +"%s"); + eval "${!curPhase:-$curPhase}"; + endTime=$(date +"%s"); + showPhaseFooter "$curPhase" "$startTime" "$endTime"; + if [ "$curPhase" = unpackPhase ]; then + [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; + cd -- "${sourceRoot:-.}"; + fi +} +patchShebangs () +{ + + local pathName; + local update=false; + while [[ $# -gt 0 ]]; do + case "$1" in + --host) + pathName=HOST_PATH; + shift + ;; + --build) + pathName=PATH; + shift + ;; + --update) + update=true; + shift + ;; + --) + shift; + break + ;; + -* | --*) + echo "Unknown option $1 supplied to patchShebangs" 1>&2; + return 1 + ;; + *) + break + ;; + esac; + done; + echo "patching script interpreter paths in $@"; + local f; + local oldPath; + local newPath; + local arg0; + local args; + local oldInterpreterLine; + local newInterpreterLine; + if [[ $# -eq 0 ]]; then + echo "No arguments supplied to patchShebangs" 1>&2; + return 0; + fi; + local f; + while IFS= read -r -d '' f; do + isScript "$f" || continue; + read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; + read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; + if [[ -z "${pathName:-}" ]]; then + if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then + pathName=HOST_PATH; + else + pathName=PATH; + fi; + fi; + if [[ "$oldPath" == *"/bin/env" ]]; then + if [[ $arg0 == "-S" ]]; then + arg0=${args%% *}; + [[ "$args" == *" "* ]] && args=${args#* } || args=; + newPath="$(PATH="${!pathName}" type -P "env" || true)"; + args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; + else + if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then + echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; + exit 1; + else + newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; + fi; + fi; + else + if [[ -z $oldPath ]]; then + oldPath="/bin/sh"; + fi; + newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; + args="$arg0 $args"; + fi; + newInterpreterLine="$newPath $args"; + newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; + if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then + if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then + echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; + escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; + timestamp=$(stat --printf "%y" "$f"); + tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); + sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; + local restoreReadOnly; + if [[ ! -w "$f" ]]; then + chmod +w "$f"; + restoreReadOnly=true; + fi; + cat "$tmpFile" > "$f"; + rm "$tmpFile"; + if [[ -n "${restoreReadOnly:-}" ]]; then + chmod -w "$f"; + fi; + touch --date "$timestamp" "$f"; + fi; + fi; + done < <(find "$@" -type f -perm -0100 -print0) +} +stripHash () +{ + + local strippedName casematchOpt=0; + strippedName="$(basename -- "$1")"; + shopt -q nocasematch && casematchOpt=1; + shopt -u nocasematch; + if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then + echo "${strippedName:33}"; + else + echo "$strippedName"; + fi; + if (( casematchOpt )); then + shopt -s nocasematch; + fi +} +updateSourceDateEpoch () +{ + + local path="$1"; + [[ $path == -* ]] && path="./$path"; + local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); + local time="${res[0]//\.[0-9]*/}"; + local newestFile="${res[1]}"; + if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then + echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; + export SOURCE_DATE_EPOCH="$time"; + local now="$(date +%s)"; + if [ "$time" -gt $((now - 60)) ]; then + echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; + fi; + fi +} +toPythonPath () +{ + + local paths="$1"; + local result=; + for i in $paths; + do + p="$i/lib/python3.13/site-packages"; + result="${result}${result:+:}$p"; + done; + echo $result +} +substitute () +{ + + local input="$1"; + local output="$2"; + shift 2; + if [ ! -f "$input" ]; then + echo "substitute(): ERROR: file '$input' does not exist" 1>&2; + return 1; + fi; + local content; + consumeEntire content < "$input"; + if [ -e "$output" ]; then + chmod +w "$output"; + fi; + substituteStream content "file '$input'" "$@" > "$output" +} +updateAutotoolsGnuConfigScriptsPhase () +{ + + if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then + return; + fi; + for script in config.sub config.guess; + do + for f in $(find . -type f -name "$script"); + do + echo "Updating Autotools / GNU config script to a newer upstream version: $f"; + cp -f "/nix/store/kppfbp4x7mhfz1q5zswavxxxq71v2f7c-gnu-config-2024-01-01/$script" "$f"; + done; + done +} +nixNoticeLog () +{ + + _nixLogWithLevel 2 "$*" +} +_multioutConfig () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then + return; + fi; + if [ -z "${shareDocName:-}" ]; then + local confScript="${configureScript:-}"; + if [ -z "$confScript" ] && [ -x ./configure ]; then + confScript=./configure; + fi; + if [ -f "$confScript" ]; then + local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; + fi; + if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then + shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; + fi; + fi; + prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; + prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal +} +nixErrorLog () +{ + + _nixLogWithLevel 0 "$*" +} +getTargetRoleEnvHook () +{ + + getRole "$depTargetOffset" +} +nixTalkativeLog () +{ + + _nixLogWithLevel 4 "$*" +} +pkgConfigWrapper_addPkgConfigPath () +{ + + local role_post; + getHostRoleEnvHook; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" +} +noBrokenSymlinksInAllOutputs () +{ + + if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then + for output in $(getAllOutputNames); + do + noBrokenSymlinks "${!output}"; + done; + fi +} +patchShebangsAuto () +{ + + if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then + if [[ "$output" != out && "$output" = "$outputDev" ]]; then + patchShebangs --build "$prefix"; + else + patchShebangs --host "$prefix"; + fi; + fi +} +checkPhase () +{ + + runHook preCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom checkPhase, doing nothing"; + runHook postCheck; + return; + fi; + if [[ -z "${checkTarget:-}" ]]; then + if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then + checkTarget="check"; + else + if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then + checkTarget="test"; + fi; + fi; + fi; + if [[ -z "${checkTarget:-}" ]]; then + echo "no check/test target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; + echoCmd 'check flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postCheck +} +fixLibtool () +{ + + local search_path; + for flag in $NIX_LDFLAGS; + do + case $flag in + -L*) + search_path+=" ${flag#-L}" + ;; + esac; + done; + sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' +} +getHostRoleEnvHook () +{ + + getRole "$depHostOffset" +} +installPhase () +{ + + runHook preInstall; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom installPhase, doing nothing"; + runHook postInstall; + return; + else + foundMakefile=1; + fi; + if [ -n "$prefix" ]; then + mkdir -p "$prefix"; + fi; + local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; + echoCmd 'install flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + runHook postInstall +} +mapOffset () +{ + + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi +} +genericBuild () +{ + + export GZIP_NO_TIMESTAMPS=1; + if [ -f "${buildCommandPath:-}" ]; then + source "$buildCommandPath"; + return; + fi; + if [ -n "${buildCommand:-}" ]; then + eval "$buildCommand"; + return; + fi; + definePhases; + for curPhase in ${phases[*]}; + do + runPhase "$curPhase"; + done +} +_callImplicitHook () +{ + + local def="$1"; + local hookName="$2"; + if declare -F "$hookName" > /dev/null; then + nixTalkativeLog "calling implicit '$hookName' function hook"; + "$hookName"; + else + if type -p "$hookName" > /dev/null; then + nixTalkativeLog "sourcing implicit '$hookName' script hook"; + source "$hookName"; + else + if [ -n "${!hookName:-}" ]; then + nixTalkativeLog "evaling implicit '$hookName' string hook"; + eval "${!hookName}"; + else + return "$def"; + fi; + fi; + fi +} +exitHandler () +{ + + exitCode="$?"; + set +e; + if [ -n "${showBuildStats:-}" ]; then + read -r -d '' -a buildTimes < <(times); + echo "build times:"; + echo "user time for the shell ${buildTimes[0]}"; + echo "system time for the shell ${buildTimes[1]}"; + echo "user time for all child processes ${buildTimes[2]}"; + echo "system time for all child processes ${buildTimes[3]}"; + fi; + if (( "$exitCode" != 0 )); then + runHook failureHook; + if [ -n "${succeedOnFailure:-}" ]; then + echo "build failed with exit code $exitCode (ignored)"; + mkdir -p "$out/nix-support"; + printf "%s" "$exitCode" > "$out/nix-support/failed"; + exit 0; + fi; + else + runHook exitHook; + fi; + return "$exitCode" +} +_makeSymlinksRelative () +{ + + local prefixes; + prefixes=(); + for output in $(getAllOutputNames); + do + [ ! -e "${!output}" ] && continue; + prefixes+=("${!output}"); + done; + find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' + output="$1" + link="$2" + + linkTarget=$(readlink "$link") + + # only touch links that point inside the same output tree + [[ $linkTarget == "$output"/* ]] || exit 0 + + if [ ! -e "$linkTarget" ]; then + echo "the symlink $link is broken, it points to $linkTarget (which is missing)" + fi + + echo "making symlink relative: $link" + ln -snrf "$linkTarget" "$link" + ' _ +} +appendToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=(${nameref+"${nameref[@]}"} "$@"); + else + nameref="${nameref-} $*"; + fi +} +nixInfoLog () +{ + + _nixLogWithLevel 3 "$*" +} +getTargetRole () +{ + + getRole "$targetOffset" +} +addPythonPath () +{ + + addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.13/site-packages +} +_assignFirst () +{ + + local varName="$1"; + local _var; + local REMOVE=REMOVE; + shift; + for _var in "$@"; + do + if [ -n "${!_var-}" ]; then + eval "${varName}"="${_var}"; + return; + fi; + done; + echo; + echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; + echo " The following variables were all unset or empty:"; + echo " $*"; + if [ -z "${out:-}" ]; then + echo ' If you do not want an "out" output in your derivation, make sure to define'; + echo ' the other specific required outputs. This can be achieved by picking one'; + echo " of the above as an output."; + echo ' You do not have to remove "out" if you want to have a different default'; + echo ' output, because the first output is taken as a default.'; + echo; + fi; + return 1 +} +patchPhase () +{ + + runHook prePatch; + local -a patchesArray; + concatTo patchesArray patches; + local -a flagsArray; + concatTo flagsArray patchFlags=-p1; + for i in "${patchesArray[@]}"; + do + echo "applying patch $i"; + local uncompress=cat; + case "$i" in + *.gz) + uncompress="gzip -d" + ;; + *.bz2) + uncompress="bzip2 -d" + ;; + *.xz) + uncompress="xz -d" + ;; + *.lzma) + uncompress="lzma -d" + ;; + esac; + $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; + done; + runHook postPatch +} +_pruneLibtoolFiles () +{ + + if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then + return; + fi; + find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; +} +concatStringsSep () +{ + + local sep="$1"; + local name="$2"; + local type oldifs; + if type=$(declare -p "$name" 2> /dev/null); then + local -n nameref="$name"; + case "${type#* }" in + -A*) + echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; + return 1 + ;; + -a*) + local IFS="$(printf '\036')" + ;; + *) + local IFS=" " + ;; + esac; + local ifs_separated="${nameref[*]}"; + echo -n "${ifs_separated//"$IFS"/"$sep"}"; + fi +} +moveToOutput () +{ + + local patt="$1"; + local dstOut="$2"; + local output; + for output in $(getAllOutputNames); + do + if [ "${!output}" = "$dstOut" ]; then + continue; + fi; + local srcPath; + for srcPath in "${!output}"/$patt; + do + if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then + continue; + fi; + if [ "$dstOut" = REMOVE ]; then + echo "Removing $srcPath"; + rm -r "$srcPath"; + else + local dstPath="$dstOut${srcPath#${!output}}"; + echo "Moving $srcPath to $dstPath"; + if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then + rmdir "$srcPath" --ignore-fail-on-non-empty; + if [ -d "$srcPath" ]; then + mv -t "$dstPath" "$srcPath"/*; + rmdir "$srcPath"; + fi; + else + mkdir -p "$(readlink -m "$dstPath/..")"; + mv "$srcPath" "$dstPath"; + fi; + fi; + local srcParent="$(readlink -m "$srcPath/..")"; + if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then + echo "Removing empty $srcParent/ and (possibly) its parents"; + rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; + fi; + done; + done +} +noBrokenSymlinks () +{ + + local -r output="${1:?}"; + local path; + local pathParent; + local symlinkTarget; + local -i numDanglingSymlinks=0; + local -i numReflexiveSymlinks=0; + local -i numUnreadableSymlinks=0; + if [[ ! -e $output ]]; then + nixWarnLog "skipping non-existent output $output"; + return 0; + fi; + nixInfoLog "running on $output"; + while IFS= read -r -d '' path; do + pathParent="$(dirname "$path")"; + if ! symlinkTarget="$(readlink "$path")"; then + nixErrorLog "the symlink $path is unreadable"; + numUnreadableSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget == /* ]]; then + nixInfoLog "symlink $path points to absolute target $symlinkTarget"; + else + nixInfoLog "symlink $path points to relative target $symlinkTarget"; + symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; + fi; + if [[ $symlinkTarget = "$TMPDIR"/* ]]; then + nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; + numDanglingSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then + nixInfoLog "symlink $path points outside the Nix store; ignoring"; + continue; + fi; + if [[ $path == "$symlinkTarget" ]]; then + nixErrorLog "the symlink $path is reflexive"; + numReflexiveSymlinks+=1; + else + if [[ ! -e $symlinkTarget ]]; then + nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; + numDanglingSymlinks+=1; + else + nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; + fi; + fi; + done < <(find "$output" -type l -print0); + if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then + nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; + exit 1; + fi; + return 0 +} +isScript () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 2 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" =~ \#! ]]; then + return 0; + else + return 1; + fi +} +_allFlags () +{ + + export system pname name version; + while IFS='' read -r varName; do + nixTalkativeLog "@${varName}@ -> ${!varName}"; + args+=("--subst-var" "$varName"); + done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') +} +patchELF () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "shrinking RPATHs of ELF executables and libraries in $dir"; + local i; + while IFS= read -r -d '' i; do + if [[ "$i" =~ .build-id ]]; then + continue; + fi; + if ! isELF "$i"; then + continue; + fi; + echo "shrinking $i"; + patchelf --shrink-rpath "$i" || true; + done < <(find "$dir" -type f -print0) +} +isELF () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [ "$magic" = 'ELF' ]; then + return 0; + else + return 1; + fi +} +consumeEntire () +{ + + if IFS='' read -r -d '' "$1"; then + echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; + return 1; + fi +} +getAllOutputNames () +{ + + if [ -n "$__structuredAttrs" ]; then + echo "${!outputs[*]}"; + else + echo "$outputs"; + fi +} +_overrideFirst () +{ + + if [ -z "${!1-}" ]; then + _assignFirst "$@"; + fi +} +printPhases () +{ + + definePhases; + local phase; + for phase in ${phases[*]}; + do + printf '%s\n' "$phase"; + done +} +getHostRole () +{ + + getRole "$hostOffset" +} +nixVomitLog () +{ + + _nixLogWithLevel 7 "$*" +} +substituteStream () +{ + + local var=$1; + local description=$2; + shift 2; + while (( "$#" )); do + local replace_mode="$1"; + case "$1" in + --replace) + if ! "$_substituteStream_has_warned_replace_deprecation"; then + echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; + _substituteStream_has_warned_replace_deprecation=true; + fi; + replace_mode='--replace-warn' + ;& + --replace-quiet | --replace-warn | --replace-fail) + pattern="$2"; + replacement="$3"; + shift 3; + if ! [[ "${!var}" == *"$pattern"* ]]; then + if [ "$replace_mode" == --replace-warn ]; then + printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + else + if [ "$replace_mode" == --replace-fail ]; then + printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + return 1; + fi; + fi; + fi; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var) + local varName="$2"; + shift 2; + if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then + echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; + return 1; + fi; + if [ -z ${!varName+x} ]; then + echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; + return 1; + fi; + pattern="@$varName@"; + replacement="${!varName}"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var-by) + pattern="@$2@"; + replacement="$3"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; + shift 3 + ;; + *) + echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; + return 1 + ;; + esac; + done; + printf "%s" "${!var}" +} +_updateSourceDateEpochFromSourceRoot () +{ + + if [ -n "$sourceRoot" ]; then + updateSourceDateEpoch "$sourceRoot"; + fi +} +nixDebugLog () +{ + + _nixLogWithLevel 6 "$*" +} +bintoolsWrapper_addLDVars () +{ + + local role_post; + getHostRoleEnvHook; + if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; + fi; + if [[ -d "$1/lib" ]]; then + local -a glob=($1/lib/lib*); + if [ "${#glob[*]}" -gt 0 ]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib"; + fi; + fi +} +nixLog () +{ + + [[ -z ${NIX_LOG_FD-} ]] && return 0; + local callerName="${FUNCNAME[1]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" +} +activatePackage () +{ + + local pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + if [ -f "$pkg" ]; then + nixTalkativeLog "sourcing setup hook '$pkg'"; + source "$pkg"; + fi; + if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then + addToSearchPath _PATH "$pkg/bin"; + fi; + if (( hostOffset <= -1 )); then + addToSearchPath _XDG_DATA_DIRS "$pkg/share"; + fi; + if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then + addToSearchPath _HOST_PATH "$pkg/bin"; + fi; + if [[ -f "$pkg/nix-support/setup-hook" ]]; then + nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; + source "$pkg/nix-support/setup-hook"; + fi +} +getTargetRoleWrapper () +{ + + case $targetOffset in + -1) + export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 + ;; + 0) + export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 + ;; + 1) + export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 + ;; + *) + echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +echoCmd () +{ + + printf "%s:" "$1"; + shift; + printf ' %q' "$@"; + echo +} +showPhaseHeader () +{ + + local phase="$1"; + echo "Running phase: $phase"; + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" +} +substituteAllInPlace () +{ + + local fileName="$1"; + shift; + substituteAll "$fileName" "$fileName" "$@" +} +unpackFile () +{ + + curSrc="$1"; + echo "unpacking source archive $curSrc"; + if ! runOneHook unpackCmd "$curSrc"; then + echo "do not know how to unpack source archive $curSrc"; + exit 1; + fi +} +_nixLogWithLevel () +{ + + [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; + local logLevel; + case "${1:?}" in + 0) + logLevel=ERROR + ;; + 1) + logLevel=WARN + ;; + 2) + logLevel=NOTICE + ;; + 3) + logLevel=INFO + ;; + 4) + logLevel=TALKATIVE + ;; + 5) + logLevel=CHATTY + ;; + 6) + logLevel=DEBUG + ;; + 7) + logLevel=VOMIT + ;; + *) + echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; + return 1 + ;; + esac; + local callerName="${FUNCNAME[2]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" +} +showPhaseFooter () +{ + + local phase="$1"; + local startTime="$2"; + local endTime="$3"; + local delta=$(( endTime - startTime )); + (( delta < 30 )) && return; + local H=$((delta/3600)); + local M=$((delta%3600/60)); + local S=$((delta%60)); + echo -n "$phase completed in "; + (( H > 0 )) && echo -n "$H hours "; + (( M > 0 )) && echo -n "$M minutes "; + echo "$S seconds" +} +_addRpathPrefix () +{ + + if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then + export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; + fi +} +unpackPhase () +{ + + runHook preUnpack; + if [ -z "${srcs:-}" ]; then + if [ -z "${src:-}" ]; then + echo 'variable $src or $srcs should point to the source'; + exit 1; + fi; + srcs="$src"; + fi; + local -a srcsArray; + concatTo srcsArray srcs; + local dirsBefore=""; + for i in *; + do + if [ -d "$i" ]; then + dirsBefore="$dirsBefore $i "; + fi; + done; + for i in "${srcsArray[@]}"; + do + unpackFile "$i"; + done; + : "${sourceRoot=}"; + if [ -n "${setSourceRoot:-}" ]; then + runOneHook setSourceRoot; + else + if [ -z "$sourceRoot" ]; then + for i in *; + do + if [ -d "$i" ]; then + case $dirsBefore in + *\ $i\ *) + + ;; + *) + if [ -n "$sourceRoot" ]; then + echo "unpacker produced multiple directories"; + exit 1; + fi; + sourceRoot="$i" + ;; + esac; + fi; + done; + fi; + fi; + if [ -z "$sourceRoot" ]; then + echo "unpacker appears to have produced no directories"; + exit 1; + fi; + echo "source root is $sourceRoot"; + if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then + chmod -R u+w -- "$sourceRoot"; + fi; + runHook postUnpack +} +sysconfigdataHook () +{ + + if [ "$1" = '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' ]; then + export _PYTHON_HOST_PLATFORM='linux-x86_64'; + export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; + fi +} +_moveSbin () +{ + + if [ "${dontMoveSbin-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then + return; + fi; + echo "moving $prefix/sbin/* to $prefix/bin"; + mkdir -p $prefix/bin; + shopt -s dotglob; + for i in $prefix/sbin/*; + do + mv "$i" $prefix/bin; + done; + shopt -u dotglob; + rmdir $prefix/sbin; + ln -s bin $prefix/sbin +} +addEnvHooks () +{ + + local depHostOffset="$1"; + shift; + local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; + local pkgHookVar; + for pkgHookVar in "${!pkgHookVarsSlice}"; + do + eval "${pkgHookVar}s"'+=("$@")'; + done +} +addToSearchPath () +{ + + addToSearchPathWithCustomDelimiter ":" "$@" +} +dumpVars () +{ + + if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then + local old_umask; + old_umask=$(umask); + umask 0077; + export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; + umask "$old_umask"; + fi +} +isMachO () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then + return 0; + else + return 1; + fi; + fi; + fi +} +nixChattyLog () +{ + + _nixLogWithLevel 5 "$*" +} +_multioutDocs () +{ + + local REMOVE=REMOVE; + moveToOutput share/info "${!outputInfo}"; + moveToOutput share/doc "${!outputDoc}"; + moveToOutput share/gtk-doc "${!outputDevdoc}"; + moveToOutput share/devhelp/books "${!outputDevdoc}"; + moveToOutput share/man "${!outputMan}"; + moveToOutput share/man/man3 "${!outputDevman}" +} +buildPhase () +{ + + runHook preBuild; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom buildPhase, doing nothing"; + else + foundMakefile=1; + local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; + echoCmd 'build flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postBuild +} +getRole () +{ + + case $1 in + -1) + role_post='_FOR_BUILD' + ;; + 0) + role_post='' + ;; + 1) + role_post='_FOR_TARGET' + ;; + *) + echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +distPhase () +{ + + runHook preDist; + local flagsArray=(); + concatTo flagsArray distFlags distFlagsArray distTarget=dist; + echo 'dist flags: %q' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + if [ "${dontCopyDist:-0}" != 1 ]; then + mkdir -p "$out/tarballs"; + cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; + fi; + runHook postDist +} +findInputs () +{ + + local -r pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + local varVar="${pkgAccumVarVars[hostOffset + 1]}"; + local varRef="$varVar[$((targetOffset - hostOffset))]"; + local var="${!varRef}"; + unset -v varVar varRef; + local varSlice="$var[*]"; + case " ${!varSlice-} " in + *" $pkg "*) + return 0 + ;; + esac; + unset -v varSlice; + eval "$var"'+=("$pkg")'; + if ! [ -e "$pkg" ]; then + echo "build input $pkg does not exist" 1>&2; + exit 1; + fi; + function mapOffset () + { + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi + }; + local relHostOffset; + for relHostOffset in "${allPlatOffsets[@]}"; + do + local files="${propagatedDepFilesVars[relHostOffset + 1]}"; + local hostOffsetNext; + mapOffset "$relHostOffset" hostOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + local relTargetOffset; + for relTargetOffset in "${allPlatOffsets[@]}"; + do + (( "$relHostOffset" <= "$relTargetOffset" )) || continue; + local fileRef="${files}[$relTargetOffset - $relHostOffset]"; + local file="${!fileRef}"; + unset -v fileRef; + local targetOffsetNext; + mapOffset "$relTargetOffset" targetOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + [[ -f "$pkg/nix-support/$file" ]] || continue; + local pkgNext; + read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; + for pkgNext in $pkgNext; + do + findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; + done; + done; + done +} +_logHook () +{ + + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + local hookKind="$1"; + local hookExpr="$2"; + shift 2; + if declare -F "$hookExpr" > /dev/null 2>&1; then + nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; + else + if type -p "$hookExpr" > /dev/null; then + nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; + else + if [[ "$hookExpr" != "_callImplicitHook"* ]]; then + local exprToOutput; + if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then + exprToOutput="$hookExpr"; + else + local hookExprLine; + while IFS= read -r hookExprLine; do + hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; + if [[ -n "$hookExprLine" ]]; then + exprToOutput+="$hookExprLine\\n "; + fi; + done <<< "$hookExpr"; + exprToOutput="${exprToOutput%%\\n }"; + fi; + nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; + fi; + fi; + fi +} +_moveSystemdUserUnits () +{ + + if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then + return; + fi; + if [ ! -e "${prefix:?}/lib/systemd/user" ]; then + return; + fi; + local source="$prefix/lib/systemd/user"; + local target="$prefix/share/systemd/user"; + echo "moving $source/* to $target"; + mkdir -p "$target"; + ( shopt -s dotglob; + for i in "$source"/*; + do + mv "$i" "$target"; + done ); + rmdir "$source"; + ln -s "$target" "$source" +} +PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" +XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" + +eval "${shellHook:-}" +shopt -s expand_aliases + +exec /tmp/devenv-envtCMOZO/script \ No newline at end of file diff --git a/.devenv/shell-71ddd0fa90f49aae.sh b/.devenv/shell-71ddd0fa90f49aae.sh new file mode 100755 index 000000000..53ce09650 --- /dev/null +++ b/.devenv/shell-71ddd0fa90f49aae.sh @@ -0,0 +1,2313 @@ +if [ -n "$PS1" ] && [ -e $HOME/.bashrc ]; then + source $HOME/.bashrc; +fi + +shopt -u expand_aliases +PATH=${PATH:-} +nix_saved_PATH="$PATH" +XDG_DATA_DIRS=${XDG_DATA_DIRS:-} +nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" +declare -a envHostTargetHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +SOURCE_DATE_EPOCH='315532800' +export SOURCE_DATE_EPOCH +mesonFlags='' +export mesonFlags +declare -a pkgsHostTarget=() +_PYTHON_HOST_PLATFORM='linux-x86_64' +export _PYTHON_HOST_PLATFORM +shell='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export shell +prefix='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' +HOST_PATH='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' +export HOST_PATH +propagatedNativeBuildInputs='' +export propagatedNativeBuildInputs +XDG_DATA_DIRS='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/share:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/share:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/share:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/share:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/share:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/share:/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/share:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/share:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/share:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/share:/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/share:/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26/share:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/share:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share:/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/share:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/share:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/share:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/share:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/share' +export XDG_DATA_DIRS +outputBin='out' +declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) +outputInclude='out' +cmakeFlags='' +export cmakeFlags +GOROOT='/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share/go/' +export GOROOT +outputLib='out' +depsBuildTargetPropagated='' +export depsBuildTargetPropagated +hardeningDisable='' +export hardeningDisable +name='devenv-shell-env' +export name +DEVENV_TASK_FILE='/nix/store/67gwkyrn8qfd381zka7lgr23bm2d2v2a-tasks.json' +export DEVENV_TASK_FILE +LD='ld' +export LD +CC='gcc' +export CC +NIX_CFLAGS_COMPILE=' -frandom-seed=86aa67916d -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include' +export NIX_CFLAGS_COMPILE +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +OPTERR='1' +DEVENV_RUNTIME='/run/user/1000/devenv-303d476' +export DEVENV_RUNTIME +PKG_CONFIG_PATH='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/lib/pkgconfig:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/pkgconfig:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/lib/pkgconfig:/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/lib/pkgconfig:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/lib/pkgconfig:/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/lib/pkgconfig:/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/lib/pkgconfig:/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/lib/pkgconfig:/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/lib/pkgconfig:/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/lib/pkgconfig:/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/lib/pkgconfig:/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/lib/pkgconfig:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share/pkgconfig:/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/lib/pkgconfig:/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/lib/pkgconfig' +export PKG_CONFIG_PATH +dontAddDisableDepTrack='1' +export dontAddDisableDepTrack +declare -a envHostHostHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +DEVENV_ROOT='/home/karim/Dev/DevOps-Intro' +export DEVENV_ROOT +pkg='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' +depsBuildBuild='' +export depsBuildBuild +NIX_STORE='/nix/store' +export NIX_STORE +preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' +BASH='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +LINENO='79' +RANLIB='ranlib' +export RANLIB +depsBuildBuildPropagated='' +export depsBuildBuildPropagated +nativeBuildInputs='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev /nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2 /nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1 /nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0 /nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0 /nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0 /nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1 /nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0 /nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22 /nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1 /nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0 /nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12 /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev /nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0 /nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' +export nativeBuildInputs +HOSTTYPE='x86_64' +stdenv='/nix/store/w708nqm6lvvikrq8d3x45g96hzfij0r8-stdenv-linux' +export stdenv +SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export SHELL +NM='nm' +export NM +configureFlags='' +export configureFlags +doCheck='' +export doCheck +depsBuildTarget='' +export depsBuildTarget +outputDoc='out' +depsTargetTargetPropagated='' +export depsTargetTargetPropagated +NIX_HARDENING_ENABLE='bindnow format fortify fortify3 libcxxhardeningfast pic relro stackclashprotection stackprotector strictflexarrays1 strictoverflow zerocallusedregs' +export NIX_HARDENING_ENABLE +declare -a envBuildHostHooks=('addPythonPath' 'sysconfigdataHook' ) +DEVENV_STATE='/home/karim/Dev/DevOps-Intro/.devenv/state' +export DEVENV_STATE +declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) +builder='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export builder +DEVENV_TASKS='' +export DEVENV_TASKS +NIX_CC='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' +export NIX_CC +system='x86_64-linux' +export system +PKG_CONFIG='pkg-config' +export PKG_CONFIG +declare -a preConfigureHooks=('_multioutConfig' ) +CONFIG_SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export CONFIG_SHELL +DETERMINISTIC_BUILD='1' +export DETERMINISTIC_BUILD +defaultNativeBuildInputs='/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2 /nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' +initialPath='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10 /nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0 /nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12 /nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9 /nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12 /nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0 /nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35 /nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14 /nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin /nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1 /nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9 /nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8 /nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin /nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45' +declare -a envBuildBuildHooks=('addPythonPath' 'sysconfigdataHook' ) +declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) +declare -a pkgsBuildBuild=() +doInstallCheck='' +export doInstallCheck +_substituteStream_has_warned_replace_deprecation='false' +GOPATH='/home/karim/Dev/DevOps-Intro/.devenv/state/go' +export GOPATH +GOTOOLDIR='/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin' +export GOTOOLDIR +PYTHONNOUSERSITE='1' +export PYTHONNOUSERSITE +outputDevdoc='REMOVE' +propagatedBuildInputs='' +export propagatedBuildInputs +out='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' +export out +AS='as' +export AS +PYTHONHASHSEED='0' +export PYTHONHASHSEED +NIX_BUILD_CORES='4' +export NIX_BUILD_CORES +NIX_BINTOOLS='/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' +export NIX_BINTOOLS +PATH='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/bin:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/bin:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/bin:/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin:/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0/bin:/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0/bin:/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1/bin:/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0/bin:/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22/bin:/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1/bin:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/bin:/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1/bin:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/bin:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/bin:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/bin:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/bin:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/bin:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/bin:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/bin:/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin/bin:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/bin:/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin/bin:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/bin:/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin/bin:/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin/bin:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/bin:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/bin:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/bin:/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0/bin:/nix/store/sanx9fg8mry8mq92zhlm5qvb83qlxrlx-gcc-15.2.0/bin:/nix/store/pf30k3mg7n6bibc1k6609gyq7glk00k2-glibc-2.42-61-bin/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46/bin:/nix/store/p2vkw5s89ff1fs2d2rxqxiqil9s0jpcm-binutils-2.46/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' +export PATH +declare -a pkgsHostHost=() +declare -a unpackCmdHooks=('_defaultUnpack' ) +declare -a envTargetTargetHooks=() +CXX='g++' +export CXX +IN_NIX_SHELL='impure' +export IN_NIX_SHELL +outputDev='out' +buildPhase='{ echo "------------------------------------------------------------"; + echo " WARNING: the existence of this path is not guaranteed."; + echo " It is an internal implementation detail for pkgs.mkShell."; + echo "------------------------------------------------------------"; + echo; + # Record all build inputs as runtime dependencies + export; +} >> "$out" +' +export buildPhase +__structuredAttrs='' +export __structuredAttrs +OLDPWD='' +export OLDPWD +STRINGS='strings' +export STRINGS +READELF='readelf' +export READELF +SIZE='size' +export SIZE +outputDevman='out' +OBJDUMP='objdump' +export OBJDUMP +NIX_NO_SELF_RPATH='1' +shellHook=' +export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}" + + +# Override temp directories that stdenv set to NIX_BUILD_TOP. +# Only reset those that still point to the Nix build dir; leave +# any user/CI-supplied value intact so child processes (e.g. +# `devenv processes wait`) compute the same runtime directory. +for var in TMP TMPDIR TEMP TEMPDIR; do + if [ -n "${!var-}" ] && [ "${!var}" = "${NIX_BUILD_TOP-}" ]; then + export "$var"=/tmp + fi +done +if [ -n "${NIX_BUILD_TOP-}" ]; then + unset NIX_BUILD_TOP +fi + +# set path to locales on non-NixOS Linux hosts +if [ -z "${LOCALE_ARCHIVE-}" ]; then + export LOCALE_ARCHIVE=/nix/store/sp7b84c2jnbskd6dm2n5splgipg9d1f0-glibc-locales-2.42-61/lib/locale/locale-archive +fi + + +# direnv helper +if [ ! type -p direnv &>/dev/null && -f .envrc ]; then + echo "An .envrc file was detected, but the direnv command is not installed." + echo "To use this configuration, please install direnv: https://direnv.net/docs/installation.html" +fi + +mkdir -p "$DEVENV_STATE" +if [ ! -L "$DEVENV_DOTFILE/profile" ] || [ "$(/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin/readlink $DEVENV_DOTFILE/profile)" != "/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile" ] +then + ln -snf /nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile "$DEVENV_DOTFILE/profile" +fi +unset HOST_PATH NIX_BUILD_CORES __structuredAttrs buildInputs buildPhase builder depsBuildBuild depsBuildBuildPropagated depsBuildTarget depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget depsTargetTargetPropagated dontAddDisableDepTrack doCheck doInstallCheck nativeBuildInputs out outputs patches phases preferLocalBuild propagatedBuildInputs propagatedNativeBuildInputs shell shellHook stdenv strictDeps + +mkdir -p /run/user/1000/devenv-303d476 +ln -snf /run/user/1000/devenv-303d476 /home/karim/Dev/DevOps-Intro/.devenv/run + + +export PATH=$GOPATH/bin:$PATH + +echo "✨ devenv 2.0.6 is out of date. Please update to 2.1.2: https://devenv.sh/getting-started/#installation" >&2 + + +# Check whether the direnv integration is out of date. +{ + if [[ ":${DIRENV_ACTIVE-}:" == *":/home/karim/Dev/DevOps-Intro:"* ]]; then + if [[ ! "${DEVENV_NO_DIRENVRC_OUTDATED_WARNING-}" == 1 && ! "${DEVENV_DIRENVRC_ROLLING_UPGRADE-}" == 1 ]]; then + if [[ ${DEVENV_DIRENVRC_VERSION:-0} -lt 2 ]]; then + direnv_line=$(grep --color=never -E "source_url.*cachix/devenv" .envrc || echo "") + + echo "✨ The direnv integration in your .envrc is out of date." + echo "" + echo -n "RECOMMENDED: devenv can now auto-upgrade the direnv integration. " + if [[ -n "$direnv_line" ]]; then + echo "To enable this feature, replace the following line in your .envrc:" + echo "" + echo " $direnv_line" + echo "" + echo "with:" + echo "" + echo " eval \"\$(devenv direnvrc)\"" + else + echo "To enable this feature, replace the \`source_url\` line that fetches the direnvrc integration in your .envrc with:" + echo "" + echo " eval \"$(devenv direnvrc)\"" + fi + echo "" + echo "If you prefer to continue managing the integration manually, follow the upgrade instructions at https://devenv.sh/integrations/direnv/." + echo "" + echo "To disable this message:" + echo "" + echo " Add the following environment to your .envrc before \`use devenv\`:" + echo "" + echo " export DEVENV_NO_DIRENVRC_OUTDATED_WARNING=1" + echo "" + echo " Or set the following option in your devenv configuration:" + echo "" + echo " devenv.warnOnNewVersion = false;" + echo "" + fi + fi + fi +} >&2 + +echo "── DevOps-Intro devenv ──" +go version +git --version +echo "QuickNotes: cd app && go run ." + +' +export shellHook +depsHostHost='' +export depsHostHost +STRIP='strip' +export STRIP +outputMan='out' +declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) +depsTargetTarget='' +export depsTargetTarget +buildInputs='' +export buildInputs +IFS=' +' +defaultBuildInputs='' +MACHTYPE='x86_64-pc-linux-gnu' +GOTOOLCHAIN='local' +export GOTOOLCHAIN +NIX_LDFLAGS='-rpath /nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib' +export NIX_LDFLAGS +_PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu' +export _PYTHON_SYSCONFIGDATA_NAME +depsHostHostPropagated='' +export depsHostHostPropagated +preferLocalBuild='1' +export preferLocalBuild +declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) +declare -a envBuildTargetHooks=('addPythonPath' 'sysconfigdataHook' ) +phases='buildPhase' +export phases +outputInfo='out' +PS4='+ ' +declare -a pkgsTargetTarget=() +patches='' +export patches +NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +outputs='out' +export outputs +NIX_ENFORCE_NO_NATIVE='1' +export NIX_ENFORCE_NO_NATIVE +OSTYPE='linux-gnu' +DEVENV_PROFILE='/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile' +export DEVENV_PROFILE +AR='ar' +export AR +declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelative' '_multioutPropagateDev' ) +declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) +OBJCOPY='objcopy' +export OBJCOPY +PYTHONPATH='/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/python3.13/site-packages' +export PYTHONPATH +DEVENV_DOTFILE='/home/karim/Dev/DevOps-Intro/.devenv' +export DEVENV_DOTFILE +declare -a pkgsBuildTarget=() +strictDeps='' +export strictDeps +declare -a pkgsBuildHost=('/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev' '/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9' '/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2' '/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1' '/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0' '/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0' '/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0' '/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1' '/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0' '/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22' '/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1' '/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0' '/nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev' '/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1' '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' '/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev' '/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev' '/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib' '/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0' '/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev' '/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib' '/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1' '/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev' '/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib' '/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1' '/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev' '/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0' '/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev' '/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0' '/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev' '/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin' '/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8' '/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev' '/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin' '/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1' '/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev' '/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26' '/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5' '/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev' '/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1' '/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev' '/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2' '/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev' '/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin' '/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7' '/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin' '/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0' '/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev' '/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin' '/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1' '/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0' '/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' '/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2' '/nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' '/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' ) +concatStringsSep () +{ + + local sep="$1"; + local name="$2"; + local type oldifs; + if type=$(declare -p "$name" 2> /dev/null); then + local -n nameref="$name"; + case "${type#* }" in + -A*) + echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; + return 1 + ;; + -a*) + local IFS="$(printf '\036')" + ;; + *) + local IFS=" " + ;; + esac; + local ifs_separated="${nameref[*]}"; + echo -n "${ifs_separated//"$IFS"/"$sep"}"; + fi +} +nixNoticeLog () +{ + + _nixLogWithLevel 2 "$*" +} +nixVomitLog () +{ + + _nixLogWithLevel 7 "$*" +} +findInputs () +{ + + local -r pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + local varVar="${pkgAccumVarVars[hostOffset + 1]}"; + local varRef="$varVar[$((targetOffset - hostOffset))]"; + local var="${!varRef}"; + unset -v varVar varRef; + local varSlice="$var[*]"; + case " ${!varSlice-} " in + *" $pkg "*) + return 0 + ;; + esac; + unset -v varSlice; + eval "$var"'+=("$pkg")'; + if ! [ -e "$pkg" ]; then + echo "build input $pkg does not exist" 1>&2; + exit 1; + fi; + function mapOffset () + { + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi + }; + local relHostOffset; + for relHostOffset in "${allPlatOffsets[@]}"; + do + local files="${propagatedDepFilesVars[relHostOffset + 1]}"; + local hostOffsetNext; + mapOffset "$relHostOffset" hostOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + local relTargetOffset; + for relTargetOffset in "${allPlatOffsets[@]}"; + do + (( "$relHostOffset" <= "$relTargetOffset" )) || continue; + local fileRef="${files}[$relTargetOffset - $relHostOffset]"; + local file="${!fileRef}"; + unset -v fileRef; + local targetOffsetNext; + mapOffset "$relTargetOffset" targetOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + [[ -f "$pkg/nix-support/$file" ]] || continue; + local pkgNext; + read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; + for pkgNext in $pkgNext; + do + findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; + done; + done; + done +} +_moveLib64 () +{ + + if [ "${dontMoveLib64-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then + return; + fi; + echo "moving $prefix/lib64/* to $prefix/lib"; + mkdir -p $prefix/lib; + shopt -s dotglob; + for i in $prefix/lib64/*; + do + mv --no-clobber "$i" $prefix/lib; + done; + shopt -u dotglob; + rmdir $prefix/lib64; + ln -s lib $prefix/lib64 +} +_logHook () +{ + + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + local hookKind="$1"; + local hookExpr="$2"; + shift 2; + if declare -F "$hookExpr" > /dev/null 2>&1; then + nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; + else + if type -p "$hookExpr" > /dev/null; then + nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; + else + if [[ "$hookExpr" != "_callImplicitHook"* ]]; then + local exprToOutput; + if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then + exprToOutput="$hookExpr"; + else + local hookExprLine; + while IFS= read -r hookExprLine; do + hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; + if [[ -n "$hookExprLine" ]]; then + exprToOutput+="$hookExprLine\\n "; + fi; + done <<< "$hookExpr"; + exprToOutput="${exprToOutput%%\\n }"; + fi; + nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; + fi; + fi; + fi +} +_overrideFirst () +{ + + if [ -z "${!1-}" ]; then + _assignFirst "$@"; + fi +} +ccWrapper_addCVars () +{ + + local role_post; + getHostRoleEnvHook; + local found=; + if [ -d "$1/include" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; + found=1; + fi; + if [ -d "$1/Library/Frameworks" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; + found=1; + fi; + if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then + local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; + export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; + fi +} +_pruneLibtoolFiles () +{ + + if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then + return; + fi; + find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; +} +installPhase () +{ + + runHook preInstall; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom installPhase, doing nothing"; + runHook postInstall; + return; + else + foundMakefile=1; + fi; + if [ -n "$prefix" ]; then + mkdir -p "$prefix"; + fi; + local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; + echoCmd 'install flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + runHook postInstall +} +isMachO () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then + return 0; + else + return 1; + fi; + fi; + fi +} +patchShebangsAuto () +{ + + if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then + if [[ "$output" != out && "$output" = "$outputDev" ]]; then + patchShebangs --build "$prefix"; + else + patchShebangs --host "$prefix"; + fi; + fi +} +_allFlags () +{ + + export system pname name version; + while IFS='' read -r varName; do + nixTalkativeLog "@${varName}@ -> ${!varName}"; + args+=("--subst-var" "$varName"); + done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') +} +configurePhase () +{ + + runHook preConfigure; + : "${configureScript=}"; + if [[ -z "$configureScript" && -x ./configure ]]; then + configureScript=./configure; + fi; + if [ -z "${dontFixLibtool:-}" ]; then + export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; + local i; + find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do + echo "fixing libtool script $i"; + fixLibtool "$i"; + done; + CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); + find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; + rm -f "$CONFIGURE_MTIME_REFERENCE"; + fi; + if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then + local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; + if [ "${prefixKeyOrDefault: -1}" = " " ]; then + prependToVar configureFlags "$prefix"; + prependToVar configureFlags "${prefixKeyOrDefault::-1}"; + else + prependToVar configureFlags "$prefixKeyOrDefault$prefix"; + fi; + fi; + if [[ -f "$configureScript" ]]; then + if [ -z "${dontAddDisableDepTrack:-}" ]; then + if grep -q dependency-tracking "$configureScript"; then + prependToVar configureFlags --disable-dependency-tracking; + fi; + fi; + if [ -z "${dontDisableStatic:-}" ]; then + if grep -q enable-static "$configureScript"; then + prependToVar configureFlags --disable-static; + fi; + fi; + if [ -z "${dontPatchShebangsInConfigure:-}" ]; then + patchShebangs --build "$configureScript"; + fi; + fi; + if [ -n "$configureScript" ]; then + local -a flagsArray; + concatTo flagsArray configureFlags configureFlagsArray; + echoCmd 'configure flags' "${flagsArray[@]}"; + $configureScript "${flagsArray[@]}"; + unset flagsArray; + else + echo "no configure script, doing nothing"; + fi; + runHook postConfigure +} +genericBuild () +{ + + export GZIP_NO_TIMESTAMPS=1; + if [ -f "${buildCommandPath:-}" ]; then + source "$buildCommandPath"; + return; + fi; + if [ -n "${buildCommand:-}" ]; then + eval "$buildCommand"; + return; + fi; + definePhases; + for curPhase in ${phases[*]}; + do + runPhase "$curPhase"; + done +} +nixWarnLog () +{ + + _nixLogWithLevel 1 "$*" +} +getTargetRoleEnvHook () +{ + + getRole "$depTargetOffset" +} +recordPropagatedDependencies () +{ + + declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); + declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); + local propagatedInputsIndex; + for propagatedInputsIndex in "${!flatVars[@]}"; + do + local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; + local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; + [[ -n "${!propagatedInputsSlice}" ]] || continue; + mkdir -p "${!outputDev}/nix-support"; + printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; + done +} +toPythonPath () +{ + + local paths="$1"; + local result=; + for i in $paths; + do + p="$i/lib/python3.13/site-packages"; + result="${result}${result:+:}$p"; + done; + echo $result +} +showPhaseHeader () +{ + + local phase="$1"; + echo "Running phase: $phase"; + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" +} +checkPhase () +{ + + runHook preCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom checkPhase, doing nothing"; + runHook postCheck; + return; + fi; + if [[ -z "${checkTarget:-}" ]]; then + if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then + checkTarget="check"; + else + if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then + checkTarget="test"; + fi; + fi; + fi; + if [[ -z "${checkTarget:-}" ]]; then + echo "no check/test target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; + echoCmd 'check flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postCheck +} +substituteAllStream () +{ + + local -a args=(); + _allFlags; + substituteStream "$1" "$2" "${args[@]}" +} +_addToEnv () +{ + + local depHostOffset depTargetOffset; + local pkg; + for depHostOffset in "${allPlatOffsets[@]}"; + do + local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; + local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; + for depTargetOffset in "${allPlatOffsets[@]}"; + do + (( depHostOffset <= depTargetOffset )) || continue; + local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; + if [[ -z "${strictDeps-}" ]]; then + local visitedPkgs=""; + for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; + do + if [[ "$visitedPkgs" = *"$pkg"* ]]; then + continue; + fi; + runHook "${!hookRef}" "$pkg"; + visitedPkgs+=" $pkg"; + done; + else + local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + runHook "${!hookRef}" "$pkg"; + done; + fi; + done; + done +} +_assignFirst () +{ + + local varName="$1"; + local _var; + local REMOVE=REMOVE; + shift; + for _var in "$@"; + do + if [ -n "${!_var-}" ]; then + eval "${varName}"="${_var}"; + return; + fi; + done; + echo; + echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; + echo " The following variables were all unset or empty:"; + echo " $*"; + if [ -z "${out:-}" ]; then + echo ' If you do not want an "out" output in your derivation, make sure to define'; + echo ' the other specific required outputs. This can be achieved by picking one'; + echo " of the above as an output."; + echo ' You do not have to remove "out" if you want to have a different default'; + echo ' output, because the first output is taken as a default.'; + echo; + fi; + return 1 +} +stripDirs () +{ + + local cmd="$1"; + local ranlibCmd="$2"; + local paths="$3"; + local stripFlags="$4"; + local excludeFlags=(); + local pathsNew=; + [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; + [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; + local pattern; + if [ -n "${stripExclude:-}" ]; then + for pattern in "${stripExclude[@]}"; + do + excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); + done; + fi; + local p; + for p in ${paths}; + do + if [ -e "$prefix/$p" ]; then + pathsNew="${pathsNew} $prefix/$p"; + fi; + done; + paths=${pathsNew}; + if [ -n "${paths}" ]; then + echo "stripping (with command $cmd and flags $stripFlags) in $paths"; + local striperr; + striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; + find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; + [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); + rm "$striperr"; + find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; + fi +} +substituteAll () +{ + + local input="$1"; + local output="$2"; + local -a args=(); + _allFlags; + substitute "$input" "$output" "${args[@]}" +} +installCheckPhase () +{ + + runHook preInstallCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom installCheckPhase, doing nothing"; + else + if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then + echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; + echoCmd 'installcheck flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + fi; + runHook postInstallCheck +} +sysconfigdataHook () +{ + + if [ "$1" = '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' ]; then + export _PYTHON_HOST_PLATFORM='linux-x86_64'; + export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; + fi +} +printWords () +{ + + (( "$#" > 0 )) || return 0; + printf '%s ' "$@" +} +definePhases () +{ + + if [ -z "${phases[*]:-}" ]; then + phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; + fi +} +printLines () +{ + + (( "$#" > 0 )) || return 0; + printf '%s\n' "$@" +} +addEnvHooks () +{ + + local depHostOffset="$1"; + shift; + local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; + local pkgHookVar; + for pkgHookVar in "${!pkgHookVarsSlice}"; + do + eval "${pkgHookVar}s"'+=("$@")'; + done +} +updateAutotoolsGnuConfigScriptsPhase () +{ + + if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then + return; + fi; + for script in config.sub config.guess; + do + for f in $(find . -type f -name "$script"); + do + echo "Updating Autotools / GNU config script to a newer upstream version: $f"; + cp -f "/nix/store/kppfbp4x7mhfz1q5zswavxxxq71v2f7c-gnu-config-2024-01-01/$script" "$f"; + done; + done +} +_multioutDocs () +{ + + local REMOVE=REMOVE; + moveToOutput share/info "${!outputInfo}"; + moveToOutput share/doc "${!outputDoc}"; + moveToOutput share/gtk-doc "${!outputDevdoc}"; + moveToOutput share/devhelp/books "${!outputDevdoc}"; + moveToOutput share/man "${!outputMan}"; + moveToOutput share/man/man3 "${!outputDevman}" +} +addToSearchPath () +{ + + addToSearchPathWithCustomDelimiter ":" "$@" +} +_defaultUnpack () +{ + + local fn="$1"; + local destination; + if [ -d "$fn" ]; then + destination="$(stripHash "$fn")"; + if [ -e "$destination" ]; then + echo "Cannot copy $fn to $destination: destination already exists!"; + echo "Did you specify two \"srcs\" with the same \"name\"?"; + return 1; + fi; + cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; + else + case "$fn" in + *.tar.xz | *.tar.lzma | *.txz) + ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; + true ) | tar xf - --mode=+w --warning=no-timestamp + ;; + *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) + tar xf "$fn" --mode=+w --warning=no-timestamp + ;; + *) + return 1 + ;; + esac; + fi +} +_doStrip () +{ + + local -ra flags=(dontStripHost dontStripTarget); + local -ra debugDirs=(stripDebugList stripDebugListTarget); + local -ra allDirs=(stripAllList stripAllListTarget); + local -ra stripCmds=(STRIP STRIP_FOR_TARGET); + local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); + stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; + stripDebugListTarget=${stripDebugListTarget[*]:-}; + stripAllList=${stripAllList[*]:-}; + stripAllListTarget=${stripAllListTarget[*]:-}; + local i; + for i in ${!stripCmds[@]}; + do + local -n flag="${flags[$i]}"; + local -n debugDirList="${debugDirs[$i]}"; + local -n allDirList="${allDirs[$i]}"; + local -n stripCmd="${stripCmds[$i]}"; + local -n ranlibCmd="${ranlibCmds[$i]}"; + if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then + continue; + fi; + stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; + stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; + done +} +appendToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=(${nameref+"${nameref[@]}"} "$@"); + else + nameref="${nameref-} $*"; + fi +} +getTargetRoleWrapper () +{ + + case $targetOffset in + -1) + export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 + ;; + 0) + export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 + ;; + 1) + export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 + ;; + *) + echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +_moveSbin () +{ + + if [ "${dontMoveSbin-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then + return; + fi; + echo "moving $prefix/sbin/* to $prefix/bin"; + mkdir -p $prefix/bin; + shopt -s dotglob; + for i in $prefix/sbin/*; + do + mv "$i" $prefix/bin; + done; + shopt -u dotglob; + rmdir $prefix/sbin; + ln -s bin $prefix/sbin +} +_multioutDevs () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then + return; + fi; + moveToOutput include "${!outputInclude}"; + moveToOutput lib/pkgconfig "${!outputDev}"; + moveToOutput share/pkgconfig "${!outputDev}"; + moveToOutput lib/cmake "${!outputDev}"; + moveToOutput share/aclocal "${!outputDev}"; + for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; + do + echo "Patching '$f' includedir to output ${!outputInclude}"; + sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; + done +} +getHostRoleEnvHook () +{ + + getRole "$depHostOffset" +} +nixDebugLog () +{ + + _nixLogWithLevel 6 "$*" +} +_makeSymlinksRelative () +{ + + local prefixes; + prefixes=(); + for output in $(getAllOutputNames); + do + [ ! -e "${!output}" ] && continue; + prefixes+=("${!output}"); + done; + find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' + output="$1" + link="$2" + + linkTarget=$(readlink "$link") + + # only touch links that point inside the same output tree + [[ $linkTarget == "$output"/* ]] || exit 0 + + if [ ! -e "$linkTarget" ]; then + echo "the symlink $link is broken, it points to $linkTarget (which is missing)" + fi + + echo "making symlink relative: $link" + ln -snrf "$linkTarget" "$link" + ' _ +} +auditTmpdir () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "checking for references to $TMPDIR/ in $dir..."; + local tmpdir elf_fifo script_fifo; + tmpdir="$(mktemp -d)"; + elf_fifo="$tmpdir/elf"; + script_fifo="$tmpdir/script"; + mkfifo "$elf_fifo" "$script_fifo"; + ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do + if isELF "$file"; then + printf '%s\0' "$file" 1>&3; + else + if isScript "$file"; then + filename=${file##*/}; + dir=${file%/*}; + if [ -e "$dir/.$filename-wrapped" ]; then + printf '%s\0' "$file" 1>&4; + fi; + fi; + fi; + done; + exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then + echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$elf_fifo" ) & local pid_elf=$!; + local pid_script; + ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if grep -q -F "$TMPDIR/" "$1"; then + echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$script_fifo" ) & local pid_script=$!; + wait "$pid_elf" || { + echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + wait "$pid_script" || { + echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + rm -r "$tmpdir" +} +pkgConfigWrapper_addPkgConfigPath () +{ + + local role_post; + getHostRoleEnvHook; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" +} +_activatePkgs () +{ + + local hostOffset targetOffset; + local pkg; + for hostOffset in "${allPlatOffsets[@]}"; + do + local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; + for targetOffset in "${allPlatOffsets[@]}"; + do + (( hostOffset <= targetOffset )) || continue; + local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + activatePackage "$pkg" "$hostOffset" "$targetOffset"; + done; + done; + done +} +activatePackage () +{ + + local pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + if [ -f "$pkg" ]; then + nixTalkativeLog "sourcing setup hook '$pkg'"; + source "$pkg"; + fi; + if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then + addToSearchPath _PATH "$pkg/bin"; + fi; + if (( hostOffset <= -1 )); then + addToSearchPath _XDG_DATA_DIRS "$pkg/share"; + fi; + if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then + addToSearchPath _HOST_PATH "$pkg/bin"; + fi; + if [[ -f "$pkg/nix-support/setup-hook" ]]; then + nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; + source "$pkg/nix-support/setup-hook"; + fi +} +exitHandler () +{ + + exitCode="$?"; + set +e; + if [ -n "${showBuildStats:-}" ]; then + read -r -d '' -a buildTimes < <(times); + echo "build times:"; + echo "user time for the shell ${buildTimes[0]}"; + echo "system time for the shell ${buildTimes[1]}"; + echo "user time for all child processes ${buildTimes[2]}"; + echo "system time for all child processes ${buildTimes[3]}"; + fi; + if (( "$exitCode" != 0 )); then + runHook failureHook; + if [ -n "${succeedOnFailure:-}" ]; then + echo "build failed with exit code $exitCode (ignored)"; + mkdir -p "$out/nix-support"; + printf "%s" "$exitCode" > "$out/nix-support/failed"; + exit 0; + fi; + else + runHook exitHook; + fi; + return "$exitCode" +} +dumpVars () +{ + + if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then + local old_umask; + old_umask=$(umask); + umask 0077; + export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; + umask "$old_umask"; + fi +} +isELF () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [ "$magic" = 'ELF' ]; then + return 0; + else + return 1; + fi +} +_moveToShare () +{ + + if [ -n "$__structuredAttrs" ]; then + if [ -z "${forceShare-}" ]; then + forceShare=(man doc info); + fi; + else + forceShare=(${forceShare:-man doc info}); + fi; + if [[ -z "$out" ]]; then + return; + fi; + for d in "${forceShare[@]}"; + do + if [ -d "$out/$d" ]; then + if [ -d "$out/share/$d" ]; then + echo "both $d/ and share/$d/ exist!"; + else + echo "moving $out/$d to $out/share/$d"; + mkdir -p $out/share; + mv $out/$d $out/share/; + fi; + fi; + done +} +prependToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=("$@" ${nameref+"${nameref[@]}"}); + else + nameref="$* ${nameref-}"; + fi +} +stripHash () +{ + + local strippedName casematchOpt=0; + strippedName="$(basename -- "$1")"; + shopt -q nocasematch && casematchOpt=1; + shopt -u nocasematch; + if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then + echo "${strippedName:33}"; + else + echo "$strippedName"; + fi; + if (( casematchOpt )); then + shopt -s nocasematch; + fi +} +substitute () +{ + + local input="$1"; + local output="$2"; + shift 2; + if [ ! -f "$input" ]; then + echo "substitute(): ERROR: file '$input' does not exist" 1>&2; + return 1; + fi; + local content; + consumeEntire content < "$input"; + if [ -e "$output" ]; then + chmod +w "$output"; + fi; + substituteStream content "file '$input'" "$@" > "$output" +} +substituteInPlace () +{ + + local -a fileNames=(); + for arg in "$@"; + do + if [[ "$arg" = "--"* ]]; then + break; + fi; + fileNames+=("$arg"); + shift; + done; + if ! [[ "${#fileNames[@]}" -gt 0 ]]; then + echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; + return 1; + fi; + for file in "${fileNames[@]}"; + do + substitute "$file" "$file" "$@"; + done +} +showPhaseFooter () +{ + + local phase="$1"; + local startTime="$2"; + local endTime="$3"; + local delta=$(( endTime - startTime )); + (( delta < 30 )) && return; + local H=$((delta/3600)); + local M=$((delta%3600/60)); + local S=$((delta%60)); + echo -n "$phase completed in "; + (( H > 0 )) && echo -n "$H hours "; + (( M > 0 )) && echo -n "$M minutes "; + echo "$S seconds" +} +unpackPhase () +{ + + runHook preUnpack; + if [ -z "${srcs:-}" ]; then + if [ -z "${src:-}" ]; then + echo 'variable $src or $srcs should point to the source'; + exit 1; + fi; + srcs="$src"; + fi; + local -a srcsArray; + concatTo srcsArray srcs; + local dirsBefore=""; + for i in *; + do + if [ -d "$i" ]; then + dirsBefore="$dirsBefore $i "; + fi; + done; + for i in "${srcsArray[@]}"; + do + unpackFile "$i"; + done; + : "${sourceRoot=}"; + if [ -n "${setSourceRoot:-}" ]; then + runOneHook setSourceRoot; + else + if [ -z "$sourceRoot" ]; then + for i in *; + do + if [ -d "$i" ]; then + case $dirsBefore in + *\ $i\ *) + + ;; + *) + if [ -n "$sourceRoot" ]; then + echo "unpacker produced multiple directories"; + exit 1; + fi; + sourceRoot="$i" + ;; + esac; + fi; + done; + fi; + fi; + if [ -z "$sourceRoot" ]; then + echo "unpacker appears to have produced no directories"; + exit 1; + fi; + echo "source root is $sourceRoot"; + if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then + chmod -R u+w -- "$sourceRoot"; + fi; + runHook postUnpack +} +concatTo () +{ + + local -; + set -o noglob; + local -n targetref="$1"; + shift; + local arg default name type; + for arg in "$@"; + do + IFS="=" read -r name default <<< "$arg"; + local -n nameref="$name"; + if [[ -z "${nameref[*]}" && -n "$default" ]]; then + targetref+=("$default"); + else + if type=$(declare -p "$name" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; + return 1 + ;; + -a*) + targetref+=("${nameref[@]}") + ;; + *) + if [[ "$name" = *"Array" ]]; then + nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; + targetref+=(${nameref+"${nameref[@]}"}); + else + targetref+=(${nameref-}); + fi + ;; + esac; + fi; + fi; + done +} +runOneHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook ret=1; + for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + if _eval "$hook" "$@"; then + ret=0; + break; + fi; + done; + return "$ret" +} +_multioutPropagateDev () +{ + + if [ "$(getAllOutputNames)" = "out" ]; then + return; + fi; + local outputFirst; + for outputFirst in $(getAllOutputNames); + do + break; + done; + local propagaterOutput="$outputDev"; + if [ -z "$propagaterOutput" ]; then + propagaterOutput="$outputFirst"; + fi; + if [ -z "${propagatedBuildOutputs+1}" ]; then + local po_dirty="$outputBin $outputInclude $outputLib"; + set +o pipefail; + propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; + set -o pipefail; + fi; + if [ -z "$propagatedBuildOutputs" ]; then + return; + fi; + mkdir -p "${!propagaterOutput}"/nix-support; + for output in $propagatedBuildOutputs; + do + echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; + done +} +isScript () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 2 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" =~ \#! ]]; then + return 0; + else + return 1; + fi +} +substituteStream () +{ + + local var=$1; + local description=$2; + shift 2; + while (( "$#" )); do + local replace_mode="$1"; + case "$1" in + --replace) + if ! "$_substituteStream_has_warned_replace_deprecation"; then + echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; + _substituteStream_has_warned_replace_deprecation=true; + fi; + replace_mode='--replace-warn' + ;& + --replace-quiet | --replace-warn | --replace-fail) + pattern="$2"; + replacement="$3"; + shift 3; + if ! [[ "${!var}" == *"$pattern"* ]]; then + if [ "$replace_mode" == --replace-warn ]; then + printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + else + if [ "$replace_mode" == --replace-fail ]; then + printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + return 1; + fi; + fi; + fi; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var) + local varName="$2"; + shift 2; + if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then + echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; + return 1; + fi; + if [ -z ${!varName+x} ]; then + echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; + return 1; + fi; + pattern="@$varName@"; + replacement="${!varName}"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var-by) + pattern="@$2@"; + replacement="$3"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; + shift 3 + ;; + *) + echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; + return 1 + ;; + esac; + done; + printf "%s" "${!var}" +} +updateSourceDateEpoch () +{ + + local path="$1"; + [[ $path == -* ]] && path="./$path"; + local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); + local time="${res[0]//\.[0-9]*/}"; + local newestFile="${res[1]}"; + if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then + echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; + export SOURCE_DATE_EPOCH="$time"; + local now="$(date +%s)"; + if [ "$time" -gt $((now - 60)) ]; then + echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; + fi; + fi +} +_addRpathPrefix () +{ + + if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then + export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; + fi +} +patchPhase () +{ + + runHook prePatch; + local -a patchesArray; + concatTo patchesArray patches; + local -a flagsArray; + concatTo flagsArray patchFlags=-p1; + for i in "${patchesArray[@]}"; + do + echo "applying patch $i"; + local uncompress=cat; + case "$i" in + *.gz) + uncompress="gzip -d" + ;; + *.bz2) + uncompress="bzip2 -d" + ;; + *.xz) + uncompress="xz -d" + ;; + *.lzma) + uncompress="lzma -d" + ;; + esac; + $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; + done; + runHook postPatch +} +printPhases () +{ + + definePhases; + local phase; + for phase in ${phases[*]}; + do + printf '%s\n' "$phase"; + done +} +moveToOutput () +{ + + local patt="$1"; + local dstOut="$2"; + local output; + for output in $(getAllOutputNames); + do + if [ "${!output}" = "$dstOut" ]; then + continue; + fi; + local srcPath; + for srcPath in "${!output}"/$patt; + do + if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then + continue; + fi; + if [ "$dstOut" = REMOVE ]; then + echo "Removing $srcPath"; + rm -r "$srcPath"; + else + local dstPath="$dstOut${srcPath#${!output}}"; + echo "Moving $srcPath to $dstPath"; + if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then + rmdir "$srcPath" --ignore-fail-on-non-empty; + if [ -d "$srcPath" ]; then + mv -t "$dstPath" "$srcPath"/*; + rmdir "$srcPath"; + fi; + else + mkdir -p "$(readlink -m "$dstPath/..")"; + mv "$srcPath" "$dstPath"; + fi; + fi; + local srcParent="$(readlink -m "$srcPath/..")"; + if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then + echo "Removing empty $srcParent/ and (possibly) its parents"; + rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; + fi; + done; + done +} +runPhase () +{ + + local curPhase="$*"; + if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then + return; + fi; + if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then + return; + fi; + if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then + return; + fi; + if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then + return; + fi; + if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then + return; + fi; + if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then + return; + fi; + showPhaseHeader "$curPhase"; + dumpVars; + local startTime endTime; + startTime=$(date +"%s"); + eval "${!curPhase:-$curPhase}"; + endTime=$(date +"%s"); + showPhaseFooter "$curPhase" "$startTime" "$endTime"; + if [ "$curPhase" = unpackPhase ]; then + [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; + cd -- "${sourceRoot:-.}"; + fi +} +addPythonPath () +{ + + addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.13/site-packages +} +addToSearchPathWithCustomDelimiter () +{ + + local delimiter="$1"; + local varName="$2"; + local dir="$3"; + if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then + export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; + fi +} +patchShebangs () +{ + + local pathName; + local update=false; + while [[ $# -gt 0 ]]; do + case "$1" in + --host) + pathName=HOST_PATH; + shift + ;; + --build) + pathName=PATH; + shift + ;; + --update) + update=true; + shift + ;; + --) + shift; + break + ;; + -* | --*) + echo "Unknown option $1 supplied to patchShebangs" 1>&2; + return 1 + ;; + *) + break + ;; + esac; + done; + echo "patching script interpreter paths in $@"; + local f; + local oldPath; + local newPath; + local arg0; + local args; + local oldInterpreterLine; + local newInterpreterLine; + if [[ $# -eq 0 ]]; then + echo "No arguments supplied to patchShebangs" 1>&2; + return 0; + fi; + local f; + while IFS= read -r -d '' f; do + isScript "$f" || continue; + read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; + read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; + if [[ -z "${pathName:-}" ]]; then + if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then + pathName=HOST_PATH; + else + pathName=PATH; + fi; + fi; + if [[ "$oldPath" == *"/bin/env" ]]; then + if [[ $arg0 == "-S" ]]; then + arg0=${args%% *}; + [[ "$args" == *" "* ]] && args=${args#* } || args=; + newPath="$(PATH="${!pathName}" type -P "env" || true)"; + args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; + else + if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then + echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; + exit 1; + else + newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; + fi; + fi; + else + if [[ -z $oldPath ]]; then + oldPath="/bin/sh"; + fi; + newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; + args="$arg0 $args"; + fi; + newInterpreterLine="$newPath $args"; + newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; + if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then + if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then + echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; + escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; + timestamp=$(stat --printf "%y" "$f"); + tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); + sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; + local restoreReadOnly; + if [[ ! -w "$f" ]]; then + chmod +w "$f"; + restoreReadOnly=true; + fi; + cat "$tmpFile" > "$f"; + rm "$tmpFile"; + if [[ -n "${restoreReadOnly:-}" ]]; then + chmod -w "$f"; + fi; + touch --date "$timestamp" "$f"; + fi; + fi; + done < <(find "$@" -type f -perm -0100 -print0) +} +getTargetRole () +{ + + getRole "$targetOffset" +} +getRole () +{ + + case $1 in + -1) + role_post='_FOR_BUILD' + ;; + 0) + role_post='' + ;; + 1) + role_post='_FOR_TARGET' + ;; + *) + echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +nixLog () +{ + + [[ -z ${NIX_LOG_FD-} ]] && return 0; + local callerName="${FUNCNAME[1]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" +} +noBrokenSymlinks () +{ + + local -r output="${1:?}"; + local path; + local pathParent; + local symlinkTarget; + local -i numDanglingSymlinks=0; + local -i numReflexiveSymlinks=0; + local -i numUnreadableSymlinks=0; + if [[ ! -e $output ]]; then + nixWarnLog "skipping non-existent output $output"; + return 0; + fi; + nixInfoLog "running on $output"; + while IFS= read -r -d '' path; do + pathParent="$(dirname "$path")"; + if ! symlinkTarget="$(readlink "$path")"; then + nixErrorLog "the symlink $path is unreadable"; + numUnreadableSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget == /* ]]; then + nixInfoLog "symlink $path points to absolute target $symlinkTarget"; + else + nixInfoLog "symlink $path points to relative target $symlinkTarget"; + symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; + fi; + if [[ $symlinkTarget = "$TMPDIR"/* ]]; then + nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; + numDanglingSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then + nixInfoLog "symlink $path points outside the Nix store; ignoring"; + continue; + fi; + if [[ $path == "$symlinkTarget" ]]; then + nixErrorLog "the symlink $path is reflexive"; + numReflexiveSymlinks+=1; + else + if [[ ! -e $symlinkTarget ]]; then + nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; + numDanglingSymlinks+=1; + else + nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; + fi; + fi; + done < <(find "$output" -type l -print0); + if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then + nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; + exit 1; + fi; + return 0 +} +bintoolsWrapper_addLDVars () +{ + + local role_post; + getHostRoleEnvHook; + if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; + fi; + if [[ -d "$1/lib" ]]; then + local -a glob=($1/lib/lib*); + if [ "${#glob[*]}" -gt 0 ]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib"; + fi; + fi +} +runHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook; + for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + _eval "$hook" "$@"; + done; + return 0 +} +patchELF () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "shrinking RPATHs of ELF executables and libraries in $dir"; + local i; + while IFS= read -r -d '' i; do + if [[ "$i" =~ .build-id ]]; then + continue; + fi; + if ! isELF "$i"; then + continue; + fi; + echo "shrinking $i"; + patchelf --shrink-rpath "$i" || true; + done < <(find "$dir" -type f -print0) +} +getHostRole () +{ + + getRole "$hostOffset" +} +_callImplicitHook () +{ + + local def="$1"; + local hookName="$2"; + if declare -F "$hookName" > /dev/null; then + nixTalkativeLog "calling implicit '$hookName' function hook"; + "$hookName"; + else + if type -p "$hookName" > /dev/null; then + nixTalkativeLog "sourcing implicit '$hookName' script hook"; + source "$hookName"; + else + if [ -n "${!hookName:-}" ]; then + nixTalkativeLog "evaling implicit '$hookName' string hook"; + eval "${!hookName}"; + else + return "$def"; + fi; + fi; + fi +} +_multioutConfig () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then + return; + fi; + if [ -z "${shareDocName:-}" ]; then + local confScript="${configureScript:-}"; + if [ -z "$confScript" ] && [ -x ./configure ]; then + confScript=./configure; + fi; + if [ -f "$confScript" ]; then + local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; + fi; + if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then + shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; + fi; + fi; + prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; + prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal +} +_moveSystemdUserUnits () +{ + + if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then + return; + fi; + if [ ! -e "${prefix:?}/lib/systemd/user" ]; then + return; + fi; + local source="$prefix/lib/systemd/user"; + local target="$prefix/share/systemd/user"; + echo "moving $source/* to $target"; + mkdir -p "$target"; + ( shopt -s dotglob; + for i in "$source"/*; + do + mv "$i" "$target"; + done ); + rmdir "$source"; + ln -s "$target" "$source" +} +echoCmd () +{ + + printf "%s:" "$1"; + shift; + printf ' %q' "$@"; + echo +} +nixInfoLog () +{ + + _nixLogWithLevel 3 "$*" +} +nixChattyLog () +{ + + _nixLogWithLevel 5 "$*" +} +buildPhase () +{ + + runHook preBuild; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom buildPhase, doing nothing"; + else + foundMakefile=1; + local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; + echoCmd 'build flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postBuild +} +_eval () +{ + + if declare -F "$1" > /dev/null 2>&1; then + "$@"; + else + eval "$1"; + fi +} +consumeEntire () +{ + + if IFS='' read -r -d '' "$1"; then + echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; + return 1; + fi +} +nixErrorLog () +{ + + _nixLogWithLevel 0 "$*" +} +substituteAllInPlace () +{ + + local fileName="$1"; + shift; + substituteAll "$fileName" "$fileName" "$@" +} +distPhase () +{ + + runHook preDist; + local flagsArray=(); + concatTo flagsArray distFlags distFlagsArray distTarget=dist; + echo 'dist flags: %q' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + if [ "${dontCopyDist:-0}" != 1 ]; then + mkdir -p "$out/tarballs"; + cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; + fi; + runHook postDist +} +fixupPhase () +{ + + local output; + for output in $(getAllOutputNames); + do + if [ -e "${!output}" ]; then + chmod -R u+w,u-s,g-s "${!output}"; + fi; + done; + runHook preFixup; + local output; + for output in $(getAllOutputNames); + do + prefix="${!output}" runHook fixupOutput; + done; + recordPropagatedDependencies; + if [ -n "${setupHook:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; + fi; + if [ -n "${setupHooks:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + local hook; + for hook in ${setupHooks[@]}; + do + local content; + consumeEntire content < "$hook"; + substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; + unset -v content; + done; + unset -v hook; + fi; + if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then + mkdir -p "${!outputBin}/nix-support"; + printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; + fi; + runHook postFixup +} +getAllOutputNames () +{ + + if [ -n "$__structuredAttrs" ]; then + echo "${!outputs[*]}"; + else + echo "$outputs"; + fi +} +unpackFile () +{ + + curSrc="$1"; + echo "unpacking source archive $curSrc"; + if ! runOneHook unpackCmd "$curSrc"; then + echo "do not know how to unpack source archive $curSrc"; + exit 1; + fi +} +_nixLogWithLevel () +{ + + [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; + local logLevel; + case "${1:?}" in + 0) + logLevel=ERROR + ;; + 1) + logLevel=WARN + ;; + 2) + logLevel=NOTICE + ;; + 3) + logLevel=INFO + ;; + 4) + logLevel=TALKATIVE + ;; + 5) + logLevel=CHATTY + ;; + 6) + logLevel=DEBUG + ;; + 7) + logLevel=VOMIT + ;; + *) + echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; + return 1 + ;; + esac; + local callerName="${FUNCNAME[2]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" +} +fixLibtool () +{ + + local search_path; + for flag in $NIX_LDFLAGS; + do + case $flag in + -L*) + search_path+=" ${flag#-L}" + ;; + esac; + done; + sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' +} +nixTalkativeLog () +{ + + _nixLogWithLevel 4 "$*" +} +noBrokenSymlinksInAllOutputs () +{ + + if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then + for output in $(getAllOutputNames); + do + noBrokenSymlinks "${!output}"; + done; + fi +} +compressManPages () +{ + + local dir="$1"; + if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then + return; + fi; + echo "gzipping man pages under $dir/share/man/"; + find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; + find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do + local target; + target="$(readlink -f "$f")"; + if [ -f "$target".gz ]; then + ln -sf "$target".gz "$f".gz && rm "$f"; + fi; + done +} +_updateSourceDateEpochFromSourceRoot () +{ + + if [ -n "$sourceRoot" ]; then + updateSourceDateEpoch "$sourceRoot"; + fi +} +mapOffset () +{ + + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi +} +PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" +XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" + +eval "${shellHook:-}" +shopt -s expand_aliases + +exec /tmp/devenv-envNaxiU5/script \ No newline at end of file diff --git a/.devenv/shell-92a0ad1c011413a7.sh b/.devenv/shell-92a0ad1c011413a7.sh new file mode 100755 index 000000000..8fddf6aac --- /dev/null +++ b/.devenv/shell-92a0ad1c011413a7.sh @@ -0,0 +1,2313 @@ +if [ -n "$PS1" ] && [ -e $HOME/.bashrc ]; then + source $HOME/.bashrc; +fi + +shopt -u expand_aliases +PATH=${PATH:-} +nix_saved_PATH="$PATH" +XDG_DATA_DIRS=${XDG_DATA_DIRS:-} +nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" +prefix='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' +outputLib='out' +NIX_HARDENING_ENABLE='bindnow format fortify fortify3 libcxxhardeningfast pic relro stackclashprotection stackprotector strictflexarrays1 strictoverflow zerocallusedregs' +export NIX_HARDENING_ENABLE +LINENO='79' +AS='as' +export AS +PYTHONPATH='/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/python3.13/site-packages' +export PYTHONPATH +declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) +AR='ar' +export AR +DEVENV_RUNTIME='/run/user/1000/devenv-303d476' +export DEVENV_RUNTIME +GOROOT='/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share/go/' +export GOROOT +GOTOOLCHAIN='local' +export GOTOOLCHAIN +PYTHONHASHSEED='0' +export PYTHONHASHSEED +NIX_NO_SELF_RPATH='1' +NM='nm' +export NM +_PYTHON_HOST_PLATFORM='linux-x86_64' +export _PYTHON_HOST_PLATFORM +mesonFlags='' +export mesonFlags +declare -a pkgsBuildHost=('/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev' '/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9' '/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2' '/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1' '/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0' '/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0' '/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0' '/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1' '/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0' '/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22' '/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1' '/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0' '/nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev' '/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1' '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' '/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev' '/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev' '/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib' '/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0' '/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev' '/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib' '/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1' '/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev' '/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib' '/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1' '/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev' '/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0' '/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev' '/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0' '/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev' '/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin' '/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8' '/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev' '/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin' '/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1' '/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev' '/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26' '/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5' '/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev' '/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1' '/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev' '/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2' '/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev' '/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin' '/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7' '/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin' '/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0' '/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev' '/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin' '/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1' '/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0' '/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' '/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2' '/nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' '/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' ) +READELF='readelf' +export READELF +DEVENV_TASKS='' +export DEVENV_TASKS +NIX_CC='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' +export NIX_CC +declare -a envBuildTargetHooks=('addPythonPath' 'sysconfigdataHook' ) +declare -a envHostHostHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +doInstallCheck='' +export doInstallCheck +CONFIG_SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export CONFIG_SHELL +IN_NIX_SHELL='impure' +export IN_NIX_SHELL +depsBuildTarget='' +export depsBuildTarget +doCheck='' +export doCheck +out='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' +export out +outputInfo='out' +BASH='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +nativeBuildInputs='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev /nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2 /nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1 /nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0 /nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0 /nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0 /nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1 /nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0 /nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22 /nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1 /nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0 /nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12 /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev /nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0 /nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' +export nativeBuildInputs +DETERMINISTIC_BUILD='1' +export DETERMINISTIC_BUILD +depsBuildBuild='' +export depsBuildBuild +shell='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export shell +IFS=' +' +declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) +depsTargetTargetPropagated='' +export depsTargetTargetPropagated +OBJDUMP='objdump' +export OBJDUMP +CC='gcc' +export CC +declare -a envHostTargetHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) +depsHostHostPropagated='' +export depsHostHostPropagated +buildInputs='' +export buildInputs +declare -a envBuildHostHooks=('addPythonPath' 'sysconfigdataHook' ) +configureFlags='' +export configureFlags +defaultBuildInputs='' +outputMan='out' +propagatedNativeBuildInputs='' +export propagatedNativeBuildInputs +stdenv='/nix/store/w708nqm6lvvikrq8d3x45g96hzfij0r8-stdenv-linux' +export stdenv +PKG_CONFIG_PATH='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/lib/pkgconfig:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/pkgconfig:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/lib/pkgconfig:/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/lib/pkgconfig:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/lib/pkgconfig:/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/lib/pkgconfig:/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/lib/pkgconfig:/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/lib/pkgconfig:/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/lib/pkgconfig:/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/lib/pkgconfig:/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/lib/pkgconfig:/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/lib/pkgconfig:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share/pkgconfig:/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/lib/pkgconfig:/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/lib/pkgconfig' +export PKG_CONFIG_PATH +NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +GOPATH='/home/karim/Dev/DevOps-Intro/.devenv/state/go' +export GOPATH +NIX_STORE='/nix/store' +export NIX_STORE +outputBin='out' +PKG_CONFIG='pkg-config' +export PKG_CONFIG +hardeningDisable='' +export hardeningDisable +SOURCE_DATE_EPOCH='315532800' +export SOURCE_DATE_EPOCH +buildPhase='{ echo "------------------------------------------------------------"; + echo " WARNING: the existence of this path is not guaranteed."; + echo " It is an internal implementation detail for pkgs.mkShell."; + echo "------------------------------------------------------------"; + echo; + # Record all build inputs as runtime dependencies + export; +} >> "$out" +' +export buildPhase +declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) +OBJCOPY='objcopy' +export OBJCOPY +declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) +MACHTYPE='x86_64-pc-linux-gnu' +cmakeFlags='' +export cmakeFlags +STRINGS='strings' +export STRINGS +declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelative' '_multioutPropagateDev' ) +depsHostHost='' +export depsHostHost +LD='ld' +export LD +_substituteStream_has_warned_replace_deprecation='false' +name='devenv-shell-env' +export name +declare -a envBuildBuildHooks=('addPythonPath' 'sysconfigdataHook' ) +depsBuildBuildPropagated='' +export depsBuildBuildPropagated +declare -a pkgsHostHost=() +NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +SIZE='size' +export SIZE +builder='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export builder +DEVENV_ROOT='/home/karim/Dev/DevOps-Intro' +export DEVENV_ROOT +NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' +export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu +PYTHONNOUSERSITE='1' +export PYTHONNOUSERSITE +declare -a envTargetTargetHooks=() +initialPath='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10 /nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0 /nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12 /nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9 /nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12 /nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0 /nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35 /nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14 /nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin /nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1 /nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9 /nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8 /nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin /nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45' +SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' +export SHELL +outputDev='out' +outputInclude='out' +outputs='out' +export outputs +declare -a preConfigureHooks=('_multioutConfig' ) +CXX='g++' +export CXX +HOSTTYPE='x86_64' +OPTERR='1' +DEVENV_PROFILE='/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile' +export DEVENV_PROFILE +declare -a pkgsBuildBuild=() +shellHook=' +export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}" + + +# Override temp directories that stdenv set to NIX_BUILD_TOP. +# Only reset those that still point to the Nix build dir; leave +# any user/CI-supplied value intact so child processes (e.g. +# `devenv processes wait`) compute the same runtime directory. +for var in TMP TMPDIR TEMP TEMPDIR; do + if [ -n "${!var-}" ] && [ "${!var}" = "${NIX_BUILD_TOP-}" ]; then + export "$var"=/tmp + fi +done +if [ -n "${NIX_BUILD_TOP-}" ]; then + unset NIX_BUILD_TOP +fi + +# set path to locales on non-NixOS Linux hosts +if [ -z "${LOCALE_ARCHIVE-}" ]; then + export LOCALE_ARCHIVE=/nix/store/sp7b84c2jnbskd6dm2n5splgipg9d1f0-glibc-locales-2.42-61/lib/locale/locale-archive +fi + + +# direnv helper +if [ ! type -p direnv &>/dev/null && -f .envrc ]; then + echo "An .envrc file was detected, but the direnv command is not installed." + echo "To use this configuration, please install direnv: https://direnv.net/docs/installation.html" +fi + +mkdir -p "$DEVENV_STATE" +if [ ! -L "$DEVENV_DOTFILE/profile" ] || [ "$(/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin/readlink $DEVENV_DOTFILE/profile)" != "/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile" ] +then + ln -snf /nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile "$DEVENV_DOTFILE/profile" +fi +unset HOST_PATH NIX_BUILD_CORES __structuredAttrs buildInputs buildPhase builder depsBuildBuild depsBuildBuildPropagated depsBuildTarget depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget depsTargetTargetPropagated dontAddDisableDepTrack doCheck doInstallCheck nativeBuildInputs out outputs patches phases preferLocalBuild propagatedBuildInputs propagatedNativeBuildInputs shell shellHook stdenv strictDeps + +mkdir -p /run/user/1000/devenv-303d476 +ln -snf /run/user/1000/devenv-303d476 /home/karim/Dev/DevOps-Intro/.devenv/run + + +export PATH=$GOPATH/bin:$PATH + +echo "✨ devenv 2.0.6 is out of date. Please update to 2.1.2: https://devenv.sh/getting-started/#installation" >&2 + + +# Check whether the direnv integration is out of date. +{ + if [[ ":${DIRENV_ACTIVE-}:" == *":/home/karim/Dev/DevOps-Intro:"* ]]; then + if [[ ! "${DEVENV_NO_DIRENVRC_OUTDATED_WARNING-}" == 1 && ! "${DEVENV_DIRENVRC_ROLLING_UPGRADE-}" == 1 ]]; then + if [[ ${DEVENV_DIRENVRC_VERSION:-0} -lt 2 ]]; then + direnv_line=$(grep --color=never -E "source_url.*cachix/devenv" .envrc || echo "") + + echo "✨ The direnv integration in your .envrc is out of date." + echo "" + echo -n "RECOMMENDED: devenv can now auto-upgrade the direnv integration. " + if [[ -n "$direnv_line" ]]; then + echo "To enable this feature, replace the following line in your .envrc:" + echo "" + echo " $direnv_line" + echo "" + echo "with:" + echo "" + echo " eval \"\$(devenv direnvrc)\"" + else + echo "To enable this feature, replace the \`source_url\` line that fetches the direnvrc integration in your .envrc with:" + echo "" + echo " eval \"$(devenv direnvrc)\"" + fi + echo "" + echo "If you prefer to continue managing the integration manually, follow the upgrade instructions at https://devenv.sh/integrations/direnv/." + echo "" + echo "To disable this message:" + echo "" + echo " Add the following environment to your .envrc before \`use devenv\`:" + echo "" + echo " export DEVENV_NO_DIRENVRC_OUTDATED_WARNING=1" + echo "" + echo " Or set the following option in your devenv configuration:" + echo "" + echo " devenv.warnOnNewVersion = false;" + echo "" + fi + fi + fi +} >&2 + +echo "── DevOps-Intro devenv ──" +go version +git --version +echo "QuickNotes: cd app && go run ." + +' +export shellHook +DEVENV_DOTFILE='/home/karim/Dev/DevOps-Intro/.devenv' +export DEVENV_DOTFILE +declare -a unpackCmdHooks=('_defaultUnpack' ) +preferLocalBuild='1' +export preferLocalBuild +OSTYPE='linux-gnu' +defaultNativeBuildInputs='/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2 /nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' +DEVENV_STATE='/home/karim/Dev/DevOps-Intro/.devenv/state' +export DEVENV_STATE +system='x86_64-linux' +export system +strictDeps='' +export strictDeps +depsBuildTargetPropagated='' +export depsBuildTargetPropagated +NIX_BINTOOLS='/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' +export NIX_BINTOOLS +patches='' +export patches +OLDPWD='' +export OLDPWD +depsTargetTarget='' +export depsTargetTarget +PS4='+ ' +NIX_BUILD_CORES='4' +export NIX_BUILD_CORES +XDG_DATA_DIRS='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/share:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/share:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/share:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/share:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/share:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/share:/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/share:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/share:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/share:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/share:/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/share:/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26/share:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/share:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share:/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/share:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/share:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/share:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/share:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/share' +export XDG_DATA_DIRS +outputDoc='out' +declare -a pkgsTargetTarget=() +outputDevman='out' +declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) +STRIP='strip' +export STRIP +NIX_LDFLAGS='-rpath /nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib' +export NIX_LDFLAGS +pkg='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' +preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' +HOST_PATH='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' +export HOST_PATH +declare -a pkgsBuildTarget=() +PATH='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/bin:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/bin:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/bin:/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin:/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0/bin:/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0/bin:/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1/bin:/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0/bin:/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22/bin:/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1/bin:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/bin:/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1/bin:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/bin:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/bin:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/bin:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/bin:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/bin:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/bin:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/bin:/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin/bin:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/bin:/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin/bin:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/bin:/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin/bin:/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin/bin:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/bin:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/bin:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/bin:/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0/bin:/nix/store/sanx9fg8mry8mq92zhlm5qvb83qlxrlx-gcc-15.2.0/bin:/nix/store/pf30k3mg7n6bibc1k6609gyq7glk00k2-glibc-2.42-61-bin/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46/bin:/nix/store/p2vkw5s89ff1fs2d2rxqxiqil9s0jpcm-binutils-2.46/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' +export PATH +NIX_CFLAGS_COMPILE=' -frandom-seed=86aa67916d -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include' +export NIX_CFLAGS_COMPILE +_PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu' +export _PYTHON_SYSCONFIGDATA_NAME +declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) +dontAddDisableDepTrack='1' +export dontAddDisableDepTrack +GOTOOLDIR='/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin' +export GOTOOLDIR +DEVENV_TASK_FILE='/nix/store/67gwkyrn8qfd381zka7lgr23bm2d2v2a-tasks.json' +export DEVENV_TASK_FILE +NIX_ENFORCE_NO_NATIVE='1' +export NIX_ENFORCE_NO_NATIVE +__structuredAttrs='' +export __structuredAttrs +declare -a pkgsHostTarget=() +propagatedBuildInputs='' +export propagatedBuildInputs +RANLIB='ranlib' +export RANLIB +phases='buildPhase' +export phases +outputDevdoc='REMOVE' +concatStringsSep () +{ + + local sep="$1"; + local name="$2"; + local type oldifs; + if type=$(declare -p "$name" 2> /dev/null); then + local -n nameref="$name"; + case "${type#* }" in + -A*) + echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; + return 1 + ;; + -a*) + local IFS="$(printf '\036')" + ;; + *) + local IFS=" " + ;; + esac; + local ifs_separated="${nameref[*]}"; + echo -n "${ifs_separated//"$IFS"/"$sep"}"; + fi +} +checkPhase () +{ + + runHook preCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom checkPhase, doing nothing"; + runHook postCheck; + return; + fi; + if [[ -z "${checkTarget:-}" ]]; then + if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then + checkTarget="check"; + else + if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then + checkTarget="test"; + fi; + fi; + fi; + if [[ -z "${checkTarget:-}" ]]; then + echo "no check/test target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; + echoCmd 'check flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postCheck +} +distPhase () +{ + + runHook preDist; + local flagsArray=(); + concatTo flagsArray distFlags distFlagsArray distTarget=dist; + echo 'dist flags: %q' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + if [ "${dontCopyDist:-0}" != 1 ]; then + mkdir -p "$out/tarballs"; + cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; + fi; + runHook postDist +} +getTargetRole () +{ + + getRole "$targetOffset" +} +showPhaseFooter () +{ + + local phase="$1"; + local startTime="$2"; + local endTime="$3"; + local delta=$(( endTime - startTime )); + (( delta < 30 )) && return; + local H=$((delta/3600)); + local M=$((delta%3600/60)); + local S=$((delta%60)); + echo -n "$phase completed in "; + (( H > 0 )) && echo -n "$H hours "; + (( M > 0 )) && echo -n "$M minutes "; + echo "$S seconds" +} +appendToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=(${nameref+"${nameref[@]}"} "$@"); + else + nameref="${nameref-} $*"; + fi +} +ccWrapper_addCVars () +{ + + local role_post; + getHostRoleEnvHook; + local found=; + if [ -d "$1/include" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; + found=1; + fi; + if [ -d "$1/Library/Frameworks" ]; then + export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; + found=1; + fi; + if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then + local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; + export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; + fi +} +moveToOutput () +{ + + local patt="$1"; + local dstOut="$2"; + local output; + for output in $(getAllOutputNames); + do + if [ "${!output}" = "$dstOut" ]; then + continue; + fi; + local srcPath; + for srcPath in "${!output}"/$patt; + do + if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then + continue; + fi; + if [ "$dstOut" = REMOVE ]; then + echo "Removing $srcPath"; + rm -r "$srcPath"; + else + local dstPath="$dstOut${srcPath#${!output}}"; + echo "Moving $srcPath to $dstPath"; + if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then + rmdir "$srcPath" --ignore-fail-on-non-empty; + if [ -d "$srcPath" ]; then + mv -t "$dstPath" "$srcPath"/*; + rmdir "$srcPath"; + fi; + else + mkdir -p "$(readlink -m "$dstPath/..")"; + mv "$srcPath" "$dstPath"; + fi; + fi; + local srcParent="$(readlink -m "$srcPath/..")"; + if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then + echo "Removing empty $srcParent/ and (possibly) its parents"; + rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; + fi; + done; + done +} +isELF () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [ "$magic" = 'ELF' ]; then + return 0; + else + return 1; + fi +} +_addRpathPrefix () +{ + + if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then + export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; + fi +} +nixTalkativeLog () +{ + + _nixLogWithLevel 4 "$*" +} +recordPropagatedDependencies () +{ + + declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); + declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); + local propagatedInputsIndex; + for propagatedInputsIndex in "${!flatVars[@]}"; + do + local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; + local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; + [[ -n "${!propagatedInputsSlice}" ]] || continue; + mkdir -p "${!outputDev}/nix-support"; + printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; + done +} +substituteStream () +{ + + local var=$1; + local description=$2; + shift 2; + while (( "$#" )); do + local replace_mode="$1"; + case "$1" in + --replace) + if ! "$_substituteStream_has_warned_replace_deprecation"; then + echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; + _substituteStream_has_warned_replace_deprecation=true; + fi; + replace_mode='--replace-warn' + ;& + --replace-quiet | --replace-warn | --replace-fail) + pattern="$2"; + replacement="$3"; + shift 3; + if ! [[ "${!var}" == *"$pattern"* ]]; then + if [ "$replace_mode" == --replace-warn ]; then + printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + else + if [ "$replace_mode" == --replace-fail ]; then + printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; + return 1; + fi; + fi; + fi; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var) + local varName="$2"; + shift 2; + if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then + echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; + return 1; + fi; + if [ -z ${!varName+x} ]; then + echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; + return 1; + fi; + pattern="@$varName@"; + replacement="${!varName}"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' + ;; + --subst-var-by) + pattern="@$2@"; + replacement="$3"; + eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; + shift 3 + ;; + *) + echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; + return 1 + ;; + esac; + done; + printf "%s" "${!var}" +} +sysconfigdataHook () +{ + + if [ "$1" = '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' ]; then + export _PYTHON_HOST_PLATFORM='linux-x86_64'; + export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; + fi +} +_callImplicitHook () +{ + + local def="$1"; + local hookName="$2"; + if declare -F "$hookName" > /dev/null; then + nixTalkativeLog "calling implicit '$hookName' function hook"; + "$hookName"; + else + if type -p "$hookName" > /dev/null; then + nixTalkativeLog "sourcing implicit '$hookName' script hook"; + source "$hookName"; + else + if [ -n "${!hookName:-}" ]; then + nixTalkativeLog "evaling implicit '$hookName' string hook"; + eval "${!hookName}"; + else + return "$def"; + fi; + fi; + fi +} +updateSourceDateEpoch () +{ + + local path="$1"; + [[ $path == -* ]] && path="./$path"; + local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); + local time="${res[0]//\.[0-9]*/}"; + local newestFile="${res[1]}"; + if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then + echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; + export SOURCE_DATE_EPOCH="$time"; + local now="$(date +%s)"; + if [ "$time" -gt $((now - 60)) ]; then + echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; + fi; + fi +} +fixupPhase () +{ + + local output; + for output in $(getAllOutputNames); + do + if [ -e "${!output}" ]; then + chmod -R u+w,u-s,g-s "${!output}"; + fi; + done; + runHook preFixup; + local output; + for output in $(getAllOutputNames); + do + prefix="${!output}" runHook fixupOutput; + done; + recordPropagatedDependencies; + if [ -n "${setupHook:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; + fi; + if [ -n "${setupHooks:-}" ]; then + mkdir -p "${!outputDev}/nix-support"; + local hook; + for hook in ${setupHooks[@]}; + do + local content; + consumeEntire content < "$hook"; + substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; + unset -v content; + done; + unset -v hook; + fi; + if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then + mkdir -p "${!outputBin}/nix-support"; + printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; + fi; + runHook postFixup +} +stripDirs () +{ + + local cmd="$1"; + local ranlibCmd="$2"; + local paths="$3"; + local stripFlags="$4"; + local excludeFlags=(); + local pathsNew=; + [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; + [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; + local pattern; + if [ -n "${stripExclude:-}" ]; then + for pattern in "${stripExclude[@]}"; + do + excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); + done; + fi; + local p; + for p in ${paths}; + do + if [ -e "$prefix/$p" ]; then + pathsNew="${pathsNew} $prefix/$p"; + fi; + done; + paths=${pathsNew}; + if [ -n "${paths}" ]; then + echo "stripping (with command $cmd and flags $stripFlags) in $paths"; + local striperr; + striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; + find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; + [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); + rm "$striperr"; + find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; + fi +} +_doStrip () +{ + + local -ra flags=(dontStripHost dontStripTarget); + local -ra debugDirs=(stripDebugList stripDebugListTarget); + local -ra allDirs=(stripAllList stripAllListTarget); + local -ra stripCmds=(STRIP STRIP_FOR_TARGET); + local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); + stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; + stripDebugListTarget=${stripDebugListTarget[*]:-}; + stripAllList=${stripAllList[*]:-}; + stripAllListTarget=${stripAllListTarget[*]:-}; + local i; + for i in ${!stripCmds[@]}; + do + local -n flag="${flags[$i]}"; + local -n debugDirList="${debugDirs[$i]}"; + local -n allDirList="${allDirs[$i]}"; + local -n stripCmd="${stripCmds[$i]}"; + local -n ranlibCmd="${ranlibCmds[$i]}"; + if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then + continue; + fi; + stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; + stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; + done +} +addEnvHooks () +{ + + local depHostOffset="$1"; + shift; + local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; + local pkgHookVar; + for pkgHookVar in "${!pkgHookVarsSlice}"; + do + eval "${pkgHookVar}s"'+=("$@")'; + done +} +consumeEntire () +{ + + if IFS='' read -r -d '' "$1"; then + echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; + return 1; + fi +} +findInputs () +{ + + local -r pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + local varVar="${pkgAccumVarVars[hostOffset + 1]}"; + local varRef="$varVar[$((targetOffset - hostOffset))]"; + local var="${!varRef}"; + unset -v varVar varRef; + local varSlice="$var[*]"; + case " ${!varSlice-} " in + *" $pkg "*) + return 0 + ;; + esac; + unset -v varSlice; + eval "$var"'+=("$pkg")'; + if ! [ -e "$pkg" ]; then + echo "build input $pkg does not exist" 1>&2; + exit 1; + fi; + function mapOffset () + { + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi + }; + local relHostOffset; + for relHostOffset in "${allPlatOffsets[@]}"; + do + local files="${propagatedDepFilesVars[relHostOffset + 1]}"; + local hostOffsetNext; + mapOffset "$relHostOffset" hostOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + local relTargetOffset; + for relTargetOffset in "${allPlatOffsets[@]}"; + do + (( "$relHostOffset" <= "$relTargetOffset" )) || continue; + local fileRef="${files}[$relTargetOffset - $relHostOffset]"; + local file="${!fileRef}"; + unset -v fileRef; + local targetOffsetNext; + mapOffset "$relTargetOffset" targetOffsetNext; + (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; + [[ -f "$pkg/nix-support/$file" ]] || continue; + local pkgNext; + read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; + for pkgNext in $pkgNext; + do + findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; + done; + done; + done +} +patchELF () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "shrinking RPATHs of ELF executables and libraries in $dir"; + local i; + while IFS= read -r -d '' i; do + if [[ "$i" =~ .build-id ]]; then + continue; + fi; + if ! isELF "$i"; then + continue; + fi; + echo "shrinking $i"; + patchelf --shrink-rpath "$i" || true; + done < <(find "$dir" -type f -print0) +} +pkgConfigWrapper_addPkgConfigPath () +{ + + local role_post; + getHostRoleEnvHook; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; + addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" +} +getHostRole () +{ + + getRole "$hostOffset" +} +_activatePkgs () +{ + + local hostOffset targetOffset; + local pkg; + for hostOffset in "${allPlatOffsets[@]}"; + do + local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; + for targetOffset in "${allPlatOffsets[@]}"; + do + (( hostOffset <= targetOffset )) || continue; + local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + activatePackage "$pkg" "$hostOffset" "$targetOffset"; + done; + done; + done +} +_eval () +{ + + if declare -F "$1" > /dev/null 2>&1; then + "$@"; + else + eval "$1"; + fi +} +auditTmpdir () +{ + + local dir="$1"; + [ -e "$dir" ] || return 0; + echo "checking for references to $TMPDIR/ in $dir..."; + local tmpdir elf_fifo script_fifo; + tmpdir="$(mktemp -d)"; + elf_fifo="$tmpdir/elf"; + script_fifo="$tmpdir/script"; + mkfifo "$elf_fifo" "$script_fifo"; + ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do + if isELF "$file"; then + printf '%s\0' "$file" 1>&3; + else + if isScript "$file"; then + filename=${file##*/}; + dir=${file%/*}; + if [ -e "$dir/.$filename-wrapped" ]; then + printf '%s\0' "$file" 1>&4; + fi; + fi; + fi; + done; + exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then + echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$elf_fifo" ) & local pid_elf=$!; + local pid_script; + ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' + if grep -q -F "$TMPDIR/" "$1"; then + echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" + exit 1 + fi + ' _ < "$script_fifo" ) & local pid_script=$!; + wait "$pid_elf" || { + echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + wait "$pid_script" || { + echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; + exit 1 + }; + rm -r "$tmpdir" +} +dumpVars () +{ + + if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then + local old_umask; + old_umask=$(umask); + umask 0077; + export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; + umask "$old_umask"; + fi +} +runPhase () +{ + + local curPhase="$*"; + if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then + return; + fi; + if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then + return; + fi; + if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then + return; + fi; + if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then + return; + fi; + if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then + return; + fi; + if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then + return; + fi; + if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then + return; + fi; + if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then + return; + fi; + showPhaseHeader "$curPhase"; + dumpVars; + local startTime endTime; + startTime=$(date +"%s"); + eval "${!curPhase:-$curPhase}"; + endTime=$(date +"%s"); + showPhaseFooter "$curPhase" "$startTime" "$endTime"; + if [ "$curPhase" = unpackPhase ]; then + [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; + cd -- "${sourceRoot:-.}"; + fi +} +_defaultUnpack () +{ + + local fn="$1"; + local destination; + if [ -d "$fn" ]; then + destination="$(stripHash "$fn")"; + if [ -e "$destination" ]; then + echo "Cannot copy $fn to $destination: destination already exists!"; + echo "Did you specify two \"srcs\" with the same \"name\"?"; + return 1; + fi; + cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; + else + case "$fn" in + *.tar.xz | *.tar.lzma | *.txz) + ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; + true ) | tar xf - --mode=+w --warning=no-timestamp + ;; + *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) + tar xf "$fn" --mode=+w --warning=no-timestamp + ;; + *) + return 1 + ;; + esac; + fi +} +_multioutDocs () +{ + + local REMOVE=REMOVE; + moveToOutput share/info "${!outputInfo}"; + moveToOutput share/doc "${!outputDoc}"; + moveToOutput share/gtk-doc "${!outputDevdoc}"; + moveToOutput share/devhelp/books "${!outputDevdoc}"; + moveToOutput share/man "${!outputMan}"; + moveToOutput share/man/man3 "${!outputDevman}" +} +_multioutPropagateDev () +{ + + if [ "$(getAllOutputNames)" = "out" ]; then + return; + fi; + local outputFirst; + for outputFirst in $(getAllOutputNames); + do + break; + done; + local propagaterOutput="$outputDev"; + if [ -z "$propagaterOutput" ]; then + propagaterOutput="$outputFirst"; + fi; + if [ -z "${propagatedBuildOutputs+1}" ]; then + local po_dirty="$outputBin $outputInclude $outputLib"; + set +o pipefail; + propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; + set -o pipefail; + fi; + if [ -z "$propagatedBuildOutputs" ]; then + return; + fi; + mkdir -p "${!propagaterOutput}"/nix-support; + for output in $propagatedBuildOutputs; + do + echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; + done +} +printPhases () +{ + + definePhases; + local phase; + for phase in ${phases[*]}; + do + printf '%s\n' "$phase"; + done +} +substituteInPlace () +{ + + local -a fileNames=(); + for arg in "$@"; + do + if [[ "$arg" = "--"* ]]; then + break; + fi; + fileNames+=("$arg"); + shift; + done; + if ! [[ "${#fileNames[@]}" -gt 0 ]]; then + echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; + return 1; + fi; + for file in "${fileNames[@]}"; + do + substitute "$file" "$file" "$@"; + done +} +definePhases () +{ + + if [ -z "${phases[*]:-}" ]; then + phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; + fi +} +echoCmd () +{ + + printf "%s:" "$1"; + shift; + printf ' %q' "$@"; + echo +} +showPhaseHeader () +{ + + local phase="$1"; + echo "Running phase: $phase"; + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" +} +nixNoticeLog () +{ + + _nixLogWithLevel 2 "$*" +} +addToSearchPath () +{ + + addToSearchPathWithCustomDelimiter ":" "$@" +} +activatePackage () +{ + + local pkg="$1"; + local -r hostOffset="$2"; + local -r targetOffset="$3"; + (( hostOffset <= targetOffset )) || exit 1; + if [ -f "$pkg" ]; then + nixTalkativeLog "sourcing setup hook '$pkg'"; + source "$pkg"; + fi; + if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then + addToSearchPath _PATH "$pkg/bin"; + fi; + if (( hostOffset <= -1 )); then + addToSearchPath _XDG_DATA_DIRS "$pkg/share"; + fi; + if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then + addToSearchPath _HOST_PATH "$pkg/bin"; + fi; + if [[ -f "$pkg/nix-support/setup-hook" ]]; then + nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; + source "$pkg/nix-support/setup-hook"; + fi +} +isMachO () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 4 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then + return 0; + else + if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then + return 0; + else + return 1; + fi; + fi; + fi +} +_nixLogWithLevel () +{ + + [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; + local logLevel; + case "${1:?}" in + 0) + logLevel=ERROR + ;; + 1) + logLevel=WARN + ;; + 2) + logLevel=NOTICE + ;; + 3) + logLevel=INFO + ;; + 4) + logLevel=TALKATIVE + ;; + 5) + logLevel=CHATTY + ;; + 6) + logLevel=DEBUG + ;; + 7) + logLevel=VOMIT + ;; + *) + echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; + return 1 + ;; + esac; + local callerName="${FUNCNAME[2]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" +} +mapOffset () +{ + + local -r inputOffset="$1"; + local -n outputOffset="$2"; + if (( inputOffset <= 0 )); then + outputOffset=$((inputOffset + hostOffset)); + else + outputOffset=$((inputOffset - 1 + targetOffset)); + fi +} +substituteAllInPlace () +{ + + local fileName="$1"; + shift; + substituteAll "$fileName" "$fileName" "$@" +} +toPythonPath () +{ + + local paths="$1"; + local result=; + for i in $paths; + do + p="$i/lib/python3.13/site-packages"; + result="${result}${result:+:}$p"; + done; + echo $result +} +getTargetRoleEnvHook () +{ + + getRole "$depTargetOffset" +} +getRole () +{ + + case $1 in + -1) + role_post='_FOR_BUILD' + ;; + 0) + role_post='' + ;; + 1) + role_post='_FOR_TARGET' + ;; + *) + echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +addToSearchPathWithCustomDelimiter () +{ + + local delimiter="$1"; + local varName="$2"; + local dir="$3"; + if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then + export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; + fi +} +addPythonPath () +{ + + addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.13/site-packages +} +unpackFile () +{ + + curSrc="$1"; + echo "unpacking source archive $curSrc"; + if ! runOneHook unpackCmd "$curSrc"; then + echo "do not know how to unpack source archive $curSrc"; + exit 1; + fi +} +genericBuild () +{ + + export GZIP_NO_TIMESTAMPS=1; + if [ -f "${buildCommandPath:-}" ]; then + source "$buildCommandPath"; + return; + fi; + if [ -n "${buildCommand:-}" ]; then + eval "$buildCommand"; + return; + fi; + definePhases; + for curPhase in ${phases[*]}; + do + runPhase "$curPhase"; + done +} +_multioutDevs () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then + return; + fi; + moveToOutput include "${!outputInclude}"; + moveToOutput lib/pkgconfig "${!outputDev}"; + moveToOutput share/pkgconfig "${!outputDev}"; + moveToOutput lib/cmake "${!outputDev}"; + moveToOutput share/aclocal "${!outputDev}"; + for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; + do + echo "Patching '$f' includedir to output ${!outputInclude}"; + sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; + done +} +getHostRoleEnvHook () +{ + + getRole "$depHostOffset" +} +_moveLib64 () +{ + + if [ "${dontMoveLib64-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then + return; + fi; + echo "moving $prefix/lib64/* to $prefix/lib"; + mkdir -p $prefix/lib; + shopt -s dotglob; + for i in $prefix/lib64/*; + do + mv --no-clobber "$i" $prefix/lib; + done; + shopt -u dotglob; + rmdir $prefix/lib64; + ln -s lib $prefix/lib64 +} +_makeSymlinksRelative () +{ + + local prefixes; + prefixes=(); + for output in $(getAllOutputNames); + do + [ ! -e "${!output}" ] && continue; + prefixes+=("${!output}"); + done; + find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' + output="$1" + link="$2" + + linkTarget=$(readlink "$link") + + # only touch links that point inside the same output tree + [[ $linkTarget == "$output"/* ]] || exit 0 + + if [ ! -e "$linkTarget" ]; then + echo "the symlink $link is broken, it points to $linkTarget (which is missing)" + fi + + echo "making symlink relative: $link" + ln -snrf "$linkTarget" "$link" + ' _ +} +_overrideFirst () +{ + + if [ -z "${!1-}" ]; then + _assignFirst "$@"; + fi +} +_moveToShare () +{ + + if [ -n "$__structuredAttrs" ]; then + if [ -z "${forceShare-}" ]; then + forceShare=(man doc info); + fi; + else + forceShare=(${forceShare:-man doc info}); + fi; + if [[ -z "$out" ]]; then + return; + fi; + for d in "${forceShare[@]}"; + do + if [ -d "$out/$d" ]; then + if [ -d "$out/share/$d" ]; then + echo "both $d/ and share/$d/ exist!"; + else + echo "moving $out/$d to $out/share/$d"; + mkdir -p $out/share; + mv $out/$d $out/share/; + fi; + fi; + done +} +_updateSourceDateEpochFromSourceRoot () +{ + + if [ -n "$sourceRoot" ]; then + updateSourceDateEpoch "$sourceRoot"; + fi +} +patchShebangs () +{ + + local pathName; + local update=false; + while [[ $# -gt 0 ]]; do + case "$1" in + --host) + pathName=HOST_PATH; + shift + ;; + --build) + pathName=PATH; + shift + ;; + --update) + update=true; + shift + ;; + --) + shift; + break + ;; + -* | --*) + echo "Unknown option $1 supplied to patchShebangs" 1>&2; + return 1 + ;; + *) + break + ;; + esac; + done; + echo "patching script interpreter paths in $@"; + local f; + local oldPath; + local newPath; + local arg0; + local args; + local oldInterpreterLine; + local newInterpreterLine; + if [[ $# -eq 0 ]]; then + echo "No arguments supplied to patchShebangs" 1>&2; + return 0; + fi; + local f; + while IFS= read -r -d '' f; do + isScript "$f" || continue; + read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; + read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; + if [[ -z "${pathName:-}" ]]; then + if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then + pathName=HOST_PATH; + else + pathName=PATH; + fi; + fi; + if [[ "$oldPath" == *"/bin/env" ]]; then + if [[ $arg0 == "-S" ]]; then + arg0=${args%% *}; + [[ "$args" == *" "* ]] && args=${args#* } || args=; + newPath="$(PATH="${!pathName}" type -P "env" || true)"; + args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; + else + if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then + echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; + exit 1; + else + newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; + fi; + fi; + else + if [[ -z $oldPath ]]; then + oldPath="/bin/sh"; + fi; + newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; + args="$arg0 $args"; + fi; + newInterpreterLine="$newPath $args"; + newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; + if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then + if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then + echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; + escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; + timestamp=$(stat --printf "%y" "$f"); + tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); + sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; + local restoreReadOnly; + if [[ ! -w "$f" ]]; then + chmod +w "$f"; + restoreReadOnly=true; + fi; + cat "$tmpFile" > "$f"; + rm "$tmpFile"; + if [[ -n "${restoreReadOnly:-}" ]]; then + chmod -w "$f"; + fi; + touch --date "$timestamp" "$f"; + fi; + fi; + done < <(find "$@" -type f -perm -0100 -print0) +} +noBrokenSymlinks () +{ + + local -r output="${1:?}"; + local path; + local pathParent; + local symlinkTarget; + local -i numDanglingSymlinks=0; + local -i numReflexiveSymlinks=0; + local -i numUnreadableSymlinks=0; + if [[ ! -e $output ]]; then + nixWarnLog "skipping non-existent output $output"; + return 0; + fi; + nixInfoLog "running on $output"; + while IFS= read -r -d '' path; do + pathParent="$(dirname "$path")"; + if ! symlinkTarget="$(readlink "$path")"; then + nixErrorLog "the symlink $path is unreadable"; + numUnreadableSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget == /* ]]; then + nixInfoLog "symlink $path points to absolute target $symlinkTarget"; + else + nixInfoLog "symlink $path points to relative target $symlinkTarget"; + symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; + fi; + if [[ $symlinkTarget = "$TMPDIR"/* ]]; then + nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; + numDanglingSymlinks+=1; + continue; + fi; + if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then + nixInfoLog "symlink $path points outside the Nix store; ignoring"; + continue; + fi; + if [[ $path == "$symlinkTarget" ]]; then + nixErrorLog "the symlink $path is reflexive"; + numReflexiveSymlinks+=1; + else + if [[ ! -e $symlinkTarget ]]; then + nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; + numDanglingSymlinks+=1; + else + nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; + fi; + fi; + done < <(find "$output" -type l -print0); + if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then + nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; + exit 1; + fi; + return 0 +} +patchShebangsAuto () +{ + + if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then + if [[ "$output" != out && "$output" = "$outputDev" ]]; then + patchShebangs --build "$prefix"; + else + patchShebangs --host "$prefix"; + fi; + fi +} +compressManPages () +{ + + local dir="$1"; + if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then + return; + fi; + echo "gzipping man pages under $dir/share/man/"; + find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; + find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do + local target; + target="$(readlink -f "$f")"; + if [ -f "$target".gz ]; then + ln -sf "$target".gz "$f".gz && rm "$f"; + fi; + done +} +nixChattyLog () +{ + + _nixLogWithLevel 5 "$*" +} +runHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook; + for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + _eval "$hook" "$@"; + done; + return 0 +} +bintoolsWrapper_addLDVars () +{ + + local role_post; + getHostRoleEnvHook; + if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; + fi; + if [[ -d "$1/lib" ]]; then + local -a glob=($1/lib/lib*); + if [ "${#glob[*]}" -gt 0 ]; then + export NIX_LDFLAGS${role_post}+=" -L$1/lib"; + fi; + fi +} +configurePhase () +{ + + runHook preConfigure; + : "${configureScript=}"; + if [[ -z "$configureScript" && -x ./configure ]]; then + configureScript=./configure; + fi; + if [ -z "${dontFixLibtool:-}" ]; then + export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; + local i; + find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do + echo "fixing libtool script $i"; + fixLibtool "$i"; + done; + CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); + find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; + rm -f "$CONFIGURE_MTIME_REFERENCE"; + fi; + if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then + local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; + if [ "${prefixKeyOrDefault: -1}" = " " ]; then + prependToVar configureFlags "$prefix"; + prependToVar configureFlags "${prefixKeyOrDefault::-1}"; + else + prependToVar configureFlags "$prefixKeyOrDefault$prefix"; + fi; + fi; + if [[ -f "$configureScript" ]]; then + if [ -z "${dontAddDisableDepTrack:-}" ]; then + if grep -q dependency-tracking "$configureScript"; then + prependToVar configureFlags --disable-dependency-tracking; + fi; + fi; + if [ -z "${dontDisableStatic:-}" ]; then + if grep -q enable-static "$configureScript"; then + prependToVar configureFlags --disable-static; + fi; + fi; + if [ -z "${dontPatchShebangsInConfigure:-}" ]; then + patchShebangs --build "$configureScript"; + fi; + fi; + if [ -n "$configureScript" ]; then + local -a flagsArray; + concatTo flagsArray configureFlags configureFlagsArray; + echoCmd 'configure flags' "${flagsArray[@]}"; + $configureScript "${flagsArray[@]}"; + unset flagsArray; + else + echo "no configure script, doing nothing"; + fi; + runHook postConfigure +} +fixLibtool () +{ + + local search_path; + for flag in $NIX_LDFLAGS; + do + case $flag in + -L*) + search_path+=" ${flag#-L}" + ;; + esac; + done; + sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' +} +_multioutConfig () +{ + + if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then + return; + fi; + if [ -z "${shareDocName:-}" ]; then + local confScript="${configureScript:-}"; + if [ -z "$confScript" ] && [ -x ./configure ]; then + confScript=./configure; + fi; + if [ -f "$confScript" ]; then + local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; + fi; + if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then + shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; + fi; + fi; + prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; + prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal +} +concatTo () +{ + + local -; + set -o noglob; + local -n targetref="$1"; + shift; + local arg default name type; + for arg in "$@"; + do + IFS="=" read -r name default <<< "$arg"; + local -n nameref="$name"; + if [[ -z "${nameref[*]}" && -n "$default" ]]; then + targetref+=("$default"); + else + if type=$(declare -p "$name" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; + return 1 + ;; + -a*) + targetref+=("${nameref[@]}") + ;; + *) + if [[ "$name" = *"Array" ]]; then + nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; + targetref+=(${nameref+"${nameref[@]}"}); + else + targetref+=(${nameref-}); + fi + ;; + esac; + fi; + fi; + done +} +getTargetRoleWrapper () +{ + + case $targetOffset in + -1) + export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 + ;; + 0) + export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 + ;; + 1) + export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 + ;; + *) + echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; + return 1 + ;; + esac +} +_logHook () +{ + + if [[ -z ${NIX_LOG_FD-} ]]; then + return; + fi; + local hookKind="$1"; + local hookExpr="$2"; + shift 2; + if declare -F "$hookExpr" > /dev/null 2>&1; then + nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; + else + if type -p "$hookExpr" > /dev/null; then + nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; + else + if [[ "$hookExpr" != "_callImplicitHook"* ]]; then + local exprToOutput; + if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then + exprToOutput="$hookExpr"; + else + local hookExprLine; + while IFS= read -r hookExprLine; do + hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; + if [[ -n "$hookExprLine" ]]; then + exprToOutput+="$hookExprLine\\n "; + fi; + done <<< "$hookExpr"; + exprToOutput="${exprToOutput%%\\n }"; + fi; + nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; + fi; + fi; + fi +} +buildPhase () +{ + + runHook preBuild; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom buildPhase, doing nothing"; + else + foundMakefile=1; + local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; + echoCmd 'build flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + runHook postBuild +} +isScript () +{ + + local fn="$1"; + local fd; + local magic; + exec {fd}< "$fn"; + LANG=C read -r -n 2 -u "$fd" magic; + exec {fd}>&-; + if [[ "$magic" =~ \#! ]]; then + return 0; + else + return 1; + fi +} +noBrokenSymlinksInAllOutputs () +{ + + if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then + for output in $(getAllOutputNames); + do + noBrokenSymlinks "${!output}"; + done; + fi +} +_moveSystemdUserUnits () +{ + + if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then + return; + fi; + if [ ! -e "${prefix:?}/lib/systemd/user" ]; then + return; + fi; + local source="$prefix/lib/systemd/user"; + local target="$prefix/share/systemd/user"; + echo "moving $source/* to $target"; + mkdir -p "$target"; + ( shopt -s dotglob; + for i in "$source"/*; + do + mv "$i" "$target"; + done ); + rmdir "$source"; + ln -s "$target" "$source" +} +exitHandler () +{ + + exitCode="$?"; + set +e; + if [ -n "${showBuildStats:-}" ]; then + read -r -d '' -a buildTimes < <(times); + echo "build times:"; + echo "user time for the shell ${buildTimes[0]}"; + echo "system time for the shell ${buildTimes[1]}"; + echo "user time for all child processes ${buildTimes[2]}"; + echo "system time for all child processes ${buildTimes[3]}"; + fi; + if (( "$exitCode" != 0 )); then + runHook failureHook; + if [ -n "${succeedOnFailure:-}" ]; then + echo "build failed with exit code $exitCode (ignored)"; + mkdir -p "$out/nix-support"; + printf "%s" "$exitCode" > "$out/nix-support/failed"; + exit 0; + fi; + else + runHook exitHook; + fi; + return "$exitCode" +} +_allFlags () +{ + + export system pname name version; + while IFS='' read -r varName; do + nixTalkativeLog "@${varName}@ -> ${!varName}"; + args+=("--subst-var" "$varName"); + done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') +} +installPhase () +{ + + runHook preInstall; + if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then + echo "no Makefile or custom installPhase, doing nothing"; + runHook postInstall; + return; + else + foundMakefile=1; + fi; + if [ -n "$prefix" ]; then + mkdir -p "$prefix"; + fi; + local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; + echoCmd 'install flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + runHook postInstall +} +nixLog () +{ + + [[ -z ${NIX_LOG_FD-} ]] && return 0; + local callerName="${FUNCNAME[1]}"; + if [[ $callerName == "_callImplicitHook" ]]; then + callerName="${hookName:?}"; + fi; + printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" +} +nixErrorLog () +{ + + _nixLogWithLevel 0 "$*" +} +nixVomitLog () +{ + + _nixLogWithLevel 7 "$*" +} +nixWarnLog () +{ + + _nixLogWithLevel 1 "$*" +} +nixDebugLog () +{ + + _nixLogWithLevel 6 "$*" +} +prependToVar () +{ + + local -n nameref="$1"; + local useArray type; + if [ -n "$__structuredAttrs" ]; then + useArray=true; + else + useArray=false; + fi; + if type=$(declare -p "$1" 2> /dev/null); then + case "${type#* }" in + -A*) + echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; + return 1 + ;; + -a*) + useArray=true + ;; + *) + useArray=false + ;; + esac; + fi; + shift; + if $useArray; then + nameref=("$@" ${nameref+"${nameref[@]}"}); + else + nameref="$* ${nameref-}"; + fi +} +_moveSbin () +{ + + if [ "${dontMoveSbin-}" = 1 ]; then + return; + fi; + if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then + return; + fi; + echo "moving $prefix/sbin/* to $prefix/bin"; + mkdir -p $prefix/bin; + shopt -s dotglob; + for i in $prefix/sbin/*; + do + mv "$i" $prefix/bin; + done; + shopt -u dotglob; + rmdir $prefix/sbin; + ln -s bin $prefix/sbin +} +getAllOutputNames () +{ + + if [ -n "$__structuredAttrs" ]; then + echo "${!outputs[*]}"; + else + echo "$outputs"; + fi +} +printWords () +{ + + (( "$#" > 0 )) || return 0; + printf '%s ' "$@" +} +runOneHook () +{ + + local hookName="$1"; + shift; + local hooksSlice="${hookName%Hook}Hooks[@]"; + local hook ret=1; + for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; + do + _logHook "$hookName" "$hook" "$@"; + if _eval "$hook" "$@"; then + ret=0; + break; + fi; + done; + return "$ret" +} +patchPhase () +{ + + runHook prePatch; + local -a patchesArray; + concatTo patchesArray patches; + local -a flagsArray; + concatTo flagsArray patchFlags=-p1; + for i in "${patchesArray[@]}"; + do + echo "applying patch $i"; + local uncompress=cat; + case "$i" in + *.gz) + uncompress="gzip -d" + ;; + *.bz2) + uncompress="bzip2 -d" + ;; + *.xz) + uncompress="xz -d" + ;; + *.lzma) + uncompress="lzma -d" + ;; + esac; + $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; + done; + runHook postPatch +} +stripHash () +{ + + local strippedName casematchOpt=0; + strippedName="$(basename -- "$1")"; + shopt -q nocasematch && casematchOpt=1; + shopt -u nocasematch; + if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then + echo "${strippedName:33}"; + else + echo "$strippedName"; + fi; + if (( casematchOpt )); then + shopt -s nocasematch; + fi +} +installCheckPhase () +{ + + runHook preInstallCheck; + if [[ -z "${foundMakefile:-}" ]]; then + echo "no Makefile or custom installCheckPhase, doing nothing"; + else + if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then + echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; + else + local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); + concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; + echoCmd 'installcheck flags' "${flagsArray[@]}"; + make ${makefile:+-f $makefile} "${flagsArray[@]}"; + unset flagsArray; + fi; + fi; + runHook postInstallCheck +} +substituteAll () +{ + + local input="$1"; + local output="$2"; + local -a args=(); + _allFlags; + substitute "$input" "$output" "${args[@]}" +} +_addToEnv () +{ + + local depHostOffset depTargetOffset; + local pkg; + for depHostOffset in "${allPlatOffsets[@]}"; + do + local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; + local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; + for depTargetOffset in "${allPlatOffsets[@]}"; + do + (( depHostOffset <= depTargetOffset )) || continue; + local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; + if [[ -z "${strictDeps-}" ]]; then + local visitedPkgs=""; + for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; + do + if [[ "$visitedPkgs" = *"$pkg"* ]]; then + continue; + fi; + runHook "${!hookRef}" "$pkg"; + visitedPkgs+=" $pkg"; + done; + else + local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; + local pkgsSlice="${!pkgsRef}[@]"; + for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; + do + runHook "${!hookRef}" "$pkg"; + done; + fi; + done; + done +} +substituteAllStream () +{ + + local -a args=(); + _allFlags; + substituteStream "$1" "$2" "${args[@]}" +} +unpackPhase () +{ + + runHook preUnpack; + if [ -z "${srcs:-}" ]; then + if [ -z "${src:-}" ]; then + echo 'variable $src or $srcs should point to the source'; + exit 1; + fi; + srcs="$src"; + fi; + local -a srcsArray; + concatTo srcsArray srcs; + local dirsBefore=""; + for i in *; + do + if [ -d "$i" ]; then + dirsBefore="$dirsBefore $i "; + fi; + done; + for i in "${srcsArray[@]}"; + do + unpackFile "$i"; + done; + : "${sourceRoot=}"; + if [ -n "${setSourceRoot:-}" ]; then + runOneHook setSourceRoot; + else + if [ -z "$sourceRoot" ]; then + for i in *; + do + if [ -d "$i" ]; then + case $dirsBefore in + *\ $i\ *) + + ;; + *) + if [ -n "$sourceRoot" ]; then + echo "unpacker produced multiple directories"; + exit 1; + fi; + sourceRoot="$i" + ;; + esac; + fi; + done; + fi; + fi; + if [ -z "$sourceRoot" ]; then + echo "unpacker appears to have produced no directories"; + exit 1; + fi; + echo "source root is $sourceRoot"; + if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then + chmod -R u+w -- "$sourceRoot"; + fi; + runHook postUnpack +} +nixInfoLog () +{ + + _nixLogWithLevel 3 "$*" +} +_assignFirst () +{ + + local varName="$1"; + local _var; + local REMOVE=REMOVE; + shift; + for _var in "$@"; + do + if [ -n "${!_var-}" ]; then + eval "${varName}"="${_var}"; + return; + fi; + done; + echo; + echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; + echo " The following variables were all unset or empty:"; + echo " $*"; + if [ -z "${out:-}" ]; then + echo ' If you do not want an "out" output in your derivation, make sure to define'; + echo ' the other specific required outputs. This can be achieved by picking one'; + echo " of the above as an output."; + echo ' You do not have to remove "out" if you want to have a different default'; + echo ' output, because the first output is taken as a default.'; + echo; + fi; + return 1 +} +printLines () +{ + + (( "$#" > 0 )) || return 0; + printf '%s\n' "$@" +} +substitute () +{ + + local input="$1"; + local output="$2"; + shift 2; + if [ ! -f "$input" ]; then + echo "substitute(): ERROR: file '$input' does not exist" 1>&2; + return 1; + fi; + local content; + consumeEntire content < "$input"; + if [ -e "$output" ]; then + chmod +w "$output"; + fi; + substituteStream content "file '$input'" "$@" > "$output" +} +updateAutotoolsGnuConfigScriptsPhase () +{ + + if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then + return; + fi; + for script in config.sub config.guess; + do + for f in $(find . -type f -name "$script"); + do + echo "Updating Autotools / GNU config script to a newer upstream version: $f"; + cp -f "/nix/store/kppfbp4x7mhfz1q5zswavxxxq71v2f7c-gnu-config-2024-01-01/$script" "$f"; + done; + done +} +_pruneLibtoolFiles () +{ + + if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then + return; + fi; + find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; +} +PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" +XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" + +eval "${shellHook:-}" +shopt -s expand_aliases + +exec /tmp/devenv-envclAfdo/script \ No newline at end of file diff --git a/.devenv/state/files.json b/.devenv/state/files.json new file mode 100644 index 000000000..b4c7443fe --- /dev/null +++ b/.devenv/state/files.json @@ -0,0 +1 @@ +{"managedFiles":[]} diff --git a/.devenv/state/tasks.db b/.devenv/state/tasks.db new file mode 100644 index 0000000000000000000000000000000000000000..ea9212c5733bdca68b9aa5662070a8a0f5cd9ab7 GIT binary patch literal 36864 zcmeI)O>Em#00(dO^|lpRF)=Pn~1F!z==q$d-D3;O9BIUjfGXWo4HA`<G>EW_*Wb zV>wzmJHGPK{Gq?EcYKxc!*Gy|&CK}Tue!2g>7xaYo=^5GsT7uq;<4tFxhX<>OS@eW zZ;0z;ZGC06uzrW!6z|N_lws#cMZ8@hr7}IL#iEzwb@p^@y`h*FJU8^vKeR|9NpdfIom+C}X4x!JM@pA*OM2C@GRuHSmE zAC~O660PPG(y+U8j@vXm$GO=VXLg><+Ks!j@wk_{(Q;h69hN9oTdJE|P1!XYwsZ2@e+=McY8Qf#eZA?>%w%ch1|3T$ z#}Of#?x;<3*Q?<4sG$SEc3j!A=)m#PS60Q1N?~>F^blCCuCI%wiZr~%(;&oYsjBWc zr-n{1mHz3gJ5H-kmWt)2VVS)&y{)S)uT{Mf+i(70z)r>A@=wM#660`BVo2P{m;n8m z4S7Gc5qkKdpEC4?009U<00Izz00bZa0SG_<0uX?}*$TYtV}qA7VJmQH`?u>~ePi0D zn@*+qM2b&vJW1sjv)RQg_lab0KKfAn@x|t!d&TFE>?hAY`Zn}Xm~Gw0Vq-Dk!Z zH6?T9^Ggpt{^{}L*W?NN^VKQZFJJU`hQ1IW009U<00Izz00bZa0SG_<0uVS?0^vX~ z+*?WT_W$WW{UbmC0uX=z1Rwwb2tWV=5P$##AaITay#0U7|IhIkjIKcd0uX=z1Rwwb z2tWV=5P$##sDQWs@4xsR6Mc`qAwU2E5P$##AOHafKmY;|fB*#k*8-hbD9j`~Y`7B% zY5Kly?=RAaIqJ=gnr>N1+iWKt`V2=sscf6|odea$T6?=YdqPG~_O|Z{X{Eirub6G+ zAkoX5ILe$87E(N)7L;r{ujCX}&E(Y#r>KgN&Koo~n^kyaLCd9-Y>GFGoFJ=0Ce16V zwxBDST)s2ShM8<9GSV{dX`jxbYU#4w+8t?}%J1LfYjsU9?0PP1TN#sYZwd9fVDX&g zY_$iC>*i1N^BY{=kn@URXxX%q(>Okt$!mFDFjPa%@F_**bV1;BJ+1NrujCa@;B)zO zN>%bgZXuKAy#0TFbd8CAM&A%1009U<00Izz00bZa0SG_<0uXp9fz2SD?ECs_5dY~+ zpREMx3df-6qZNvg6@-7jyb%{2%-OXaB{a1rUG$1Rwwb2tWV=5P$##An+;)ylVUZ Fe*qA0soVen literal 0 HcmV?d00001 diff --git a/.devenv/task-names.txt b/.devenv/task-names.txt new file mode 100644 index 000000000..be2db38fe --- /dev/null +++ b/.devenv/task-names.txt @@ -0,0 +1,5 @@ +devenv:container:copy +devenv:enterShell +devenv:enterTest +devenv:files +devenv:files:cleanup \ No newline at end of file diff --git a/.envrc b/.envrc new file mode 100644 index 000000000..c18a76248 --- /dev/null +++ b/.envrc @@ -0,0 +1,14 @@ +export DIRENV_WARN_TIMEOUT=20s + +eval "$(devenv direnvrc)" + +use devenv + +if [[ "$SHELL" =~ "zsh" || "$SHELL" =~ "bash" ]]; then + source ./site/env/bin/activate || true +fi + +if [[ "$SHELL" =~ "fish" ]]; then + source ./site/env/bin/activate.fish || true +fi + diff --git a/devenv.lock b/devenv.lock new file mode 100644 index 000000000..38484f340 --- /dev/null +++ b/devenv.lock @@ -0,0 +1,65 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1781576018, + "narHash": "sha256-bERSTGBUVBySDulPk8NSW7GM8fzGSrrlyD37e3N+x9s=", + "owner": "cachix", + "repo": "devenv", + "rev": "b495a8fbaa95ef1cbece20c705f68540b108f59d", + "type": "github" + }, + "original": { + "dir": "src/modules", + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "nixpkgs": { + "inputs": { + "nixpkgs-src": "nixpkgs-src" + }, + "locked": { + "lastModified": 1778507786, + "narHash": "sha256-HzSQCKMsMr8r55LwM1JuzIOB+8bzk0FEv6sItKvsfoY=", + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "8f24a228a782e24576b155d1e39f0d914b380691", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "nixpkgs-src": { + "flake": false, + "locked": { + "lastModified": 1778274207, + "narHash": "sha256-I4puXmX1iovcCHZlRmztO3vW0mAbbRvq4F8wgIMQ1MM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b3da656039dc7a6240f27b2ef8cc6a3ef3bccae7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} \ No newline at end of file diff --git a/devenv.nix b/devenv.nix new file mode 100644 index 000000000..a6dc2047c --- /dev/null +++ b/devenv.nix @@ -0,0 +1,21 @@ +{ pkgs, ... }: + +{ + packages = with pkgs; [ + git + openssh + python3 + curl + jq + gh + ]; + + languages.go.enable = true; + + enterShell = '' + echo "── DevOps-Intro devenv ──" + go version + git --version + echo "QuickNotes: cd app && go run ." + ''; +} diff --git a/devenv.yaml b/devenv.yaml new file mode 100644 index 000000000..6bf1e6c17 --- /dev/null +++ b/devenv.yaml @@ -0,0 +1,3 @@ +inputs: + nixpkgs: + url: github:cachix/devenv-nixpkgs/rolling From e349913937dc4d423ba8d812214fba8fa67cd991 Mon Sep 17 00:00:00 2001 From: GrandAdmiralBee Date: Tue, 16 Jun 2026 13:48:46 +0300 Subject: [PATCH 3/5] docs: upstream moved while you worked From a20957e5320984d3cf121c1c48ce05b96bd75d5b Mon Sep 17 00:00:00 2001 From: GrandAdmiralBee Date: Tue, 16 Jun 2026 13:50:48 +0300 Subject: [PATCH 4/5] env: updated gitignore and removed devenv local cache --- .devenv/bash-bash | 1 - .devenv/bootstrap/bootstrapLib.nix | 571 ---- .devenv/bootstrap/default.nix | 19 - .devenv/bootstrap/resolve-lock.nix | 157 -- .devenv/gc/shell | 1 - .../gc/task-config-devenv-config-task-config | 1 - .devenv/imports.txt | 0 .devenv/input-paths.txt | 6 - .devenv/load-exports | 1 - .devenv/nix-eval-cache.db | Bin 114688 -> 0 bytes .devenv/nixpkgs-config-99f33fda17d41bc9.nix | 17 - .devenv/profile | 1 - .devenv/run | 1 - .devenv/shell-2e40cf41831d6351.sh | 2313 ----------------- .devenv/shell-57d2e7b48bb8f8cf.sh | 2313 ----------------- .devenv/shell-71ddd0fa90f49aae.sh | 2313 ----------------- .devenv/shell-92a0ad1c011413a7.sh | 2313 ----------------- .devenv/state/files.json | 1 - .devenv/state/tasks.db | Bin 36864 -> 0 bytes .devenv/task-names.txt | 5 - .gitignore | 3 + 21 files changed, 3 insertions(+), 10034 deletions(-) delete mode 120000 .devenv/bash-bash delete mode 100644 .devenv/bootstrap/bootstrapLib.nix delete mode 100644 .devenv/bootstrap/default.nix delete mode 100644 .devenv/bootstrap/resolve-lock.nix delete mode 120000 .devenv/gc/shell delete mode 120000 .devenv/gc/task-config-devenv-config-task-config delete mode 100644 .devenv/imports.txt delete mode 100644 .devenv/input-paths.txt delete mode 100755 .devenv/load-exports delete mode 100644 .devenv/nix-eval-cache.db delete mode 100644 .devenv/nixpkgs-config-99f33fda17d41bc9.nix delete mode 120000 .devenv/profile delete mode 120000 .devenv/run delete mode 100755 .devenv/shell-2e40cf41831d6351.sh delete mode 100755 .devenv/shell-57d2e7b48bb8f8cf.sh delete mode 100755 .devenv/shell-71ddd0fa90f49aae.sh delete mode 100755 .devenv/shell-92a0ad1c011413a7.sh delete mode 100644 .devenv/state/files.json delete mode 100644 .devenv/state/tasks.db delete mode 100644 .devenv/task-names.txt diff --git a/.devenv/bash-bash b/.devenv/bash-bash deleted file mode 120000 index 44874b719..000000000 --- a/.devenv/bash-bash +++ /dev/null @@ -1 +0,0 @@ -/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9 \ No newline at end of file diff --git a/.devenv/bootstrap/bootstrapLib.nix b/.devenv/bootstrap/bootstrapLib.nix deleted file mode 100644 index 74505d417..000000000 --- a/.devenv/bootstrap/bootstrapLib.nix +++ /dev/null @@ -1,571 +0,0 @@ -# Shared library functions for devenv evaluation -{ inputs }: - -rec { - # Helper to get overlays for a given input - getOverlays = - inputName: inputAttrs: - let - lib = inputs.nixpkgs.lib; - in - map - ( - overlay: - let - input = - inputs.${inputName} or (throw "No such input `${inputName}` while trying to configure overlays."); - in - input.overlays.${overlay} - or (throw "Input `${inputName}` has no overlay called `${overlay}`. Supported overlays: ${lib.concatStringsSep ", " (builtins.attrNames input.overlays)}") - ) inputAttrs.overlays or [ ]; - - # Main function to create devenv configuration for a specific system with profiles support - # This is the full-featured version used by default.nix - mkDevenvForSystem = - { version - , is_development_version ? false - , system - , devenv_root - , git_root ? null - , devenv_dotfile - , devenv_dotfile_path - , devenv_tmpdir - , devenv_runtime - , devenv_state ? null - , devenv_istesting ? false - , devenv_direnvrc_latest_version - , container_name ? null - , active_profiles ? [ ] - , hostname - , username - , cli_options ? [ ] - , skip_local_src ? false - , secretspec ? null - , devenv_inputs ? { } - , devenv_imports ? [ ] - , impure ? false - , nixpkgs_config ? { } - , lock_fingerprint ? null - , primops ? { } - }: - let - inherit (inputs) nixpkgs; - lib = nixpkgs.lib; - targetSystem = system; - - overlays = lib.flatten (lib.mapAttrsToList getOverlays devenv_inputs); - - # Helper to create pkgs for a given system with nixpkgs_config - mkPkgsForSystem = - evalSystem: - import nixpkgs { - system = evalSystem; - config = nixpkgs_config // { - allowUnfreePredicate = - if nixpkgs_config.allowUnfree or false then - (_: true) - else if (nixpkgs_config.permittedUnfreePackages or [ ]) != [ ] then - (pkg: builtins.elem (lib.getName pkg) (nixpkgs_config.permittedUnfreePackages or [ ])) - else - (_: false); - allowInsecurePredicate = - if (nixpkgs_config.permittedInsecurePackages or [ ]) != [ ] then - (pkg: builtins.elem (lib.getName pkg) (nixpkgs_config.permittedInsecurePackages or [ ])) - else - (_: false); - } // lib.optionalAttrs ((nixpkgs_config.allowlistedLicenses or [ ]) != [ ]) { - allowlistedLicenses = map (name: lib.licenses.${name}) (nixpkgs_config.allowlistedLicenses or [ ]); - } // lib.optionalAttrs ((nixpkgs_config.blocklistedLicenses or [ ]) != [ ]) { - blocklistedLicenses = map (name: lib.licenses.${name}) (nixpkgs_config.blocklistedLicenses or [ ]); - }; - inherit overlays; - }; - - pkgsBootstrap = mkPkgsForSystem targetSystem; - - # Helper to import a path, trying .nix first then /devenv.nix - # Returns a list of modules, including devenv.local.nix when present - tryImport = - resolvedPath: basePath: - if lib.hasSuffix ".nix" basePath then - [ (import resolvedPath) ] - else - let - devenvpath = resolvedPath + "/devenv.nix"; - localpath = resolvedPath + "/devenv.local.nix"; - in - if builtins.pathExists devenvpath then - [ (import devenvpath) ] ++ lib.optional (builtins.pathExists localpath) (import localpath) - else - throw (basePath + "/devenv.nix file does not exist"); - - importModule = - path: - if lib.hasPrefix "path:" path then - # path: prefix indicates a local filesystem path - strip it and import directly - let - actualPath = builtins.substring 5 999999 path; - in - tryImport (/. + actualPath) path - else if lib.hasPrefix "/" path then - # Absolute path - import directly (avoids input resolution and NAR hash computation) - tryImport (/. + path) path - else if lib.hasPrefix "./" path then - # Relative paths are relative to devenv_root, not bootstrap directory - let - relPath = builtins.substring 1 255 path; - in - tryImport (/. + devenv_root + relPath) path - else if lib.hasPrefix "../" path then - # Parent relative paths also relative to devenv_root - tryImport (/. + devenv_root + "/${path}") path - else - let - paths = lib.splitString "/" path; - name = builtins.head paths; - input = inputs.${name} or (throw "Unknown input ${name}"); - subpath = "/${lib.concatStringsSep "/" (builtins.tail paths)}"; - devenvpath = input + subpath; - in - tryImport devenvpath path; - - # Common modules shared between main evaluation and cross-system evaluation - mkCommonModules = - evalPkgs: - [ - ( - { config, ... }: - { - _module.args.pkgs = evalPkgs.appendOverlays (config.overlays or [ ]); - _module.args.secretspec = secretspec; - _module.args.devenvPrimops = primops; - } - ) - (inputs.devenv.modules + /top-level.nix) - ( - { options, ... }: - { - config.devenv = lib.mkMerge [ - { - root = devenv_root; - dotfile = devenv_dotfile; - } - ( - if builtins.hasAttr "cli" options.devenv then - { - cli.version = version; - cli.isDevelopment = is_development_version; - } - else - { - cliVersion = version; - } - ) - (lib.optionalAttrs (builtins.hasAttr "tmpdir" options.devenv) { - tmpdir = devenv_tmpdir; - }) - (lib.optionalAttrs (builtins.hasAttr "isTesting" options.devenv) { - isTesting = devenv_istesting; - }) - (lib.optionalAttrs (builtins.hasAttr "runtime" options.devenv) { - runtime = devenv_runtime; - }) - (lib.optionalAttrs (builtins.hasAttr "state" options.devenv && devenv_state != null) { - state = lib.mkForce devenv_state; - }) - (lib.optionalAttrs (builtins.hasAttr "direnvrcLatestVersion" options.devenv) { - direnvrcLatestVersion = devenv_direnvrc_latest_version; - }) - ]; - } - ) - ( - { options, ... }: - { - config = lib.mkMerge [ - (lib.optionalAttrs (builtins.hasAttr "git" options) { - git.root = git_root; - }) - ]; - } - ) - (lib.optionalAttrs (container_name != null) { - container.isBuilding = lib.mkForce true; - containers.${container_name}.isBuilding = true; - }) - ] - ++ (lib.flatten (map importModule devenv_imports)) - ++ (if !skip_local_src then (importModule (devenv_root + "/devenv.nix")) else [ ]) - ++ [ - ( - let - localPath = devenv_root + "/devenv.local.nix"; - in - if builtins.pathExists localPath then import localPath else { } - ) - cli_options - ]; - - # Phase 1: Base evaluation to extract profile definitions - baseProject = lib.evalModules { - specialArgs = inputs // { - inherit inputs secretspec primops; - }; - modules = mkCommonModules pkgsBootstrap; - }; - - # Phase 2: Extract and apply profiles using extendModules with priority overrides - project = - let - # Build ordered list of profile names: hostname -> user -> manual - manualProfiles = active_profiles; - currentHostname = hostname; - currentUsername = username; - hostnameProfiles = lib.optional - ( - currentHostname != null - && currentHostname != "" - && builtins.hasAttr currentHostname (baseProject.config.profiles.hostname or { }) - ) "hostname.${currentHostname}"; - userProfiles = lib.optional - ( - currentUsername != null - && currentUsername != "" - && builtins.hasAttr currentUsername (baseProject.config.profiles.user or { }) - ) "user.${currentUsername}"; - - # Ordered list of profiles to activate - orderedProfiles = hostnameProfiles ++ userProfiles ++ manualProfiles; - - # Resolve profile extends with cycle detection - resolveProfileExtends = - profileName: visited: - if builtins.elem profileName visited then - throw "Circular dependency detected in profile extends: ${lib.concatStringsSep " -> " visited} -> ${profileName}" - else - let - profile = getProfileConfig profileName; - extends = profile.extends or [ ]; - newVisited = visited ++ [ profileName ]; - extendedProfiles = lib.flatten (map (name: resolveProfileExtends name newVisited) extends); - in - extendedProfiles ++ [ profileName ]; - - # Get profile configuration by name from baseProject - getProfileConfig = - profileName: - if lib.hasPrefix "hostname." profileName then - let - name = lib.removePrefix "hostname." profileName; - in - baseProject.config.profiles.hostname.${name} - else if lib.hasPrefix "user." profileName then - let - name = lib.removePrefix "user." profileName; - in - baseProject.config.profiles.user.${name} - else - let - availableProfiles = builtins.attrNames (baseProject.config.profiles or { }); - hostnameProfiles = map (n: "hostname.${n}") ( - builtins.attrNames (baseProject.config.profiles.hostname or { }) - ); - userProfiles = map (n: "user.${n}") (builtins.attrNames (baseProject.config.profiles.user or { })); - allAvailableProfiles = availableProfiles ++ hostnameProfiles ++ userProfiles; - in - baseProject.config.profiles.${profileName} - or (throw "Profile '${profileName}' not found. Available profiles: ${lib.concatStringsSep ", " allAvailableProfiles}"); - - # Fold over ordered profiles to build final list with extends - expandedProfiles = lib.foldl' - ( - acc: profileName: - let - allProfileNames = resolveProfileExtends profileName [ ]; - in - acc ++ allProfileNames - ) [ ] - orderedProfiles; - - # Map over expanded profiles and apply priorities - allPrioritizedModules = lib.imap0 - ( - index: profileName: - let - profilePriority = (lib.modules.defaultOverridePriority - 1) - index; - profileConfig = getProfileConfig profileName; - - typeNeedsOverride = - type: - if type == null then - false - else - let - typeName = type.name or type._type or ""; - - isLeafType = builtins.elem typeName [ - "str" - "int" - "bool" - "enum" - "path" - "package" - "float" - "anything" - ]; - in - if isLeafType then - true - else if typeName == "nullOr" then - let - innerType = - type.elemType - or (if type ? nestedTypes && type.nestedTypes ? elemType then type.nestedTypes.elemType else null); - in - if innerType != null then typeNeedsOverride innerType else false - else - false; - - pathNeedsOverride = - optionPath: - let - directOption = lib.attrByPath optionPath null baseProject.options; - in - if directOption != null && lib.isOption directOption then - typeNeedsOverride directOption.type - else if optionPath != [ ] then - let - parentPath = lib.init optionPath; - parentOption = lib.attrByPath parentPath null baseProject.options; - in - if parentOption != null && lib.isOption parentOption then - let - freeformType = parentOption.type.freeformType or parentOption.type.nestedTypes.freeformType or null; - elementType = - if freeformType ? elemType then - freeformType.elemType - else if freeformType ? nestedTypes && freeformType.nestedTypes ? elemType then - freeformType.nestedTypes.elemType - else - freeformType; - in - typeNeedsOverride elementType - else - false - else - false; - - applyModuleOverride = - config: - if builtins.isFunction config then - let - wrapper = args: applyOverrideRecursive (config args) [ ]; - in - lib.mirrorFunctionArgs config wrapper - else - applyOverrideRecursive config [ ]; - - applyOverrideRecursive = - config: optionPath: - if lib.isAttrs config && config ? _type then - config - else if lib.isAttrs config then - lib.mapAttrs (name: value: applyOverrideRecursive value (optionPath ++ [ name ])) config - else if pathNeedsOverride optionPath then - lib.mkOverride profilePriority config - else - config; - - prioritizedConfig = ( - profileConfig.module - // { - imports = lib.map - ( - importItem: - importItem - // { - imports = lib.map (nestedImport: applyModuleOverride nestedImport) (importItem.imports or [ ]); - } - ) - (profileConfig.module.imports or [ ]); - } - ); - in - prioritizedConfig - ) - expandedProfiles; - in - if allPrioritizedModules == [ ] then - baseProject - else - baseProject.extendModules { modules = allPrioritizedModules; }; - - config = project.config; - - # Apply config overlays to pkgs - pkgs = pkgsBootstrap.appendOverlays (config.overlays or [ ]); - - options = pkgs.nixosOptionsDoc { - options = builtins.removeAttrs project.options [ "_module" ]; - warningsAreErrors = false; - transformOptions = - let - isDocType = - v: - builtins.elem v [ - "literalDocBook" - "literalExpression" - "literalMD" - "mdDoc" - ]; - in - lib.attrsets.mapAttrs ( - _: v: - if v ? _type && isDocType v._type then - v.text - else if v ? _type && v._type == "derivation" then - v.name - else - v - ); - }; - - build = - options: config: - lib.concatMapAttrs - ( - name: option: - if lib.isOption option then - let - typeName = option.type.name or ""; - in - if - builtins.elem typeName [ - "output" - "outputOf" - ] - then - { - ${name} = config.${name}; - } - else - { } - else if builtins.isAttrs option && !lib.isDerivation option then - let - v = build option config.${name}; - in - if v != { } then { ${name} = v; } else { } - else - { } - ) - options; - - # Helper to evaluate devenv for a specific system (for cross-compilation, e.g. macOS building Linux containers) - evalForSystem = - evalSystem: - let - evalPkgs = mkPkgsForSystem evalSystem; - evalProject = lib.evalModules { - specialArgs = inputs // { - inherit inputs secretspec primops; - }; - modules = mkCommonModules evalPkgs; - }; - in - { - config = evalProject.config; - }; - - # All supported systems for cross-compilation (lazily evaluated) - allSystems = [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - "aarch64-darwin" - ]; - - # Generate perSystem entries for all systems (only evaluated when accessed) - perSystemConfigs = lib.genAttrs allSystems ( - perSystem: if perSystem == targetSystem then { config = config; } else evalForSystem perSystem - ); - in - { - inherit - pkgs - config - options - project - ; - bash = pkgs.bash; - shell = config.shell; - optionsJSON = options.optionsJSON; - info = config.info; - ci = config.ciDerivation; - build = build project.options config; - devenv = { - # Backwards compatibility: wrap config in devenv attribute for code expecting devenv.config.* - config = config; - # perSystem structure for cross-compilation (e.g. macOS building Linux containers) - perSystem = perSystemConfigs; - }; - }; - - # Simplified devenv evaluation for inputs - # This is a lightweight version suitable for evaluating an input's devenv.nix - mkDevenvForInput = - { - # The input to evaluate (must have outPath and sourceInfo) - input - , # All resolved inputs (for specialArgs) - allInputs - , # System to evaluate for - system ? builtins.currentSystem - , # Nixpkgs to use (defaults to allInputs.nixpkgs) - nixpkgs ? allInputs.nixpkgs or (throw "nixpkgs input required") - , # Devenv modules (defaults to allInputs.devenv) - devenv ? allInputs.devenv or (throw "devenv input required") - , - }: - let - devenvPath = input.outPath + "/devenv.nix"; - hasDevenv = builtins.pathExists devenvPath; - in - if !hasDevenv then - throw '' - Input does not have a devenv.nix file. - Expected file at: ${devenvPath} - - To use this input's devenv configuration, the input must provide a devenv.nix file. - '' - else - let - pkgs = import nixpkgs { - inherit system; - config = { }; - }; - lib = pkgs.lib; - - project = lib.evalModules { - specialArgs = allInputs // { - inputs = allInputs; - secretspec = null; - }; - modules = [ - ( - { config, ... }: - { - _module.args.pkgs = pkgs.appendOverlays (config.overlays or [ ]); - } - ) - (devenv.outPath + "/src/modules/top-level.nix") - (import devenvPath) - ]; - }; - in - { - inherit pkgs; - config = project.config; - options = project.options; - inherit project; - }; -} diff --git a/.devenv/bootstrap/default.nix b/.devenv/bootstrap/default.nix deleted file mode 100644 index 7010be36d..000000000 --- a/.devenv/bootstrap/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -args@{ system -, # The project root (location of devenv.nix) - devenv_root -, ... -}: - -let - inherit - (import ./resolve-lock.nix { - src = devenv_root; - inherit system; - }) - inputs - ; - - bootstrapLib = import ./bootstrapLib.nix { inherit inputs; }; -in - -bootstrapLib.mkDevenvForSystem args diff --git a/.devenv/bootstrap/resolve-lock.nix b/.devenv/bootstrap/resolve-lock.nix deleted file mode 100644 index fee5ebc33..000000000 --- a/.devenv/bootstrap/resolve-lock.nix +++ /dev/null @@ -1,157 +0,0 @@ -# Adapted from https://git.lix.systems/lix-project/flake-compat/src/branch/main/default.nix -{ src -, system ? builtins.currentSystem or "unknown-system" -, -}: - -let - lockFilePath = src + "/devenv.lock"; - - lockFile = builtins.fromJSON (builtins.readFile lockFilePath); - - rootSrc = { - lastModified = 0; - lastModifiedDate = formatSecondsSinceEpoch 0; - # *hacker voice*: it's definitely a store path, I promise (actually a - # nixlang path value, likely not pointing at the store). - outPath = src; - }; - - # Format number of seconds in the Unix epoch as %Y%m%d%H%M%S. - formatSecondsSinceEpoch = - t: - let - rem = x: y: x - x / y * y; - days = t / 86400; - secondsInDay = rem t 86400; - hours = secondsInDay / 3600; - minutes = (rem secondsInDay 3600) / 60; - seconds = rem t 60; - - # Courtesy of https://stackoverflow.com/a/32158604. - z = days + 719468; - era = (if z >= 0 then z else z - 146096) / 146097; - doe = z - era * 146097; - yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365; - y = yoe + era * 400; - doy = doe - (365 * yoe + yoe / 4 - yoe / 100); - mp = (5 * doy + 2) / 153; - d = doy - (153 * mp + 2) / 5 + 1; - m = mp + (if mp < 10 then 3 else -9); - y' = y + (if m <= 2 then 1 else 0); - - pad = s: if builtins.stringLength s < 2 then "0" + s else s; - in - "${toString y'}${pad (toString m)}${pad (toString d)}${pad (toString hours)}${pad (toString minutes)}${pad (toString seconds)}"; - - allNodes = builtins.mapAttrs - ( - key: node: - let - sourceInfo = - if key == lockFile.root then - rootSrc - # Path inputs pointing to project root (path = ".") should use rootSrc - # to avoid fetchTree hashing the entire project directory - else if node.locked.type or null == "path" && node.locked.path or null == "." then - rootSrc - else - let - locked = node.locked; - isRelativePath = p: p != null && (builtins.substring 0 2 p == "./" || builtins.substring 0 3 p == "../"); - # Resolve relative paths against src - resolvedLocked = locked - // (if locked.type or null == "path" && isRelativePath (locked.path or null) - then { path = toString src + "/${locked.path}"; } - else { }) - // (if locked.type or null == "git" && isRelativePath (locked.url or null) - then { url = toString src + "/${locked.url}"; } - else { }); - in - builtins.fetchTree (node.info or { } // removeAttrs resolvedLocked [ "dir" ]); - - subdir = if key == lockFile.root then "" else node.locked.dir or ""; - - outPath = sourceInfo + ((if subdir == "" then "" else "/") + subdir); - - # Resolve a input spec into a node name. An input spec is - # either a node name, or a 'follows' path from the root - # node. - resolveInput = - inputSpec: if builtins.isList inputSpec then getInputByPath lockFile.root inputSpec else inputSpec; - - # Follow an input path (e.g. ["dwarffs" "nixpkgs"]) from the - # root node, returning the final node. - getInputByPath = - nodeName: path: - if path == [ ] then - nodeName - else - getInputByPath - # Since this could be a 'follows' input, call resolveInput. - (resolveInput lockFile.nodes.${nodeName}.inputs.${builtins.head path}) - (builtins.tail path); - - inputs = builtins.mapAttrs (inputName: inputSpec: allNodes.${resolveInput inputSpec}) ( - node.inputs or { } - ); - - # Only import flake.nix for non-root nodes (root doesn't need it) - flake = if key == lockFile.root then null else import (outPath + "/flake.nix"); - - outputs = if key == lockFile.root then { } else flake.outputs (inputs // { self = result; }); - - # Lazy devenv evaluation for this input - devenvEval = - let - bootstrapLib = import ./bootstrapLib.nix { inputs = inputs; }; - in - bootstrapLib.mkDevenvForInput { - input = { inherit outPath sourceInfo; }; - allInputs = inputs; - inherit system; - }; - - result = - outputs - // sourceInfo - // { - inherit outPath; - inherit inputs; - inherit outputs; - inherit sourceInfo; - _type = "flake"; - devenv = devenvEval; - }; - - nonFlakeResult = sourceInfo // { - inherit outPath; - inherit inputs; - inherit sourceInfo; - _type = "flake"; - devenv = devenvEval; - }; - - in - if node.flake or true && key != lockFile.root then - assert builtins.isFunction flake.outputs; - result - else - nonFlakeResult - ) - lockFile.nodes; - - result = - if !(builtins.pathExists lockFilePath) then - throw "${lockFilePath} does not exist" - else if lockFile.version >= 5 && lockFile.version <= 7 then - allNodes.${lockFile.root} - else - throw "lock file '${lockFilePath}' has unsupported version ${toString lockFile.version}"; - -in -{ - inputs = result.inputs or { } // { - self = result; - }; -} diff --git a/.devenv/gc/shell b/.devenv/gc/shell deleted file mode 120000 index 04508fd54..000000000 --- a/.devenv/gc/shell +++ /dev/null @@ -1 +0,0 @@ -/nix/store/rzm9y544fhkplfr1lfz9z4wi31ari70m-devenv-shell \ No newline at end of file diff --git a/.devenv/gc/task-config-devenv-config-task-config b/.devenv/gc/task-config-devenv-config-task-config deleted file mode 120000 index f03122cc8..000000000 --- a/.devenv/gc/task-config-devenv-config-task-config +++ /dev/null @@ -1 +0,0 @@ -/nix/store/67gwkyrn8qfd381zka7lgr23bm2d2v2a-tasks.json \ No newline at end of file diff --git a/.devenv/imports.txt b/.devenv/imports.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/.devenv/input-paths.txt b/.devenv/input-paths.txt deleted file mode 100644 index 501f75f01..000000000 --- a/.devenv/input-paths.txt +++ /dev/null @@ -1,6 +0,0 @@ -/home/karim/Dev/DevOps-Intro/.devenv/bootstrap/bootstrapLib.nix -/home/karim/Dev/DevOps-Intro/.devenv/bootstrap/default.nix -/home/karim/Dev/DevOps-Intro/devenv.lock -/home/karim/Dev/DevOps-Intro/devenv.nix -/home/karim/Dev/DevOps-Intro/devenv.yaml -/home/karim/Dev/DevOps-Intro/.env \ No newline at end of file diff --git a/.devenv/load-exports b/.devenv/load-exports deleted file mode 100755 index 8b1378917..000000000 --- a/.devenv/load-exports +++ /dev/null @@ -1 +0,0 @@ - diff --git a/.devenv/nix-eval-cache.db b/.devenv/nix-eval-cache.db deleted file mode 100644 index 55f89414146465686fce880bf6e04dee43ad949c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 114688 zcmeI*4Rl-8eE@KMJiR9=v2Mth^Wg+VfhHc2{l4@*0-+?12nNRvw!=rD=)BKZu`D~1 z?AW24)Cq8U7##z8#!jItg%%E_l&EHl4>;Cu3 zu_fF2C`o$~^4E#(U($QJ@4nx?@5%S-U8U#pj(o*S`h%qbtCCa#^8%qz;G$$Q5D0|e z-URn~aF0zq<{%!v1rI+sN(=>BKKDUGtTiw{_*5YAgmxsH&9SYKTZQ~y&t-3ecMlJ_Rs~844V~Sl7c#jyd-2BY z9lgo59Ne>}xtZ?7#a-Rm_AQ-szt`69bTceXCcCp2XS=hV zZP}h$leKxby11(oHqwy={;mRO;KD}g8eO^lsENv7To123-4NSGz$)eV;yJTidom?~iyK1FHYrv~E zk7`=q#GtmE!D7WLR&sq-xsR^WcFD%>wVK*I)s$hS)2yk{ou=)qVKKC`^JcWOY8xA} zDt$RWUx0&{wYj{@s%vUtYK8iDPd2ov71q{e-#k8Vk_fv0}t>I5C zU3|;})gL#rm8gD=<_!yZTB4)1{i*Hes*Qi@g+&K8ED##cJ1=;%G}Zd27EkkBIJ5mv zt@}GW0P3m$+V}Lc6|J7HQ(e%IkoF=|eSsmOrS-6@rNDfX2HBb2&WvE$5*QLi#%}Z+! zpHG@U8R8pz(nmUka_|S|Xl@|Cvt(8BgT-=An*K_7e{)c1Os9i4M%dvrefjj~p}IqB z`cl>%N+w6VQW-Xv+|<4WTJrQGDw%Y>vQx?r(IU+}PbHK2V!2`!3UDmYID{jy&vW|A!vo2>W4ZcHZ`5;!X{mCw zKXbVFhkIS|<_0)i_=Yb8$b)24;-`t>L>Qjn4FymD1yBG5Pyhu`00mG01yJDkD6o?k zA{ixC2+to#a{~dVBHUgH2o?}7G*6hYH3MJist%^xLz^7a9yH3`Oxk+-|GDH z=gf1zSG+Cx!OBhG6ZH!tM&?s&{!+wj$~ zwk7i)`0(K4&z}?Y-t2hh(7_Gw+`i|~YoF^HT@-nr^Ee?QO>A*%cfc(T4yB#JfdQ-N zrrD6dESuS|^Yu&9&mX+~qCaTbyZfDU=AXUeiVF@7U)Z%{@&8;nddK!#S`QptcijWu zeDAYg`fTpGH~K$}-281fEJRu-HY475(S#r!3OV9d{^XI1|C+p7`Pq}Ht3Ta-&oeJ) zUwZ$Z;ivCjeDmGk{o~^D2S>j@KC*rIzSqu8JR{xkx1ATskqd5dLP8|Xw$k?xtKNS7 z@K%Z=@MRs0TF$a7pZUg%w=`||${!tazwuw+y8i9!u6%gQea-Lxr0}&%%;yePzWk*} z$A9|Rug=Lo{M75umO2N2@xa0n6bQNl6`;L(L~kueZ#O+Ib-RHZc3(YijI@fR7=jd zrlo2b(bOH$mtYzYOv`G4>%sl}&X$T*?w@$P-X6{uT*KCEE#uj`q-egP+ZoGMMNiA< zzF}u%-LXX1HeH&TYe=f(su|gq?2Mtiy6qaGlWHyIM_bEq9lF=5={xuIkClqXZr@c5 zX>Y%!7j~9p#U7Adc|^9-bnE37I%y!aOIrER__bUdc5~Hu!}uajHY``nIIe3Ow&>fo zq02@_ksL#`byqZD?+nk>3=?)vlP%d$Y)#ELhUrMArHD`(nDBM-cS*JP*!`+iRP9mS zv5nC^zQ40?WY?}Sf2^Pn$oVwgEPRz%@k*9c$&YyHOp7vP!tSkjaDOpOcdv20;XoVb z>oy1*8Ss@Ps6$a!6-`%FTa`so^E?nXY(tbJ#dSng@qF3LSdM1+rZ20$16%P5g%ho; z>r-xNBuBqCPOY!4IMtSl*50D-_YIV!vOVgQhW7Lq3tGRc7GXZ)P`cWP(yS0IkVk4= z3TA!Gl2d8#fH{^?Rll!)sNk2Rg1^_?tM17wl2yv<;y_(akPDqLII}#4W?33EYR$Fx z6s111wAaxJ1>G#E1xIyv*5{IjJW@B%_O#y*QSdbYzM9izOP5qtc2(E#6-PE)S<`h* z(LB|ZO;2+S8ICI5l1*E7EZb02S#~mxl!11oOO`irz|b$e^P`$2Lx~(mQZ?NW4cjtB z*>gnOG!;+NG~ZDb#kNh|lTFPweAu+7={9Ulv1D8G_3KkZmeX(T^y=L+CABzEG(c*P z;aieavenUD&WPde)2eJ{rG*@ z;U1v?3ZMWApa2S>01BW03ZMWAoE8FEZoDCQqJxwXmdl9_0dg#t6CG&_vs_Me_$ag) zTw*6WHiG^C)8ZJwLZSc)pa2S>01BW03ZMWApum|Rfc^hjFCRHM{eOD>e|&B*K%ORd zBz}|F-SBe5y$zq3`^a1cUc?&;pa2S>01BW03ZMWApuopVK#U84&S(S2we}4Tc&+_# z75zZ#W^aVvyN1f?_F|HqgJ~wZslaRxn8@M7W%!aN+b~x`RWq)nsJ`cBG)s5jMa%VJwuh|wmgsAS zW=axlcnRBO;kVi4!l2Wy!)yyn*A2r|b(mqH!LHj9%oA`mxRM^HpoE_xrIN2mG3k4@H6&7svE z9IU{9eq{}{(jOWuz-$w`Gc-#JY9nL13K;1I%t5e3n4w^cj;2YX>sWA^y&=JT8rSeN zMFl-YR!l{dv`ofv6g8tjaf+-+b2unc;G-1D^?Yl%P@$z!MOn5~BO@uED4I63AQzsA zt_1UdpqewXVZd}HQKVCsL{-&X)pBgfkUiOuVXhP9h0?5eaC~0)qXJD*b>wYYBu$lc z%TW!OH04PO%-nzpRIY8Smf?sQ+f{VkbVZn|;OTV6lVd5iqrjnH8FX@o%Gw$$k{%M^ z@S1jXP0XmGQ=x|Xca~cR;r}BjSYzed%2t9xp!ay+NUMV0>G%KfL^wcRAP*Ctd?NAl zL^$ziVt?X_MDxe%M2CBW0w{n2D1ZVefC4Ch0w{n2XS~3<;m+VO2Y=%0!q*;st(x(k z*m>a{$F(waXQRiPF&&5yq_BTn8BdOc@NkuU{OE5v_Si?{liYaVx6Pzxw1WF6g_u6R z5S|Wov@wCuns9Hdwo;F@GWP$^_~Rb|Pyhu`00mG01yBG5Pyhwa90BbAvmY=$%C!$4 z01BYMnIwSy|1+t!abHmY1yBG5Pyhu`00mG01yBG5Pyhu`00mG01yBG5 zPyhu`00mG01yBG5Pyhu`00mG01yBG5Pyhu`00mG01yBG5Pyhu`00mG01yBG5Pyhu` z00mG01yBG5PH}-Kl#jrD8Qhn{Jpp(6Ujv*4_XTjDKg(ly32!KX0w{n2D1ZVefC4Ch z0w{n2D1ZVefC4Ch0w{n2D1ZVefC4Ch0w{n2D1ZVefC4Ch0w{n2D1ZVefC4Ch0w{n2 zD1ZVefC4Ch0w{n2D1ZVefC4Ch0w{n2D1ZVdLx4{5PbEGKkPpZ^$jjt;@-O5E z3&NM;#;;;A$|qSA__JB$_?0Y%`4u#BF}{h#D8HOV zfnUZV$1i0u%rBua9OD~VjPi?F6!=9f#`%RTa{K}o!~A?2Loxm=7Nh(;76qQL$nyyn zBYXpk96y)EFh7UIP$Uj97K+5UKr9%GL}`dd1R8`0PXix`&;Th7TqI0GI1-{E#04S5 z;!rQC#GwHBko=mwO%9Tukr&9nk{^=4Cr^;?kgt=kkbB7I$*tr@@@Y~b1#&IvB^|^i zo5=-4CF{sJq=_sfa|s8T;0*;(00mG01yBG5Pyhu`00mG01x`T$feX_9f2taztEy2* zRwH+IHHKHR$i-GvW3;Inh2_=AEvv@xQWnFpCDj;htVUsRHO3cJBe$>`!wXmp#pYLI z^sH(W=2at4sxgwNMy{b6!*i=KG>7Mc(2tMvTr3!j#aM_&Sr7ykc%Fp_j0V6e9LGX9 z%t9!{aj}X1Ke;eK4w3iBuV4h=4e}~n1MqL;$K+Y^PjD5$6XY++H_6vv9N^E$pOQOZ zB;aQ98L}6~0*a)M*f1V&1=&U}h4Fw3Pr)k2BB1~Zpa2S>01BW03ZMWApa2S>z)28@ zgkb<7#nM$QO|tZCmae2Jw}PcjEM3mhWh`Av)9@0OHnMavOBb5uIGTiM5(&vrPHs90 zpqK>;pa2S>01BW03ZMWApa2S>01BK+0<@zYV;%n}>-Y<--a}m$6sI_f1Y*xBdp`kv5tRuqT^5d^Kn+F z7)_&5nhF901BW03ZMWApuj04utMMiL8*ZY_hj3;v%NjrvTeDEhr6T|52kone0~EL>TJJi z+htpNavM83x~|N1c6Ii2ZSQW&?vk4B+7=N4!A0Y+(j{G6v%cZ0z9N~nZYqwWIErFq zWY?1n+mk&@vt&!sJ%he%$%^kdmSak$;Yhx$%DS(5G{@x}Y&8uTZq8nj?Ytt_*45d& zvAr|fO&6{T^MM!?>BuG8*A)^1FJkl5iALoLL zf^2XivX~2|gENK|xF#-ke((qb3gH+RTNI=t3895tEFGIZ25@>2VrfwT1yBG5Pyhu` z00mG01yBG5Pyhu`00mG01yBG5Pyhu`00mG01yBG5PyhvH6R2MQ|Kj1_|NkZY4}h /dev/null)" ]; then - echo "Removing empty $srcParent/ and (possibly) its parents"; - rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; - fi; - done; - done -} -nixLog () -{ - - [[ -z ${NIX_LOG_FD-} ]] && return 0; - local callerName="${FUNCNAME[1]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" -} -_pruneLibtoolFiles () -{ - - if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; -} -getHostRoleEnvHook () -{ - - getRole "$depHostOffset" -} -runOneHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook ret=1; - for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - if _eval "$hook" "$@"; then - ret=0; - break; - fi; - done; - return "$ret" -} -substituteAll () -{ - - local input="$1"; - local output="$2"; - local -a args=(); - _allFlags; - substitute "$input" "$output" "${args[@]}" -} -bintoolsWrapper_addLDVars () -{ - - local role_post; - getHostRoleEnvHook; - if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; - fi; - if [[ -d "$1/lib" ]]; then - local -a glob=($1/lib/lib*); - if [ "${#glob[*]}" -gt 0 ]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib"; - fi; - fi -} -fixupPhase () -{ - - local output; - for output in $(getAllOutputNames); - do - if [ -e "${!output}" ]; then - chmod -R u+w,u-s,g-s "${!output}"; - fi; - done; - runHook preFixup; - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" runHook fixupOutput; - done; - recordPropagatedDependencies; - if [ -n "${setupHook:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; - fi; - if [ -n "${setupHooks:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - local hook; - for hook in ${setupHooks[@]}; - do - local content; - consumeEntire content < "$hook"; - substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; - unset -v content; - done; - unset -v hook; - fi; - if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then - mkdir -p "${!outputBin}/nix-support"; - printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; - fi; - runHook postFixup -} -fixLibtool () -{ - - local search_path; - for flag in $NIX_LDFLAGS; - do - case $flag in - -L*) - search_path+=" ${flag#-L}" - ;; - esac; - done; - sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' -} -installPhase () -{ - - runHook preInstall; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom installPhase, doing nothing"; - runHook postInstall; - return; - else - foundMakefile=1; - fi; - if [ -n "$prefix" ]; then - mkdir -p "$prefix"; - fi; - local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; - echoCmd 'install flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - runHook postInstall -} -nixNoticeLog () -{ - - _nixLogWithLevel 2 "$*" -} -getHostRole () -{ - - getRole "$hostOffset" -} -noBrokenSymlinksInAllOutputs () -{ - - if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then - for output in $(getAllOutputNames); - do - noBrokenSymlinks "${!output}"; - done; - fi -} -_multioutDevs () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then - return; - fi; - moveToOutput include "${!outputInclude}"; - moveToOutput lib/pkgconfig "${!outputDev}"; - moveToOutput share/pkgconfig "${!outputDev}"; - moveToOutput lib/cmake "${!outputDev}"; - moveToOutput share/aclocal "${!outputDev}"; - for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; - do - echo "Patching '$f' includedir to output ${!outputInclude}"; - sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; - done -} -buildPhase () -{ - - runHook preBuild; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom buildPhase, doing nothing"; - else - foundMakefile=1; - local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; - echoCmd 'build flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postBuild -} -ccWrapper_addCVars () -{ - - local role_post; - getHostRoleEnvHook; - local found=; - if [ -d "$1/include" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; - found=1; - fi; - if [ -d "$1/Library/Frameworks" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; - found=1; - fi; - if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then - local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; - export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; - fi -} -concatTo () -{ - - local -; - set -o noglob; - local -n targetref="$1"; - shift; - local arg default name type; - for arg in "$@"; - do - IFS="=" read -r name default <<< "$arg"; - local -n nameref="$name"; - if [[ -z "${nameref[*]}" && -n "$default" ]]; then - targetref+=("$default"); - else - if type=$(declare -p "$name" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; - return 1 - ;; - -a*) - targetref+=("${nameref[@]}") - ;; - *) - if [[ "$name" = *"Array" ]]; then - nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; - targetref+=(${nameref+"${nameref[@]}"}); - else - targetref+=(${nameref-}); - fi - ;; - esac; - fi; - fi; - done -} -nixChattyLog () -{ - - _nixLogWithLevel 5 "$*" -} -prependToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=("$@" ${nameref+"${nameref[@]}"}); - else - nameref="$* ${nameref-}"; - fi -} -definePhases () -{ - - if [ -z "${phases[*]:-}" ]; then - phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; - fi -} -substituteInPlace () -{ - - local -a fileNames=(); - for arg in "$@"; - do - if [[ "$arg" = "--"* ]]; then - break; - fi; - fileNames+=("$arg"); - shift; - done; - if ! [[ "${#fileNames[@]}" -gt 0 ]]; then - echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; - return 1; - fi; - for file in "${fileNames[@]}"; - do - substitute "$file" "$file" "$@"; - done -} -nixVomitLog () -{ - - _nixLogWithLevel 7 "$*" -} -_addToEnv () -{ - - local depHostOffset depTargetOffset; - local pkg; - for depHostOffset in "${allPlatOffsets[@]}"; - do - local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; - local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; - for depTargetOffset in "${allPlatOffsets[@]}"; - do - (( depHostOffset <= depTargetOffset )) || continue; - local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; - if [[ -z "${strictDeps-}" ]]; then - local visitedPkgs=""; - for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; - do - if [[ "$visitedPkgs" = *"$pkg"* ]]; then - continue; - fi; - runHook "${!hookRef}" "$pkg"; - visitedPkgs+=" $pkg"; - done; - else - local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - runHook "${!hookRef}" "$pkg"; - done; - fi; - done; - done -} -addToSearchPath () -{ - - addToSearchPathWithCustomDelimiter ":" "$@" -} -_makeSymlinksRelative () -{ - - local prefixes; - prefixes=(); - for output in $(getAllOutputNames); - do - [ ! -e "${!output}" ] && continue; - prefixes+=("${!output}"); - done; - find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' - output="$1" - link="$2" - - linkTarget=$(readlink "$link") - - # only touch links that point inside the same output tree - [[ $linkTarget == "$output"/* ]] || exit 0 - - if [ ! -e "$linkTarget" ]; then - echo "the symlink $link is broken, it points to $linkTarget (which is missing)" - fi - - echo "making symlink relative: $link" - ln -snrf "$linkTarget" "$link" - ' _ -} -_multioutConfig () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then - return; - fi; - if [ -z "${shareDocName:-}" ]; then - local confScript="${configureScript:-}"; - if [ -z "$confScript" ] && [ -x ./configure ]; then - confScript=./configure; - fi; - if [ -f "$confScript" ]; then - local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; - fi; - if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then - shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; - fi; - fi; - prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; - prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal -} -_logHook () -{ - - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - local hookKind="$1"; - local hookExpr="$2"; - shift 2; - if declare -F "$hookExpr" > /dev/null 2>&1; then - nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; - else - if type -p "$hookExpr" > /dev/null; then - nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; - else - if [[ "$hookExpr" != "_callImplicitHook"* ]]; then - local exprToOutput; - if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then - exprToOutput="$hookExpr"; - else - local hookExprLine; - while IFS= read -r hookExprLine; do - hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; - if [[ -n "$hookExprLine" ]]; then - exprToOutput+="$hookExprLine\\n "; - fi; - done <<< "$hookExpr"; - exprToOutput="${exprToOutput%%\\n }"; - fi; - nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; - fi; - fi; - fi -} -distPhase () -{ - - runHook preDist; - local flagsArray=(); - concatTo flagsArray distFlags distFlagsArray distTarget=dist; - echo 'dist flags: %q' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - if [ "${dontCopyDist:-0}" != 1 ]; then - mkdir -p "$out/tarballs"; - cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; - fi; - runHook postDist -} -echoCmd () -{ - - printf "%s:" "$1"; - shift; - printf ' %q' "$@"; - echo -} -mapOffset () -{ - - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi -} -nixWarnLog () -{ - - _nixLogWithLevel 1 "$*" -} -_moveLib64 () -{ - - if [ "${dontMoveLib64-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then - return; - fi; - echo "moving $prefix/lib64/* to $prefix/lib"; - mkdir -p $prefix/lib; - shopt -s dotglob; - for i in $prefix/lib64/*; - do - mv --no-clobber "$i" $prefix/lib; - done; - shopt -u dotglob; - rmdir $prefix/lib64; - ln -s lib $prefix/lib64 -} -isMachO () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then - return 0; - else - return 1; - fi; - fi; - fi -} -isScript () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 2 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" =~ \#! ]]; then - return 0; - else - return 1; - fi -} -exitHandler () -{ - - exitCode="$?"; - set +e; - if [ -n "${showBuildStats:-}" ]; then - read -r -d '' -a buildTimes < <(times); - echo "build times:"; - echo "user time for the shell ${buildTimes[0]}"; - echo "system time for the shell ${buildTimes[1]}"; - echo "user time for all child processes ${buildTimes[2]}"; - echo "system time for all child processes ${buildTimes[3]}"; - fi; - if (( "$exitCode" != 0 )); then - runHook failureHook; - if [ -n "${succeedOnFailure:-}" ]; then - echo "build failed with exit code $exitCode (ignored)"; - mkdir -p "$out/nix-support"; - printf "%s" "$exitCode" > "$out/nix-support/failed"; - exit 0; - fi; - else - runHook exitHook; - fi; - return "$exitCode" -} -auditTmpdir () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "checking for references to $TMPDIR/ in $dir..."; - local tmpdir elf_fifo script_fifo; - tmpdir="$(mktemp -d)"; - elf_fifo="$tmpdir/elf"; - script_fifo="$tmpdir/script"; - mkfifo "$elf_fifo" "$script_fifo"; - ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do - if isELF "$file"; then - printf '%s\0' "$file" 1>&3; - else - if isScript "$file"; then - filename=${file##*/}; - dir=${file%/*}; - if [ -e "$dir/.$filename-wrapped" ]; then - printf '%s\0' "$file" 1>&4; - fi; - fi; - fi; - done; - exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then - echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$elf_fifo" ) & local pid_elf=$!; - local pid_script; - ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if grep -q -F "$TMPDIR/" "$1"; then - echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$script_fifo" ) & local pid_script=$!; - wait "$pid_elf" || { - echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - wait "$pid_script" || { - echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - rm -r "$tmpdir" -} -appendToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=(${nameref+"${nameref[@]}"} "$@"); - else - nameref="${nameref-} $*"; - fi -} -isELF () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [ "$magic" = 'ELF' ]; then - return 0; - else - return 1; - fi -} -_addRpathPrefix () -{ - - if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then - export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; - fi -} -_multioutDocs () -{ - - local REMOVE=REMOVE; - moveToOutput share/info "${!outputInfo}"; - moveToOutput share/doc "${!outputDoc}"; - moveToOutput share/gtk-doc "${!outputDevdoc}"; - moveToOutput share/devhelp/books "${!outputDevdoc}"; - moveToOutput share/man "${!outputMan}"; - moveToOutput share/man/man3 "${!outputDevman}" -} -configurePhase () -{ - - runHook preConfigure; - : "${configureScript=}"; - if [[ -z "$configureScript" && -x ./configure ]]; then - configureScript=./configure; - fi; - if [ -z "${dontFixLibtool:-}" ]; then - export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; - local i; - find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do - echo "fixing libtool script $i"; - fixLibtool "$i"; - done; - CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); - find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; - rm -f "$CONFIGURE_MTIME_REFERENCE"; - fi; - if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; - if [ "${prefixKeyOrDefault: -1}" = " " ]; then - prependToVar configureFlags "$prefix"; - prependToVar configureFlags "${prefixKeyOrDefault::-1}"; - else - prependToVar configureFlags "$prefixKeyOrDefault$prefix"; - fi; - fi; - if [[ -f "$configureScript" ]]; then - if [ -z "${dontAddDisableDepTrack:-}" ]; then - if grep -q dependency-tracking "$configureScript"; then - prependToVar configureFlags --disable-dependency-tracking; - fi; - fi; - if [ -z "${dontDisableStatic:-}" ]; then - if grep -q enable-static "$configureScript"; then - prependToVar configureFlags --disable-static; - fi; - fi; - if [ -z "${dontPatchShebangsInConfigure:-}" ]; then - patchShebangs --build "$configureScript"; - fi; - fi; - if [ -n "$configureScript" ]; then - local -a flagsArray; - concatTo flagsArray configureFlags configureFlagsArray; - echoCmd 'configure flags' "${flagsArray[@]}"; - $configureScript "${flagsArray[@]}"; - unset flagsArray; - else - echo "no configure script, doing nothing"; - fi; - runHook postConfigure -} -noBrokenSymlinks () -{ - - local -r output="${1:?}"; - local path; - local pathParent; - local symlinkTarget; - local -i numDanglingSymlinks=0; - local -i numReflexiveSymlinks=0; - local -i numUnreadableSymlinks=0; - if [[ ! -e $output ]]; then - nixWarnLog "skipping non-existent output $output"; - return 0; - fi; - nixInfoLog "running on $output"; - while IFS= read -r -d '' path; do - pathParent="$(dirname "$path")"; - if ! symlinkTarget="$(readlink "$path")"; then - nixErrorLog "the symlink $path is unreadable"; - numUnreadableSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget == /* ]]; then - nixInfoLog "symlink $path points to absolute target $symlinkTarget"; - else - nixInfoLog "symlink $path points to relative target $symlinkTarget"; - symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; - fi; - if [[ $symlinkTarget = "$TMPDIR"/* ]]; then - nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; - numDanglingSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then - nixInfoLog "symlink $path points outside the Nix store; ignoring"; - continue; - fi; - if [[ $path == "$symlinkTarget" ]]; then - nixErrorLog "the symlink $path is reflexive"; - numReflexiveSymlinks+=1; - else - if [[ ! -e $symlinkTarget ]]; then - nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; - numDanglingSymlinks+=1; - else - nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; - fi; - fi; - done < <(find "$output" -type l -print0); - if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then - nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; - exit 1; - fi; - return 0 -} -patchELF () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "shrinking RPATHs of ELF executables and libraries in $dir"; - local i; - while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if ! isELF "$i"; then - continue; - fi; - echo "shrinking $i"; - patchelf --shrink-rpath "$i" || true; - done < <(find "$dir" -type f -print0) -} -_callImplicitHook () -{ - - local def="$1"; - local hookName="$2"; - if declare -F "$hookName" > /dev/null; then - nixTalkativeLog "calling implicit '$hookName' function hook"; - "$hookName"; - else - if type -p "$hookName" > /dev/null; then - nixTalkativeLog "sourcing implicit '$hookName' script hook"; - source "$hookName"; - else - if [ -n "${!hookName:-}" ]; then - nixTalkativeLog "evaling implicit '$hookName' string hook"; - eval "${!hookName}"; - else - return "$def"; - fi; - fi; - fi -} -_moveSystemdUserUnits () -{ - - if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then - return; - fi; - if [ ! -e "${prefix:?}/lib/systemd/user" ]; then - return; - fi; - local source="$prefix/lib/systemd/user"; - local target="$prefix/share/systemd/user"; - echo "moving $source/* to $target"; - mkdir -p "$target"; - ( shopt -s dotglob; - for i in "$source"/*; - do - mv "$i" "$target"; - done ); - rmdir "$source"; - ln -s "$target" "$source" -} -patchShebangs () -{ - - local pathName; - local update=false; - while [[ $# -gt 0 ]]; do - case "$1" in - --host) - pathName=HOST_PATH; - shift - ;; - --build) - pathName=PATH; - shift - ;; - --update) - update=true; - shift - ;; - --) - shift; - break - ;; - -* | --*) - echo "Unknown option $1 supplied to patchShebangs" 1>&2; - return 1 - ;; - *) - break - ;; - esac; - done; - echo "patching script interpreter paths in $@"; - local f; - local oldPath; - local newPath; - local arg0; - local args; - local oldInterpreterLine; - local newInterpreterLine; - if [[ $# -eq 0 ]]; then - echo "No arguments supplied to patchShebangs" 1>&2; - return 0; - fi; - local f; - while IFS= read -r -d '' f; do - isScript "$f" || continue; - read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; - read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; - if [[ -z "${pathName:-}" ]]; then - if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then - pathName=HOST_PATH; - else - pathName=PATH; - fi; - fi; - if [[ "$oldPath" == *"/bin/env" ]]; then - if [[ $arg0 == "-S" ]]; then - arg0=${args%% *}; - [[ "$args" == *" "* ]] && args=${args#* } || args=; - newPath="$(PATH="${!pathName}" type -P "env" || true)"; - args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; - else - if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; - exit 1; - else - newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; - fi; - fi; - else - if [[ -z $oldPath ]]; then - oldPath="/bin/sh"; - fi; - newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; - args="$arg0 $args"; - fi; - newInterpreterLine="$newPath $args"; - newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; - if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then - if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then - echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; - escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; - timestamp=$(stat --printf "%y" "$f"); - tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); - sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; - local restoreReadOnly; - if [[ ! -w "$f" ]]; then - chmod +w "$f"; - restoreReadOnly=true; - fi; - cat "$tmpFile" > "$f"; - rm "$tmpFile"; - if [[ -n "${restoreReadOnly:-}" ]]; then - chmod -w "$f"; - fi; - touch --date "$timestamp" "$f"; - fi; - fi; - done < <(find "$@" -type f -perm -0100 -print0) -} -concatStringsSep () -{ - - local sep="$1"; - local name="$2"; - local type oldifs; - if type=$(declare -p "$name" 2> /dev/null); then - local -n nameref="$name"; - case "${type#* }" in - -A*) - echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; - return 1 - ;; - -a*) - local IFS="$(printf '\036')" - ;; - *) - local IFS=" " - ;; - esac; - local ifs_separated="${nameref[*]}"; - echo -n "${ifs_separated//"$IFS"/"$sep"}"; - fi -} -pkgConfigWrapper_addPkgConfigPath () -{ - - local role_post; - getHostRoleEnvHook; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" -} -getTargetRoleEnvHook () -{ - - getRole "$depTargetOffset" -} -printLines () -{ - - (( "$#" > 0 )) || return 0; - printf '%s\n' "$@" -} -printPhases () -{ - - definePhases; - local phase; - for phase in ${phases[*]}; - do - printf '%s\n' "$phase"; - done -} -nixDebugLog () -{ - - _nixLogWithLevel 6 "$*" -} -nixErrorLog () -{ - - _nixLogWithLevel 0 "$*" -} -printWords () -{ - - (( "$#" > 0 )) || return 0; - printf '%s ' "$@" -} -recordPropagatedDependencies () -{ - - declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); - declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); - local propagatedInputsIndex; - for propagatedInputsIndex in "${!flatVars[@]}"; - do - local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; - local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; - [[ -n "${!propagatedInputsSlice}" ]] || continue; - mkdir -p "${!outputDev}/nix-support"; - printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; - done -} -runPhase () -{ - - local curPhase="$*"; - if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then - return; - fi; - if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then - return; - fi; - if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then - return; - fi; - if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then - return; - fi; - if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then - return; - fi; - if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then - return; - fi; - showPhaseHeader "$curPhase"; - dumpVars; - local startTime endTime; - startTime=$(date +"%s"); - eval "${!curPhase:-$curPhase}"; - endTime=$(date +"%s"); - showPhaseFooter "$curPhase" "$startTime" "$endTime"; - if [ "$curPhase" = unpackPhase ]; then - [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; - cd -- "${sourceRoot:-.}"; - fi -} -_allFlags () -{ - - export system pname name version; - while IFS='' read -r varName; do - nixTalkativeLog "@${varName}@ -> ${!varName}"; - args+=("--subst-var" "$varName"); - done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') -} -substituteAllStream () -{ - - local -a args=(); - _allFlags; - substituteStream "$1" "$2" "${args[@]}" -} -_assignFirst () -{ - - local varName="$1"; - local _var; - local REMOVE=REMOVE; - shift; - for _var in "$@"; - do - if [ -n "${!_var-}" ]; then - eval "${varName}"="${_var}"; - return; - fi; - done; - echo; - echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; - echo " The following variables were all unset or empty:"; - echo " $*"; - if [ -z "${out:-}" ]; then - echo ' If you do not want an "out" output in your derivation, make sure to define'; - echo ' the other specific required outputs. This can be achieved by picking one'; - echo " of the above as an output."; - echo ' You do not have to remove "out" if you want to have a different default'; - echo ' output, because the first output is taken as a default.'; - echo; - fi; - return 1 -} -getTargetRole () -{ - - getRole "$targetOffset" -} -nixTalkativeLog () -{ - - _nixLogWithLevel 4 "$*" -} -sysconfigdataHook () -{ - - if [ "$1" = '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' ]; then - export _PYTHON_HOST_PLATFORM='linux-x86_64'; - export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; - fi -} -toPythonPath () -{ - - local paths="$1"; - local result=; - for i in $paths; - do - p="$i/lib/python3.13/site-packages"; - result="${result}${result:+:}$p"; - done; - echo $result -} -addToSearchPathWithCustomDelimiter () -{ - - local delimiter="$1"; - local varName="$2"; - local dir="$3"; - if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then - export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; - fi -} -updateAutotoolsGnuConfigScriptsPhase () -{ - - if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then - return; - fi; - for script in config.sub config.guess; - do - for f in $(find . -type f -name "$script"); - do - echo "Updating Autotools / GNU config script to a newer upstream version: $f"; - cp -f "/nix/store/kppfbp4x7mhfz1q5zswavxxxq71v2f7c-gnu-config-2024-01-01/$script" "$f"; - done; - done -} -addPythonPath () -{ - - addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.13/site-packages -} -showPhaseFooter () -{ - - local phase="$1"; - local startTime="$2"; - local endTime="$3"; - local delta=$(( endTime - startTime )); - (( delta < 30 )) && return; - local H=$((delta/3600)); - local M=$((delta%3600/60)); - local S=$((delta%60)); - echo -n "$phase completed in "; - (( H > 0 )) && echo -n "$H hours "; - (( M > 0 )) && echo -n "$M minutes "; - echo "$S seconds" -} -getAllOutputNames () -{ - - if [ -n "$__structuredAttrs" ]; then - echo "${!outputs[*]}"; - else - echo "$outputs"; - fi -} -stripHash () -{ - - local strippedName casematchOpt=0; - strippedName="$(basename -- "$1")"; - shopt -q nocasematch && casematchOpt=1; - shopt -u nocasematch; - if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then - echo "${strippedName:33}"; - else - echo "$strippedName"; - fi; - if (( casematchOpt )); then - shopt -s nocasematch; - fi -} -dumpVars () -{ - - if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then - local old_umask; - old_umask=$(umask); - umask 0077; - export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; - umask "$old_umask"; - fi -} -showPhaseHeader () -{ - - local phase="$1"; - echo "Running phase: $phase"; - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" -} -_multioutPropagateDev () -{ - - if [ "$(getAllOutputNames)" = "out" ]; then - return; - fi; - local outputFirst; - for outputFirst in $(getAllOutputNames); - do - break; - done; - local propagaterOutput="$outputDev"; - if [ -z "$propagaterOutput" ]; then - propagaterOutput="$outputFirst"; - fi; - if [ -z "${propagatedBuildOutputs+1}" ]; then - local po_dirty="$outputBin $outputInclude $outputLib"; - set +o pipefail; - propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; - set -o pipefail; - fi; - if [ -z "$propagatedBuildOutputs" ]; then - return; - fi; - mkdir -p "${!propagaterOutput}"/nix-support; - for output in $propagatedBuildOutputs; - do - echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; - done -} -substitute () -{ - - local input="$1"; - local output="$2"; - shift 2; - if [ ! -f "$input" ]; then - echo "substitute(): ERROR: file '$input' does not exist" 1>&2; - return 1; - fi; - local content; - consumeEntire content < "$input"; - if [ -e "$output" ]; then - chmod +w "$output"; - fi; - substituteStream content "file '$input'" "$@" > "$output" -} -getTargetRoleWrapper () -{ - - case $targetOffset in - -1) - export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 - ;; - 0) - export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 - ;; - 1) - export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 - ;; - *) - echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -runHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook; - for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - _eval "$hook" "$@"; - done; - return 0 -} -patchPhase () -{ - - runHook prePatch; - local -a patchesArray; - concatTo patchesArray patches; - local -a flagsArray; - concatTo flagsArray patchFlags=-p1; - for i in "${patchesArray[@]}"; - do - echo "applying patch $i"; - local uncompress=cat; - case "$i" in - *.gz) - uncompress="gzip -d" - ;; - *.bz2) - uncompress="bzip2 -d" - ;; - *.xz) - uncompress="xz -d" - ;; - *.lzma) - uncompress="lzma -d" - ;; - esac; - $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; - done; - runHook postPatch -} -stripDirs () -{ - - local cmd="$1"; - local ranlibCmd="$2"; - local paths="$3"; - local stripFlags="$4"; - local excludeFlags=(); - local pathsNew=; - [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; - [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; - local pattern; - if [ -n "${stripExclude:-}" ]; then - for pattern in "${stripExclude[@]}"; - do - excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); - done; - fi; - local p; - for p in ${paths}; - do - if [ -e "$prefix/$p" ]; then - pathsNew="${pathsNew} $prefix/$p"; - fi; - done; - paths=${pathsNew}; - if [ -n "${paths}" ]; then - echo "stripping (with command $cmd and flags $stripFlags) in $paths"; - local striperr; - striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; - find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; - [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); - rm "$striperr"; - find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; - fi -} -unpackFile () -{ - - curSrc="$1"; - echo "unpacking source archive $curSrc"; - if ! runOneHook unpackCmd "$curSrc"; then - echo "do not know how to unpack source archive $curSrc"; - exit 1; - fi -} -_doStrip () -{ - - local -ra flags=(dontStripHost dontStripTarget); - local -ra debugDirs=(stripDebugList stripDebugListTarget); - local -ra allDirs=(stripAllList stripAllListTarget); - local -ra stripCmds=(STRIP STRIP_FOR_TARGET); - local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); - stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; - stripDebugListTarget=${stripDebugListTarget[*]:-}; - stripAllList=${stripAllList[*]:-}; - stripAllListTarget=${stripAllListTarget[*]:-}; - local i; - for i in ${!stripCmds[@]}; - do - local -n flag="${flags[$i]}"; - local -n debugDirList="${debugDirs[$i]}"; - local -n allDirList="${allDirs[$i]}"; - local -n stripCmd="${stripCmds[$i]}"; - local -n ranlibCmd="${ranlibCmds[$i]}"; - if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then - continue; - fi; - stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; - stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; - done -} -unpackPhase () -{ - - runHook preUnpack; - if [ -z "${srcs:-}" ]; then - if [ -z "${src:-}" ]; then - echo 'variable $src or $srcs should point to the source'; - exit 1; - fi; - srcs="$src"; - fi; - local -a srcsArray; - concatTo srcsArray srcs; - local dirsBefore=""; - for i in *; - do - if [ -d "$i" ]; then - dirsBefore="$dirsBefore $i "; - fi; - done; - for i in "${srcsArray[@]}"; - do - unpackFile "$i"; - done; - : "${sourceRoot=}"; - if [ -n "${setSourceRoot:-}" ]; then - runOneHook setSourceRoot; - else - if [ -z "$sourceRoot" ]; then - for i in *; - do - if [ -d "$i" ]; then - case $dirsBefore in - *\ $i\ *) - - ;; - *) - if [ -n "$sourceRoot" ]; then - echo "unpacker produced multiple directories"; - exit 1; - fi; - sourceRoot="$i" - ;; - esac; - fi; - done; - fi; - fi; - if [ -z "$sourceRoot" ]; then - echo "unpacker appears to have produced no directories"; - exit 1; - fi; - echo "source root is $sourceRoot"; - if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then - chmod -R u+w -- "$sourceRoot"; - fi; - runHook postUnpack -} -consumeEntire () -{ - - if IFS='' read -r -d '' "$1"; then - echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; - return 1; - fi -} -activatePackage () -{ - - local pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - if [ -f "$pkg" ]; then - nixTalkativeLog "sourcing setup hook '$pkg'"; - source "$pkg"; - fi; - if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then - addToSearchPath _PATH "$pkg/bin"; - fi; - if (( hostOffset <= -1 )); then - addToSearchPath _XDG_DATA_DIRS "$pkg/share"; - fi; - if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then - addToSearchPath _HOST_PATH "$pkg/bin"; - fi; - if [[ -f "$pkg/nix-support/setup-hook" ]]; then - nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; - source "$pkg/nix-support/setup-hook"; - fi -} -updateSourceDateEpoch () -{ - - local path="$1"; - [[ $path == -* ]] && path="./$path"; - local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); - local time="${res[0]//\.[0-9]*/}"; - local newestFile="${res[1]}"; - if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then - echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; - export SOURCE_DATE_EPOCH="$time"; - local now="$(date +%s)"; - if [ "$time" -gt $((now - 60)) ]; then - echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; - fi; - fi -} -_moveSbin () -{ - - if [ "${dontMoveSbin-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then - return; - fi; - echo "moving $prefix/sbin/* to $prefix/bin"; - mkdir -p $prefix/bin; - shopt -s dotglob; - for i in $prefix/sbin/*; - do - mv "$i" $prefix/bin; - done; - shopt -u dotglob; - rmdir $prefix/sbin; - ln -s bin $prefix/sbin -} -_activatePkgs () -{ - - local hostOffset targetOffset; - local pkg; - for hostOffset in "${allPlatOffsets[@]}"; - do - local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; - for targetOffset in "${allPlatOffsets[@]}"; - do - (( hostOffset <= targetOffset )) || continue; - local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - activatePackage "$pkg" "$hostOffset" "$targetOffset"; - done; - done; - done -} -checkPhase () -{ - - runHook preCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom checkPhase, doing nothing"; - runHook postCheck; - return; - fi; - if [[ -z "${checkTarget:-}" ]]; then - if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then - checkTarget="check"; - else - if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then - checkTarget="test"; - fi; - fi; - fi; - if [[ -z "${checkTarget:-}" ]]; then - echo "no check/test target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; - echoCmd 'check flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postCheck -} -_updateSourceDateEpochFromSourceRoot () -{ - - if [ -n "$sourceRoot" ]; then - updateSourceDateEpoch "$sourceRoot"; - fi -} -_eval () -{ - - if declare -F "$1" > /dev/null 2>&1; then - "$@"; - else - eval "$1"; - fi -} -_overrideFirst () -{ - - if [ -z "${!1-}" ]; then - _assignFirst "$@"; - fi -} -addEnvHooks () -{ - - local depHostOffset="$1"; - shift; - local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; - local pkgHookVar; - for pkgHookVar in "${!pkgHookVarsSlice}"; - do - eval "${pkgHookVar}s"'+=("$@")'; - done -} -compressManPages () -{ - - local dir="$1"; - if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then - return; - fi; - echo "gzipping man pages under $dir/share/man/"; - find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; - find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do - local target; - target="$(readlink -f "$f")"; - if [ -f "$target".gz ]; then - ln -sf "$target".gz "$f".gz && rm "$f"; - fi; - done -} -patchShebangsAuto () -{ - - if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then - if [[ "$output" != out && "$output" = "$outputDev" ]]; then - patchShebangs --build "$prefix"; - else - patchShebangs --host "$prefix"; - fi; - fi -} -installCheckPhase () -{ - - runHook preInstallCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom installCheckPhase, doing nothing"; - else - if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then - echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; - echoCmd 'installcheck flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - fi; - runHook postInstallCheck -} -findInputs () -{ - - local -r pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - local varVar="${pkgAccumVarVars[hostOffset + 1]}"; - local varRef="$varVar[$((targetOffset - hostOffset))]"; - local var="${!varRef}"; - unset -v varVar varRef; - local varSlice="$var[*]"; - case " ${!varSlice-} " in - *" $pkg "*) - return 0 - ;; - esac; - unset -v varSlice; - eval "$var"'+=("$pkg")'; - if ! [ -e "$pkg" ]; then - echo "build input $pkg does not exist" 1>&2; - exit 1; - fi; - function mapOffset () - { - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi - }; - local relHostOffset; - for relHostOffset in "${allPlatOffsets[@]}"; - do - local files="${propagatedDepFilesVars[relHostOffset + 1]}"; - local hostOffsetNext; - mapOffset "$relHostOffset" hostOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - local relTargetOffset; - for relTargetOffset in "${allPlatOffsets[@]}"; - do - (( "$relHostOffset" <= "$relTargetOffset" )) || continue; - local fileRef="${files}[$relTargetOffset - $relHostOffset]"; - local file="${!fileRef}"; - unset -v fileRef; - local targetOffsetNext; - mapOffset "$relTargetOffset" targetOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - [[ -f "$pkg/nix-support/$file" ]] || continue; - local pkgNext; - read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; - for pkgNext in $pkgNext; - do - findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; - done; - done; - done -} -getRole () -{ - - case $1 in - -1) - role_post='_FOR_BUILD' - ;; - 0) - role_post='' - ;; - 1) - role_post='_FOR_TARGET' - ;; - *) - echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -nixInfoLog () -{ - - _nixLogWithLevel 3 "$*" -} -_moveToShare () -{ - - if [ -n "$__structuredAttrs" ]; then - if [ -z "${forceShare-}" ]; then - forceShare=(man doc info); - fi; - else - forceShare=(${forceShare:-man doc info}); - fi; - if [[ -z "$out" ]]; then - return; - fi; - for d in "${forceShare[@]}"; - do - if [ -d "$out/$d" ]; then - if [ -d "$out/share/$d" ]; then - echo "both $d/ and share/$d/ exist!"; - else - echo "moving $out/$d to $out/share/$d"; - mkdir -p $out/share; - mv $out/$d $out/share/; - fi; - fi; - done -} -_nixLogWithLevel () -{ - - [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; - local logLevel; - case "${1:?}" in - 0) - logLevel=ERROR - ;; - 1) - logLevel=WARN - ;; - 2) - logLevel=NOTICE - ;; - 3) - logLevel=INFO - ;; - 4) - logLevel=TALKATIVE - ;; - 5) - logLevel=CHATTY - ;; - 6) - logLevel=DEBUG - ;; - 7) - logLevel=VOMIT - ;; - *) - echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; - return 1 - ;; - esac; - local callerName="${FUNCNAME[2]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" -} -substituteStream () -{ - - local var=$1; - local description=$2; - shift 2; - while (( "$#" )); do - local replace_mode="$1"; - case "$1" in - --replace) - if ! "$_substituteStream_has_warned_replace_deprecation"; then - echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; - _substituteStream_has_warned_replace_deprecation=true; - fi; - replace_mode='--replace-warn' - ;& - --replace-quiet | --replace-warn | --replace-fail) - pattern="$2"; - replacement="$3"; - shift 3; - if ! [[ "${!var}" == *"$pattern"* ]]; then - if [ "$replace_mode" == --replace-warn ]; then - printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - else - if [ "$replace_mode" == --replace-fail ]; then - printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - return 1; - fi; - fi; - fi; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var) - local varName="$2"; - shift 2; - if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then - echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; - return 1; - fi; - if [ -z ${!varName+x} ]; then - echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; - return 1; - fi; - pattern="@$varName@"; - replacement="${!varName}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var-by) - pattern="@$2@"; - replacement="$3"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - shift 3 - ;; - *) - echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; - return 1 - ;; - esac; - done; - printf "%s" "${!var}" -} -substituteAllInPlace () -{ - - local fileName="$1"; - shift; - substituteAll "$fileName" "$fileName" "$@" -} -_defaultUnpack () -{ - - local fn="$1"; - local destination; - if [ -d "$fn" ]; then - destination="$(stripHash "$fn")"; - if [ -e "$destination" ]; then - echo "Cannot copy $fn to $destination: destination already exists!"; - echo "Did you specify two \"srcs\" with the same \"name\"?"; - return 1; - fi; - cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; - else - case "$fn" in - *.tar.xz | *.tar.lzma | *.txz) - ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; - true ) | tar xf - --mode=+w --warning=no-timestamp - ;; - *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) - tar xf "$fn" --mode=+w --warning=no-timestamp - ;; - *) - return 1 - ;; - esac; - fi -} -PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" -XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" - -eval "${shellHook:-}" -shopt -s expand_aliases - -exec /tmp/devenv-envlxtyGe/script \ No newline at end of file diff --git a/.devenv/shell-57d2e7b48bb8f8cf.sh b/.devenv/shell-57d2e7b48bb8f8cf.sh deleted file mode 100755 index 24a0f2aa9..000000000 --- a/.devenv/shell-57d2e7b48bb8f8cf.sh +++ /dev/null @@ -1,2313 +0,0 @@ -if [ -n "$PS1" ] && [ -e $HOME/.bashrc ]; then - source $HOME/.bashrc; -fi - -shopt -u expand_aliases -PATH=${PATH:-} -nix_saved_PATH="$PATH" -XDG_DATA_DIRS=${XDG_DATA_DIRS:-} -nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" -declare -a envHostTargetHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -DEVENV_TASK_FILE='/nix/store/67gwkyrn8qfd381zka7lgr23bm2d2v2a-tasks.json' -export DEVENV_TASK_FILE -preferLocalBuild='1' -export preferLocalBuild -IFS=' -' -depsHostHostPropagated='' -export depsHostHostPropagated -buildInputs='' -export buildInputs -outputLib='out' -outputDevdoc='REMOVE' -RANLIB='ranlib' -export RANLIB -declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelative' '_multioutPropagateDev' ) -DEVENV_RUNTIME='/run/user/1000/devenv-303d476' -export DEVENV_RUNTIME -PATH='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/bin:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/bin:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/bin:/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin:/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0/bin:/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0/bin:/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1/bin:/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0/bin:/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22/bin:/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1/bin:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/bin:/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1/bin:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/bin:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/bin:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/bin:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/bin:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/bin:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/bin:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/bin:/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin/bin:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/bin:/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin/bin:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/bin:/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin/bin:/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin/bin:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/bin:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/bin:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/bin:/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0/bin:/nix/store/sanx9fg8mry8mq92zhlm5qvb83qlxrlx-gcc-15.2.0/bin:/nix/store/pf30k3mg7n6bibc1k6609gyq7glk00k2-glibc-2.42-61-bin/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46/bin:/nix/store/p2vkw5s89ff1fs2d2rxqxiqil9s0jpcm-binutils-2.46/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' -export PATH -PKG_CONFIG='pkg-config' -export PKG_CONFIG -phases='buildPhase' -export phases -NIX_BUILD_CORES='4' -export NIX_BUILD_CORES -mesonFlags='' -export mesonFlags -defaultBuildInputs='' -STRIP='strip' -export STRIP -outputInfo='out' -declare -a envTargetTargetHooks=() -AS='as' -export AS -_substituteStream_has_warned_replace_deprecation='false' -name='devenv-shell-env' -export name -outputDev='out' -outputInclude='out' -HOST_PATH='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' -export HOST_PATH -declare -a pkgsTargetTarget=() -initialPath='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10 /nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0 /nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12 /nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9 /nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12 /nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0 /nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35 /nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14 /nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin /nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1 /nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9 /nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8 /nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin /nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45' -doCheck='' -export doCheck -declare -a envHostHostHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -declare -a pkgsBuildBuild=() -READELF='readelf' -export READELF -pkg='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' -NIX_HARDENING_ENABLE='bindnow format fortify fortify3 libcxxhardeningfast pic relro stackclashprotection stackprotector strictflexarrays1 strictoverflow zerocallusedregs' -export NIX_HARDENING_ENABLE -depsTargetTarget='' -export depsTargetTarget -outputs='out' -export outputs -GOTOOLDIR='/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin' -export GOTOOLDIR -declare -a preConfigureHooks=('_multioutConfig' ) -NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -shellHook=' -export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}" - - -# Override temp directories that stdenv set to NIX_BUILD_TOP. -# Only reset those that still point to the Nix build dir; leave -# any user/CI-supplied value intact so child processes (e.g. -# `devenv processes wait`) compute the same runtime directory. -for var in TMP TMPDIR TEMP TEMPDIR; do - if [ -n "${!var-}" ] && [ "${!var}" = "${NIX_BUILD_TOP-}" ]; then - export "$var"=/tmp - fi -done -if [ -n "${NIX_BUILD_TOP-}" ]; then - unset NIX_BUILD_TOP -fi - -# set path to locales on non-NixOS Linux hosts -if [ -z "${LOCALE_ARCHIVE-}" ]; then - export LOCALE_ARCHIVE=/nix/store/sp7b84c2jnbskd6dm2n5splgipg9d1f0-glibc-locales-2.42-61/lib/locale/locale-archive -fi - - -# direnv helper -if [ ! type -p direnv &>/dev/null && -f .envrc ]; then - echo "An .envrc file was detected, but the direnv command is not installed." - echo "To use this configuration, please install direnv: https://direnv.net/docs/installation.html" -fi - -mkdir -p "$DEVENV_STATE" -if [ ! -L "$DEVENV_DOTFILE/profile" ] || [ "$(/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin/readlink $DEVENV_DOTFILE/profile)" != "/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile" ] -then - ln -snf /nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile "$DEVENV_DOTFILE/profile" -fi -unset HOST_PATH NIX_BUILD_CORES __structuredAttrs buildInputs buildPhase builder depsBuildBuild depsBuildBuildPropagated depsBuildTarget depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget depsTargetTargetPropagated dontAddDisableDepTrack doCheck doInstallCheck nativeBuildInputs out outputs patches phases preferLocalBuild propagatedBuildInputs propagatedNativeBuildInputs shell shellHook stdenv strictDeps - -mkdir -p /run/user/1000/devenv-303d476 -ln -snf /run/user/1000/devenv-303d476 /home/karim/Dev/DevOps-Intro/.devenv/run - - -export PATH=$GOPATH/bin:$PATH - -echo "✨ devenv 2.0.6 is out of date. Please update to 2.1.2: https://devenv.sh/getting-started/#installation" >&2 - - -# Check whether the direnv integration is out of date. -{ - if [[ ":${DIRENV_ACTIVE-}:" == *":/home/karim/Dev/DevOps-Intro:"* ]]; then - if [[ ! "${DEVENV_NO_DIRENVRC_OUTDATED_WARNING-}" == 1 && ! "${DEVENV_DIRENVRC_ROLLING_UPGRADE-}" == 1 ]]; then - if [[ ${DEVENV_DIRENVRC_VERSION:-0} -lt 2 ]]; then - direnv_line=$(grep --color=never -E "source_url.*cachix/devenv" .envrc || echo "") - - echo "✨ The direnv integration in your .envrc is out of date." - echo "" - echo -n "RECOMMENDED: devenv can now auto-upgrade the direnv integration. " - if [[ -n "$direnv_line" ]]; then - echo "To enable this feature, replace the following line in your .envrc:" - echo "" - echo " $direnv_line" - echo "" - echo "with:" - echo "" - echo " eval \"\$(devenv direnvrc)\"" - else - echo "To enable this feature, replace the \`source_url\` line that fetches the direnvrc integration in your .envrc with:" - echo "" - echo " eval \"$(devenv direnvrc)\"" - fi - echo "" - echo "If you prefer to continue managing the integration manually, follow the upgrade instructions at https://devenv.sh/integrations/direnv/." - echo "" - echo "To disable this message:" - echo "" - echo " Add the following environment to your .envrc before \`use devenv\`:" - echo "" - echo " export DEVENV_NO_DIRENVRC_OUTDATED_WARNING=1" - echo "" - echo " Or set the following option in your devenv configuration:" - echo "" - echo " devenv.warnOnNewVersion = false;" - echo "" - fi - fi - fi -} >&2 - -echo "── DevOps-Intro devenv ──" -go version -git --version -echo "QuickNotes: cd app && go run ." - -' -export shellHook -depsBuildBuildPropagated='' -export depsBuildBuildPropagated -depsBuildTarget='' -export depsBuildTarget -outputMan='out' -propagatedNativeBuildInputs='' -export propagatedNativeBuildInputs -declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) -OBJDUMP='objdump' -export OBJDUMP -preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' -outputBin='out' -PYTHONHASHSEED='0' -export PYTHONHASHSEED -PYTHONNOUSERSITE='1' -export PYTHONNOUSERSITE -depsBuildTargetPropagated='' -export depsBuildTargetPropagated -outputDoc='out' -NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -PKG_CONFIG_PATH='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/lib/pkgconfig:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/pkgconfig:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/lib/pkgconfig:/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/lib/pkgconfig:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/lib/pkgconfig:/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/lib/pkgconfig:/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/lib/pkgconfig:/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/lib/pkgconfig:/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/lib/pkgconfig:/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/lib/pkgconfig:/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/lib/pkgconfig:/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/lib/pkgconfig:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share/pkgconfig:/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/lib/pkgconfig:/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/lib/pkgconfig' -export PKG_CONFIG_PATH -NIX_CFLAGS_COMPILE=' -frandom-seed=86aa67916d -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include' -export NIX_CFLAGS_COMPILE -configureFlags='' -export configureFlags -AR='ar' -export AR -declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) -nativeBuildInputs='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev /nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2 /nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1 /nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0 /nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0 /nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0 /nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1 /nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0 /nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22 /nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1 /nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0 /nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12 /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev /nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0 /nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' -export nativeBuildInputs -declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) -declare -a unpackCmdHooks=('_defaultUnpack' ) -PYTHONPATH='/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/python3.13/site-packages' -export PYTHONPATH -NIX_LDFLAGS='-rpath /nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib' -export NIX_LDFLAGS -propagatedBuildInputs='' -export propagatedBuildInputs -declare -a envBuildHostHooks=('addPythonPath' 'sysconfigdataHook' ) -declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) -depsHostHost='' -export depsHostHost -LINENO='79' -declare -a pkgsBuildHost=('/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev' '/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9' '/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2' '/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1' '/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0' '/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0' '/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0' '/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1' '/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0' '/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22' '/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1' '/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0' '/nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev' '/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1' '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' '/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev' '/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev' '/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib' '/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0' '/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev' '/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib' '/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1' '/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev' '/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib' '/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1' '/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev' '/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0' '/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev' '/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0' '/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev' '/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin' '/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8' '/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev' '/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin' '/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1' '/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev' '/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26' '/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5' '/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev' '/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1' '/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev' '/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2' '/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev' '/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin' '/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7' '/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin' '/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0' '/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev' '/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin' '/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1' '/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0' '/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' '/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2' '/nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' '/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' ) -NIX_BINTOOLS='/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' -export NIX_BINTOOLS -XDG_DATA_DIRS='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/share:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/share:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/share:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/share:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/share:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/share:/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/share:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/share:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/share:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/share:/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/share:/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26/share:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/share:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share:/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/share:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/share:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/share:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/share:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/share' -export XDG_DATA_DIRS -builder='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export builder -patches='' -export patches -NIX_NO_SELF_RPATH='1' -DETERMINISTIC_BUILD='1' -export DETERMINISTIC_BUILD -DEVENV_PROFILE='/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile' -export DEVENV_PROFILE -STRINGS='strings' -export STRINGS -declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) -doInstallCheck='' -export doInstallCheck -system='x86_64-linux' -export system -NIX_CC='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' -export NIX_CC -dontAddDisableDepTrack='1' -export dontAddDisableDepTrack -DEVENV_TASKS='' -export DEVENV_TASKS -prefix='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' -strictDeps='' -export strictDeps -DEVENV_ROOT='/home/karim/Dev/DevOps-Intro' -export DEVENV_ROOT -cmakeFlags='' -export cmakeFlags -out='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' -export out -declare -a pkgsBuildTarget=() -OSTYPE='linux-gnu' -CC='gcc' -export CC -OPTERR='1' -depsTargetTargetPropagated='' -export depsTargetTargetPropagated -SIZE='size' -export SIZE -hardeningDisable='' -export hardeningDisable -MACHTYPE='x86_64-pc-linux-gnu' -PS4='+ ' -outputDevman='out' -depsBuildBuild='' -export depsBuildBuild -DEVENV_STATE='/home/karim/Dev/DevOps-Intro/.devenv/state' -export DEVENV_STATE -NIX_ENFORCE_NO_NATIVE='1' -export NIX_ENFORCE_NO_NATIVE -buildPhase='{ echo "------------------------------------------------------------"; - echo " WARNING: the existence of this path is not guaranteed."; - echo " It is an internal implementation detail for pkgs.mkShell."; - echo "------------------------------------------------------------"; - echo; - # Record all build inputs as runtime dependencies - export; -} >> "$out" -' -export buildPhase -stdenv='/nix/store/w708nqm6lvvikrq8d3x45g96hzfij0r8-stdenv-linux' -export stdenv -_PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu' -export _PYTHON_SYSCONFIGDATA_NAME -GOROOT='/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share/go/' -export GOROOT -BASH='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -declare -a envBuildTargetHooks=('addPythonPath' 'sysconfigdataHook' ) -_PYTHON_HOST_PLATFORM='linux-x86_64' -export _PYTHON_HOST_PLATFORM -declare -a pkgsHostTarget=() -DEVENV_DOTFILE='/home/karim/Dev/DevOps-Intro/.devenv' -export DEVENV_DOTFILE -CXX='g++' -export CXX -NM='nm' -export NM -GOTOOLCHAIN='local' -export GOTOOLCHAIN -SOURCE_DATE_EPOCH='315532800' -export SOURCE_DATE_EPOCH -shell='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export shell -OBJCOPY='objcopy' -export OBJCOPY -declare -a pkgsHostHost=() -HOSTTYPE='x86_64' -IN_NIX_SHELL='impure' -export IN_NIX_SHELL -SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export SHELL -CONFIG_SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export CONFIG_SHELL -OLDPWD='' -export OLDPWD -declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) -LD='ld' -export LD -defaultNativeBuildInputs='/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2 /nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' -declare -a envBuildBuildHooks=('addPythonPath' 'sysconfigdataHook' ) -__structuredAttrs='' -export __structuredAttrs -NIX_STORE='/nix/store' -export NIX_STORE -GOPATH='/home/karim/Dev/DevOps-Intro/.devenv/state/go' -export GOPATH -fixupPhase () -{ - - local output; - for output in $(getAllOutputNames); - do - if [ -e "${!output}" ]; then - chmod -R u+w,u-s,g-s "${!output}"; - fi; - done; - runHook preFixup; - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" runHook fixupOutput; - done; - recordPropagatedDependencies; - if [ -n "${setupHook:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; - fi; - if [ -n "${setupHooks:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - local hook; - for hook in ${setupHooks[@]}; - do - local content; - consumeEntire content < "$hook"; - substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; - unset -v content; - done; - unset -v hook; - fi; - if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then - mkdir -p "${!outputBin}/nix-support"; - printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; - fi; - runHook postFixup -} -printWords () -{ - - (( "$#" > 0 )) || return 0; - printf '%s ' "$@" -} -runHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook; - for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - _eval "$hook" "$@"; - done; - return 0 -} -printLines () -{ - - (( "$#" > 0 )) || return 0; - printf '%s\n' "$@" -} -addToSearchPathWithCustomDelimiter () -{ - - local delimiter="$1"; - local varName="$2"; - local dir="$3"; - if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then - export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; - fi -} -stripDirs () -{ - - local cmd="$1"; - local ranlibCmd="$2"; - local paths="$3"; - local stripFlags="$4"; - local excludeFlags=(); - local pathsNew=; - [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; - [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; - local pattern; - if [ -n "${stripExclude:-}" ]; then - for pattern in "${stripExclude[@]}"; - do - excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); - done; - fi; - local p; - for p in ${paths}; - do - if [ -e "$prefix/$p" ]; then - pathsNew="${pathsNew} $prefix/$p"; - fi; - done; - paths=${pathsNew}; - if [ -n "${paths}" ]; then - echo "stripping (with command $cmd and flags $stripFlags) in $paths"; - local striperr; - striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; - find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; - [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); - rm "$striperr"; - find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; - fi -} -substituteAll () -{ - - local input="$1"; - local output="$2"; - local -a args=(); - _allFlags; - substitute "$input" "$output" "${args[@]}" -} -_defaultUnpack () -{ - - local fn="$1"; - local destination; - if [ -d "$fn" ]; then - destination="$(stripHash "$fn")"; - if [ -e "$destination" ]; then - echo "Cannot copy $fn to $destination: destination already exists!"; - echo "Did you specify two \"srcs\" with the same \"name\"?"; - return 1; - fi; - cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; - else - case "$fn" in - *.tar.xz | *.tar.lzma | *.txz) - ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; - true ) | tar xf - --mode=+w --warning=no-timestamp - ;; - *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) - tar xf "$fn" --mode=+w --warning=no-timestamp - ;; - *) - return 1 - ;; - esac; - fi -} -_activatePkgs () -{ - - local hostOffset targetOffset; - local pkg; - for hostOffset in "${allPlatOffsets[@]}"; - do - local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; - for targetOffset in "${allPlatOffsets[@]}"; - do - (( hostOffset <= targetOffset )) || continue; - local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - activatePackage "$pkg" "$hostOffset" "$targetOffset"; - done; - done; - done -} -_doStrip () -{ - - local -ra flags=(dontStripHost dontStripTarget); - local -ra debugDirs=(stripDebugList stripDebugListTarget); - local -ra allDirs=(stripAllList stripAllListTarget); - local -ra stripCmds=(STRIP STRIP_FOR_TARGET); - local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); - stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; - stripDebugListTarget=${stripDebugListTarget[*]:-}; - stripAllList=${stripAllList[*]:-}; - stripAllListTarget=${stripAllListTarget[*]:-}; - local i; - for i in ${!stripCmds[@]}; - do - local -n flag="${flags[$i]}"; - local -n debugDirList="${debugDirs[$i]}"; - local -n allDirList="${allDirs[$i]}"; - local -n stripCmd="${stripCmds[$i]}"; - local -n ranlibCmd="${ranlibCmds[$i]}"; - if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then - continue; - fi; - stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; - stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; - done -} -_multioutPropagateDev () -{ - - if [ "$(getAllOutputNames)" = "out" ]; then - return; - fi; - local outputFirst; - for outputFirst in $(getAllOutputNames); - do - break; - done; - local propagaterOutput="$outputDev"; - if [ -z "$propagaterOutput" ]; then - propagaterOutput="$outputFirst"; - fi; - if [ -z "${propagatedBuildOutputs+1}" ]; then - local po_dirty="$outputBin $outputInclude $outputLib"; - set +o pipefail; - propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; - set -o pipefail; - fi; - if [ -z "$propagatedBuildOutputs" ]; then - return; - fi; - mkdir -p "${!propagaterOutput}"/nix-support; - for output in $propagatedBuildOutputs; - do - echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; - done -} -compressManPages () -{ - - local dir="$1"; - if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then - return; - fi; - echo "gzipping man pages under $dir/share/man/"; - find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; - find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do - local target; - target="$(readlink -f "$f")"; - if [ -f "$target".gz ]; then - ln -sf "$target".gz "$f".gz && rm "$f"; - fi; - done -} -_multioutDevs () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then - return; - fi; - moveToOutput include "${!outputInclude}"; - moveToOutput lib/pkgconfig "${!outputDev}"; - moveToOutput share/pkgconfig "${!outputDev}"; - moveToOutput lib/cmake "${!outputDev}"; - moveToOutput share/aclocal "${!outputDev}"; - for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; - do - echo "Patching '$f' includedir to output ${!outputInclude}"; - sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; - done -} -concatTo () -{ - - local -; - set -o noglob; - local -n targetref="$1"; - shift; - local arg default name type; - for arg in "$@"; - do - IFS="=" read -r name default <<< "$arg"; - local -n nameref="$name"; - if [[ -z "${nameref[*]}" && -n "$default" ]]; then - targetref+=("$default"); - else - if type=$(declare -p "$name" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; - return 1 - ;; - -a*) - targetref+=("${nameref[@]}") - ;; - *) - if [[ "$name" = *"Array" ]]; then - nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; - targetref+=(${nameref+"${nameref[@]}"}); - else - targetref+=(${nameref-}); - fi - ;; - esac; - fi; - fi; - done -} -definePhases () -{ - - if [ -z "${phases[*]:-}" ]; then - phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; - fi -} -prependToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=("$@" ${nameref+"${nameref[@]}"}); - else - nameref="$* ${nameref-}"; - fi -} -ccWrapper_addCVars () -{ - - local role_post; - getHostRoleEnvHook; - local found=; - if [ -d "$1/include" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; - found=1; - fi; - if [ -d "$1/Library/Frameworks" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; - found=1; - fi; - if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then - local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; - export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; - fi -} -_moveLib64 () -{ - - if [ "${dontMoveLib64-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then - return; - fi; - echo "moving $prefix/lib64/* to $prefix/lib"; - mkdir -p $prefix/lib; - shopt -s dotglob; - for i in $prefix/lib64/*; - do - mv --no-clobber "$i" $prefix/lib; - done; - shopt -u dotglob; - rmdir $prefix/lib64; - ln -s lib $prefix/lib64 -} -recordPropagatedDependencies () -{ - - declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); - declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); - local propagatedInputsIndex; - for propagatedInputsIndex in "${!flatVars[@]}"; - do - local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; - local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; - [[ -n "${!propagatedInputsSlice}" ]] || continue; - mkdir -p "${!outputDev}/nix-support"; - printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; - done -} -substituteAllStream () -{ - - local -a args=(); - _allFlags; - substituteStream "$1" "$2" "${args[@]}" -} -substituteInPlace () -{ - - local -a fileNames=(); - for arg in "$@"; - do - if [[ "$arg" = "--"* ]]; then - break; - fi; - fileNames+=("$arg"); - shift; - done; - if ! [[ "${#fileNames[@]}" -gt 0 ]]; then - echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; - return 1; - fi; - for file in "${fileNames[@]}"; - do - substitute "$file" "$file" "$@"; - done -} -installCheckPhase () -{ - - runHook preInstallCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom installCheckPhase, doing nothing"; - else - if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then - echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; - echoCmd 'installcheck flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - fi; - runHook postInstallCheck -} -_eval () -{ - - if declare -F "$1" > /dev/null 2>&1; then - "$@"; - else - eval "$1"; - fi -} -auditTmpdir () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "checking for references to $TMPDIR/ in $dir..."; - local tmpdir elf_fifo script_fifo; - tmpdir="$(mktemp -d)"; - elf_fifo="$tmpdir/elf"; - script_fifo="$tmpdir/script"; - mkfifo "$elf_fifo" "$script_fifo"; - ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do - if isELF "$file"; then - printf '%s\0' "$file" 1>&3; - else - if isScript "$file"; then - filename=${file##*/}; - dir=${file%/*}; - if [ -e "$dir/.$filename-wrapped" ]; then - printf '%s\0' "$file" 1>&4; - fi; - fi; - fi; - done; - exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then - echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$elf_fifo" ) & local pid_elf=$!; - local pid_script; - ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if grep -q -F "$TMPDIR/" "$1"; then - echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$script_fifo" ) & local pid_script=$!; - wait "$pid_elf" || { - echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - wait "$pid_script" || { - echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - rm -r "$tmpdir" -} -configurePhase () -{ - - runHook preConfigure; - : "${configureScript=}"; - if [[ -z "$configureScript" && -x ./configure ]]; then - configureScript=./configure; - fi; - if [ -z "${dontFixLibtool:-}" ]; then - export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; - local i; - find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do - echo "fixing libtool script $i"; - fixLibtool "$i"; - done; - CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); - find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; - rm -f "$CONFIGURE_MTIME_REFERENCE"; - fi; - if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; - if [ "${prefixKeyOrDefault: -1}" = " " ]; then - prependToVar configureFlags "$prefix"; - prependToVar configureFlags "${prefixKeyOrDefault::-1}"; - else - prependToVar configureFlags "$prefixKeyOrDefault$prefix"; - fi; - fi; - if [[ -f "$configureScript" ]]; then - if [ -z "${dontAddDisableDepTrack:-}" ]; then - if grep -q dependency-tracking "$configureScript"; then - prependToVar configureFlags --disable-dependency-tracking; - fi; - fi; - if [ -z "${dontDisableStatic:-}" ]; then - if grep -q enable-static "$configureScript"; then - prependToVar configureFlags --disable-static; - fi; - fi; - if [ -z "${dontPatchShebangsInConfigure:-}" ]; then - patchShebangs --build "$configureScript"; - fi; - fi; - if [ -n "$configureScript" ]; then - local -a flagsArray; - concatTo flagsArray configureFlags configureFlagsArray; - echoCmd 'configure flags' "${flagsArray[@]}"; - $configureScript "${flagsArray[@]}"; - unset flagsArray; - else - echo "no configure script, doing nothing"; - fi; - runHook postConfigure -} -_addToEnv () -{ - - local depHostOffset depTargetOffset; - local pkg; - for depHostOffset in "${allPlatOffsets[@]}"; - do - local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; - local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; - for depTargetOffset in "${allPlatOffsets[@]}"; - do - (( depHostOffset <= depTargetOffset )) || continue; - local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; - if [[ -z "${strictDeps-}" ]]; then - local visitedPkgs=""; - for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; - do - if [[ "$visitedPkgs" = *"$pkg"* ]]; then - continue; - fi; - runHook "${!hookRef}" "$pkg"; - visitedPkgs+=" $pkg"; - done; - else - local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - runHook "${!hookRef}" "$pkg"; - done; - fi; - done; - done -} -runOneHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook ret=1; - for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - if _eval "$hook" "$@"; then - ret=0; - break; - fi; - done; - return "$ret" -} -nixWarnLog () -{ - - _nixLogWithLevel 1 "$*" -} -_moveToShare () -{ - - if [ -n "$__structuredAttrs" ]; then - if [ -z "${forceShare-}" ]; then - forceShare=(man doc info); - fi; - else - forceShare=(${forceShare:-man doc info}); - fi; - if [[ -z "$out" ]]; then - return; - fi; - for d in "${forceShare[@]}"; - do - if [ -d "$out/$d" ]; then - if [ -d "$out/share/$d" ]; then - echo "both $d/ and share/$d/ exist!"; - else - echo "moving $out/$d to $out/share/$d"; - mkdir -p $out/share; - mv $out/$d $out/share/; - fi; - fi; - done -} -runPhase () -{ - - local curPhase="$*"; - if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then - return; - fi; - if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then - return; - fi; - if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then - return; - fi; - if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then - return; - fi; - if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then - return; - fi; - if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then - return; - fi; - showPhaseHeader "$curPhase"; - dumpVars; - local startTime endTime; - startTime=$(date +"%s"); - eval "${!curPhase:-$curPhase}"; - endTime=$(date +"%s"); - showPhaseFooter "$curPhase" "$startTime" "$endTime"; - if [ "$curPhase" = unpackPhase ]; then - [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; - cd -- "${sourceRoot:-.}"; - fi -} -patchShebangs () -{ - - local pathName; - local update=false; - while [[ $# -gt 0 ]]; do - case "$1" in - --host) - pathName=HOST_PATH; - shift - ;; - --build) - pathName=PATH; - shift - ;; - --update) - update=true; - shift - ;; - --) - shift; - break - ;; - -* | --*) - echo "Unknown option $1 supplied to patchShebangs" 1>&2; - return 1 - ;; - *) - break - ;; - esac; - done; - echo "patching script interpreter paths in $@"; - local f; - local oldPath; - local newPath; - local arg0; - local args; - local oldInterpreterLine; - local newInterpreterLine; - if [[ $# -eq 0 ]]; then - echo "No arguments supplied to patchShebangs" 1>&2; - return 0; - fi; - local f; - while IFS= read -r -d '' f; do - isScript "$f" || continue; - read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; - read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; - if [[ -z "${pathName:-}" ]]; then - if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then - pathName=HOST_PATH; - else - pathName=PATH; - fi; - fi; - if [[ "$oldPath" == *"/bin/env" ]]; then - if [[ $arg0 == "-S" ]]; then - arg0=${args%% *}; - [[ "$args" == *" "* ]] && args=${args#* } || args=; - newPath="$(PATH="${!pathName}" type -P "env" || true)"; - args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; - else - if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; - exit 1; - else - newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; - fi; - fi; - else - if [[ -z $oldPath ]]; then - oldPath="/bin/sh"; - fi; - newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; - args="$arg0 $args"; - fi; - newInterpreterLine="$newPath $args"; - newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; - if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then - if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then - echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; - escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; - timestamp=$(stat --printf "%y" "$f"); - tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); - sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; - local restoreReadOnly; - if [[ ! -w "$f" ]]; then - chmod +w "$f"; - restoreReadOnly=true; - fi; - cat "$tmpFile" > "$f"; - rm "$tmpFile"; - if [[ -n "${restoreReadOnly:-}" ]]; then - chmod -w "$f"; - fi; - touch --date "$timestamp" "$f"; - fi; - fi; - done < <(find "$@" -type f -perm -0100 -print0) -} -stripHash () -{ - - local strippedName casematchOpt=0; - strippedName="$(basename -- "$1")"; - shopt -q nocasematch && casematchOpt=1; - shopt -u nocasematch; - if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then - echo "${strippedName:33}"; - else - echo "$strippedName"; - fi; - if (( casematchOpt )); then - shopt -s nocasematch; - fi -} -updateSourceDateEpoch () -{ - - local path="$1"; - [[ $path == -* ]] && path="./$path"; - local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); - local time="${res[0]//\.[0-9]*/}"; - local newestFile="${res[1]}"; - if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then - echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; - export SOURCE_DATE_EPOCH="$time"; - local now="$(date +%s)"; - if [ "$time" -gt $((now - 60)) ]; then - echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; - fi; - fi -} -toPythonPath () -{ - - local paths="$1"; - local result=; - for i in $paths; - do - p="$i/lib/python3.13/site-packages"; - result="${result}${result:+:}$p"; - done; - echo $result -} -substitute () -{ - - local input="$1"; - local output="$2"; - shift 2; - if [ ! -f "$input" ]; then - echo "substitute(): ERROR: file '$input' does not exist" 1>&2; - return 1; - fi; - local content; - consumeEntire content < "$input"; - if [ -e "$output" ]; then - chmod +w "$output"; - fi; - substituteStream content "file '$input'" "$@" > "$output" -} -updateAutotoolsGnuConfigScriptsPhase () -{ - - if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then - return; - fi; - for script in config.sub config.guess; - do - for f in $(find . -type f -name "$script"); - do - echo "Updating Autotools / GNU config script to a newer upstream version: $f"; - cp -f "/nix/store/kppfbp4x7mhfz1q5zswavxxxq71v2f7c-gnu-config-2024-01-01/$script" "$f"; - done; - done -} -nixNoticeLog () -{ - - _nixLogWithLevel 2 "$*" -} -_multioutConfig () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then - return; - fi; - if [ -z "${shareDocName:-}" ]; then - local confScript="${configureScript:-}"; - if [ -z "$confScript" ] && [ -x ./configure ]; then - confScript=./configure; - fi; - if [ -f "$confScript" ]; then - local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; - fi; - if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then - shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; - fi; - fi; - prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; - prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal -} -nixErrorLog () -{ - - _nixLogWithLevel 0 "$*" -} -getTargetRoleEnvHook () -{ - - getRole "$depTargetOffset" -} -nixTalkativeLog () -{ - - _nixLogWithLevel 4 "$*" -} -pkgConfigWrapper_addPkgConfigPath () -{ - - local role_post; - getHostRoleEnvHook; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" -} -noBrokenSymlinksInAllOutputs () -{ - - if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then - for output in $(getAllOutputNames); - do - noBrokenSymlinks "${!output}"; - done; - fi -} -patchShebangsAuto () -{ - - if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then - if [[ "$output" != out && "$output" = "$outputDev" ]]; then - patchShebangs --build "$prefix"; - else - patchShebangs --host "$prefix"; - fi; - fi -} -checkPhase () -{ - - runHook preCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom checkPhase, doing nothing"; - runHook postCheck; - return; - fi; - if [[ -z "${checkTarget:-}" ]]; then - if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then - checkTarget="check"; - else - if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then - checkTarget="test"; - fi; - fi; - fi; - if [[ -z "${checkTarget:-}" ]]; then - echo "no check/test target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; - echoCmd 'check flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postCheck -} -fixLibtool () -{ - - local search_path; - for flag in $NIX_LDFLAGS; - do - case $flag in - -L*) - search_path+=" ${flag#-L}" - ;; - esac; - done; - sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' -} -getHostRoleEnvHook () -{ - - getRole "$depHostOffset" -} -installPhase () -{ - - runHook preInstall; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom installPhase, doing nothing"; - runHook postInstall; - return; - else - foundMakefile=1; - fi; - if [ -n "$prefix" ]; then - mkdir -p "$prefix"; - fi; - local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; - echoCmd 'install flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - runHook postInstall -} -mapOffset () -{ - - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi -} -genericBuild () -{ - - export GZIP_NO_TIMESTAMPS=1; - if [ -f "${buildCommandPath:-}" ]; then - source "$buildCommandPath"; - return; - fi; - if [ -n "${buildCommand:-}" ]; then - eval "$buildCommand"; - return; - fi; - definePhases; - for curPhase in ${phases[*]}; - do - runPhase "$curPhase"; - done -} -_callImplicitHook () -{ - - local def="$1"; - local hookName="$2"; - if declare -F "$hookName" > /dev/null; then - nixTalkativeLog "calling implicit '$hookName' function hook"; - "$hookName"; - else - if type -p "$hookName" > /dev/null; then - nixTalkativeLog "sourcing implicit '$hookName' script hook"; - source "$hookName"; - else - if [ -n "${!hookName:-}" ]; then - nixTalkativeLog "evaling implicit '$hookName' string hook"; - eval "${!hookName}"; - else - return "$def"; - fi; - fi; - fi -} -exitHandler () -{ - - exitCode="$?"; - set +e; - if [ -n "${showBuildStats:-}" ]; then - read -r -d '' -a buildTimes < <(times); - echo "build times:"; - echo "user time for the shell ${buildTimes[0]}"; - echo "system time for the shell ${buildTimes[1]}"; - echo "user time for all child processes ${buildTimes[2]}"; - echo "system time for all child processes ${buildTimes[3]}"; - fi; - if (( "$exitCode" != 0 )); then - runHook failureHook; - if [ -n "${succeedOnFailure:-}" ]; then - echo "build failed with exit code $exitCode (ignored)"; - mkdir -p "$out/nix-support"; - printf "%s" "$exitCode" > "$out/nix-support/failed"; - exit 0; - fi; - else - runHook exitHook; - fi; - return "$exitCode" -} -_makeSymlinksRelative () -{ - - local prefixes; - prefixes=(); - for output in $(getAllOutputNames); - do - [ ! -e "${!output}" ] && continue; - prefixes+=("${!output}"); - done; - find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' - output="$1" - link="$2" - - linkTarget=$(readlink "$link") - - # only touch links that point inside the same output tree - [[ $linkTarget == "$output"/* ]] || exit 0 - - if [ ! -e "$linkTarget" ]; then - echo "the symlink $link is broken, it points to $linkTarget (which is missing)" - fi - - echo "making symlink relative: $link" - ln -snrf "$linkTarget" "$link" - ' _ -} -appendToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=(${nameref+"${nameref[@]}"} "$@"); - else - nameref="${nameref-} $*"; - fi -} -nixInfoLog () -{ - - _nixLogWithLevel 3 "$*" -} -getTargetRole () -{ - - getRole "$targetOffset" -} -addPythonPath () -{ - - addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.13/site-packages -} -_assignFirst () -{ - - local varName="$1"; - local _var; - local REMOVE=REMOVE; - shift; - for _var in "$@"; - do - if [ -n "${!_var-}" ]; then - eval "${varName}"="${_var}"; - return; - fi; - done; - echo; - echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; - echo " The following variables were all unset or empty:"; - echo " $*"; - if [ -z "${out:-}" ]; then - echo ' If you do not want an "out" output in your derivation, make sure to define'; - echo ' the other specific required outputs. This can be achieved by picking one'; - echo " of the above as an output."; - echo ' You do not have to remove "out" if you want to have a different default'; - echo ' output, because the first output is taken as a default.'; - echo; - fi; - return 1 -} -patchPhase () -{ - - runHook prePatch; - local -a patchesArray; - concatTo patchesArray patches; - local -a flagsArray; - concatTo flagsArray patchFlags=-p1; - for i in "${patchesArray[@]}"; - do - echo "applying patch $i"; - local uncompress=cat; - case "$i" in - *.gz) - uncompress="gzip -d" - ;; - *.bz2) - uncompress="bzip2 -d" - ;; - *.xz) - uncompress="xz -d" - ;; - *.lzma) - uncompress="lzma -d" - ;; - esac; - $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; - done; - runHook postPatch -} -_pruneLibtoolFiles () -{ - - if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; -} -concatStringsSep () -{ - - local sep="$1"; - local name="$2"; - local type oldifs; - if type=$(declare -p "$name" 2> /dev/null); then - local -n nameref="$name"; - case "${type#* }" in - -A*) - echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; - return 1 - ;; - -a*) - local IFS="$(printf '\036')" - ;; - *) - local IFS=" " - ;; - esac; - local ifs_separated="${nameref[*]}"; - echo -n "${ifs_separated//"$IFS"/"$sep"}"; - fi -} -moveToOutput () -{ - - local patt="$1"; - local dstOut="$2"; - local output; - for output in $(getAllOutputNames); - do - if [ "${!output}" = "$dstOut" ]; then - continue; - fi; - local srcPath; - for srcPath in "${!output}"/$patt; - do - if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then - continue; - fi; - if [ "$dstOut" = REMOVE ]; then - echo "Removing $srcPath"; - rm -r "$srcPath"; - else - local dstPath="$dstOut${srcPath#${!output}}"; - echo "Moving $srcPath to $dstPath"; - if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then - rmdir "$srcPath" --ignore-fail-on-non-empty; - if [ -d "$srcPath" ]; then - mv -t "$dstPath" "$srcPath"/*; - rmdir "$srcPath"; - fi; - else - mkdir -p "$(readlink -m "$dstPath/..")"; - mv "$srcPath" "$dstPath"; - fi; - fi; - local srcParent="$(readlink -m "$srcPath/..")"; - if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then - echo "Removing empty $srcParent/ and (possibly) its parents"; - rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; - fi; - done; - done -} -noBrokenSymlinks () -{ - - local -r output="${1:?}"; - local path; - local pathParent; - local symlinkTarget; - local -i numDanglingSymlinks=0; - local -i numReflexiveSymlinks=0; - local -i numUnreadableSymlinks=0; - if [[ ! -e $output ]]; then - nixWarnLog "skipping non-existent output $output"; - return 0; - fi; - nixInfoLog "running on $output"; - while IFS= read -r -d '' path; do - pathParent="$(dirname "$path")"; - if ! symlinkTarget="$(readlink "$path")"; then - nixErrorLog "the symlink $path is unreadable"; - numUnreadableSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget == /* ]]; then - nixInfoLog "symlink $path points to absolute target $symlinkTarget"; - else - nixInfoLog "symlink $path points to relative target $symlinkTarget"; - symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; - fi; - if [[ $symlinkTarget = "$TMPDIR"/* ]]; then - nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; - numDanglingSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then - nixInfoLog "symlink $path points outside the Nix store; ignoring"; - continue; - fi; - if [[ $path == "$symlinkTarget" ]]; then - nixErrorLog "the symlink $path is reflexive"; - numReflexiveSymlinks+=1; - else - if [[ ! -e $symlinkTarget ]]; then - nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; - numDanglingSymlinks+=1; - else - nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; - fi; - fi; - done < <(find "$output" -type l -print0); - if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then - nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; - exit 1; - fi; - return 0 -} -isScript () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 2 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" =~ \#! ]]; then - return 0; - else - return 1; - fi -} -_allFlags () -{ - - export system pname name version; - while IFS='' read -r varName; do - nixTalkativeLog "@${varName}@ -> ${!varName}"; - args+=("--subst-var" "$varName"); - done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') -} -patchELF () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "shrinking RPATHs of ELF executables and libraries in $dir"; - local i; - while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if ! isELF "$i"; then - continue; - fi; - echo "shrinking $i"; - patchelf --shrink-rpath "$i" || true; - done < <(find "$dir" -type f -print0) -} -isELF () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [ "$magic" = 'ELF' ]; then - return 0; - else - return 1; - fi -} -consumeEntire () -{ - - if IFS='' read -r -d '' "$1"; then - echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; - return 1; - fi -} -getAllOutputNames () -{ - - if [ -n "$__structuredAttrs" ]; then - echo "${!outputs[*]}"; - else - echo "$outputs"; - fi -} -_overrideFirst () -{ - - if [ -z "${!1-}" ]; then - _assignFirst "$@"; - fi -} -printPhases () -{ - - definePhases; - local phase; - for phase in ${phases[*]}; - do - printf '%s\n' "$phase"; - done -} -getHostRole () -{ - - getRole "$hostOffset" -} -nixVomitLog () -{ - - _nixLogWithLevel 7 "$*" -} -substituteStream () -{ - - local var=$1; - local description=$2; - shift 2; - while (( "$#" )); do - local replace_mode="$1"; - case "$1" in - --replace) - if ! "$_substituteStream_has_warned_replace_deprecation"; then - echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; - _substituteStream_has_warned_replace_deprecation=true; - fi; - replace_mode='--replace-warn' - ;& - --replace-quiet | --replace-warn | --replace-fail) - pattern="$2"; - replacement="$3"; - shift 3; - if ! [[ "${!var}" == *"$pattern"* ]]; then - if [ "$replace_mode" == --replace-warn ]; then - printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - else - if [ "$replace_mode" == --replace-fail ]; then - printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - return 1; - fi; - fi; - fi; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var) - local varName="$2"; - shift 2; - if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then - echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; - return 1; - fi; - if [ -z ${!varName+x} ]; then - echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; - return 1; - fi; - pattern="@$varName@"; - replacement="${!varName}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var-by) - pattern="@$2@"; - replacement="$3"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - shift 3 - ;; - *) - echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; - return 1 - ;; - esac; - done; - printf "%s" "${!var}" -} -_updateSourceDateEpochFromSourceRoot () -{ - - if [ -n "$sourceRoot" ]; then - updateSourceDateEpoch "$sourceRoot"; - fi -} -nixDebugLog () -{ - - _nixLogWithLevel 6 "$*" -} -bintoolsWrapper_addLDVars () -{ - - local role_post; - getHostRoleEnvHook; - if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; - fi; - if [[ -d "$1/lib" ]]; then - local -a glob=($1/lib/lib*); - if [ "${#glob[*]}" -gt 0 ]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib"; - fi; - fi -} -nixLog () -{ - - [[ -z ${NIX_LOG_FD-} ]] && return 0; - local callerName="${FUNCNAME[1]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" -} -activatePackage () -{ - - local pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - if [ -f "$pkg" ]; then - nixTalkativeLog "sourcing setup hook '$pkg'"; - source "$pkg"; - fi; - if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then - addToSearchPath _PATH "$pkg/bin"; - fi; - if (( hostOffset <= -1 )); then - addToSearchPath _XDG_DATA_DIRS "$pkg/share"; - fi; - if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then - addToSearchPath _HOST_PATH "$pkg/bin"; - fi; - if [[ -f "$pkg/nix-support/setup-hook" ]]; then - nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; - source "$pkg/nix-support/setup-hook"; - fi -} -getTargetRoleWrapper () -{ - - case $targetOffset in - -1) - export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 - ;; - 0) - export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 - ;; - 1) - export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 - ;; - *) - echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -echoCmd () -{ - - printf "%s:" "$1"; - shift; - printf ' %q' "$@"; - echo -} -showPhaseHeader () -{ - - local phase="$1"; - echo "Running phase: $phase"; - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" -} -substituteAllInPlace () -{ - - local fileName="$1"; - shift; - substituteAll "$fileName" "$fileName" "$@" -} -unpackFile () -{ - - curSrc="$1"; - echo "unpacking source archive $curSrc"; - if ! runOneHook unpackCmd "$curSrc"; then - echo "do not know how to unpack source archive $curSrc"; - exit 1; - fi -} -_nixLogWithLevel () -{ - - [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; - local logLevel; - case "${1:?}" in - 0) - logLevel=ERROR - ;; - 1) - logLevel=WARN - ;; - 2) - logLevel=NOTICE - ;; - 3) - logLevel=INFO - ;; - 4) - logLevel=TALKATIVE - ;; - 5) - logLevel=CHATTY - ;; - 6) - logLevel=DEBUG - ;; - 7) - logLevel=VOMIT - ;; - *) - echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; - return 1 - ;; - esac; - local callerName="${FUNCNAME[2]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" -} -showPhaseFooter () -{ - - local phase="$1"; - local startTime="$2"; - local endTime="$3"; - local delta=$(( endTime - startTime )); - (( delta < 30 )) && return; - local H=$((delta/3600)); - local M=$((delta%3600/60)); - local S=$((delta%60)); - echo -n "$phase completed in "; - (( H > 0 )) && echo -n "$H hours "; - (( M > 0 )) && echo -n "$M minutes "; - echo "$S seconds" -} -_addRpathPrefix () -{ - - if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then - export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; - fi -} -unpackPhase () -{ - - runHook preUnpack; - if [ -z "${srcs:-}" ]; then - if [ -z "${src:-}" ]; then - echo 'variable $src or $srcs should point to the source'; - exit 1; - fi; - srcs="$src"; - fi; - local -a srcsArray; - concatTo srcsArray srcs; - local dirsBefore=""; - for i in *; - do - if [ -d "$i" ]; then - dirsBefore="$dirsBefore $i "; - fi; - done; - for i in "${srcsArray[@]}"; - do - unpackFile "$i"; - done; - : "${sourceRoot=}"; - if [ -n "${setSourceRoot:-}" ]; then - runOneHook setSourceRoot; - else - if [ -z "$sourceRoot" ]; then - for i in *; - do - if [ -d "$i" ]; then - case $dirsBefore in - *\ $i\ *) - - ;; - *) - if [ -n "$sourceRoot" ]; then - echo "unpacker produced multiple directories"; - exit 1; - fi; - sourceRoot="$i" - ;; - esac; - fi; - done; - fi; - fi; - if [ -z "$sourceRoot" ]; then - echo "unpacker appears to have produced no directories"; - exit 1; - fi; - echo "source root is $sourceRoot"; - if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then - chmod -R u+w -- "$sourceRoot"; - fi; - runHook postUnpack -} -sysconfigdataHook () -{ - - if [ "$1" = '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' ]; then - export _PYTHON_HOST_PLATFORM='linux-x86_64'; - export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; - fi -} -_moveSbin () -{ - - if [ "${dontMoveSbin-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then - return; - fi; - echo "moving $prefix/sbin/* to $prefix/bin"; - mkdir -p $prefix/bin; - shopt -s dotglob; - for i in $prefix/sbin/*; - do - mv "$i" $prefix/bin; - done; - shopt -u dotglob; - rmdir $prefix/sbin; - ln -s bin $prefix/sbin -} -addEnvHooks () -{ - - local depHostOffset="$1"; - shift; - local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; - local pkgHookVar; - for pkgHookVar in "${!pkgHookVarsSlice}"; - do - eval "${pkgHookVar}s"'+=("$@")'; - done -} -addToSearchPath () -{ - - addToSearchPathWithCustomDelimiter ":" "$@" -} -dumpVars () -{ - - if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then - local old_umask; - old_umask=$(umask); - umask 0077; - export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; - umask "$old_umask"; - fi -} -isMachO () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then - return 0; - else - return 1; - fi; - fi; - fi -} -nixChattyLog () -{ - - _nixLogWithLevel 5 "$*" -} -_multioutDocs () -{ - - local REMOVE=REMOVE; - moveToOutput share/info "${!outputInfo}"; - moveToOutput share/doc "${!outputDoc}"; - moveToOutput share/gtk-doc "${!outputDevdoc}"; - moveToOutput share/devhelp/books "${!outputDevdoc}"; - moveToOutput share/man "${!outputMan}"; - moveToOutput share/man/man3 "${!outputDevman}" -} -buildPhase () -{ - - runHook preBuild; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom buildPhase, doing nothing"; - else - foundMakefile=1; - local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; - echoCmd 'build flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postBuild -} -getRole () -{ - - case $1 in - -1) - role_post='_FOR_BUILD' - ;; - 0) - role_post='' - ;; - 1) - role_post='_FOR_TARGET' - ;; - *) - echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -distPhase () -{ - - runHook preDist; - local flagsArray=(); - concatTo flagsArray distFlags distFlagsArray distTarget=dist; - echo 'dist flags: %q' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - if [ "${dontCopyDist:-0}" != 1 ]; then - mkdir -p "$out/tarballs"; - cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; - fi; - runHook postDist -} -findInputs () -{ - - local -r pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - local varVar="${pkgAccumVarVars[hostOffset + 1]}"; - local varRef="$varVar[$((targetOffset - hostOffset))]"; - local var="${!varRef}"; - unset -v varVar varRef; - local varSlice="$var[*]"; - case " ${!varSlice-} " in - *" $pkg "*) - return 0 - ;; - esac; - unset -v varSlice; - eval "$var"'+=("$pkg")'; - if ! [ -e "$pkg" ]; then - echo "build input $pkg does not exist" 1>&2; - exit 1; - fi; - function mapOffset () - { - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi - }; - local relHostOffset; - for relHostOffset in "${allPlatOffsets[@]}"; - do - local files="${propagatedDepFilesVars[relHostOffset + 1]}"; - local hostOffsetNext; - mapOffset "$relHostOffset" hostOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - local relTargetOffset; - for relTargetOffset in "${allPlatOffsets[@]}"; - do - (( "$relHostOffset" <= "$relTargetOffset" )) || continue; - local fileRef="${files}[$relTargetOffset - $relHostOffset]"; - local file="${!fileRef}"; - unset -v fileRef; - local targetOffsetNext; - mapOffset "$relTargetOffset" targetOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - [[ -f "$pkg/nix-support/$file" ]] || continue; - local pkgNext; - read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; - for pkgNext in $pkgNext; - do - findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; - done; - done; - done -} -_logHook () -{ - - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - local hookKind="$1"; - local hookExpr="$2"; - shift 2; - if declare -F "$hookExpr" > /dev/null 2>&1; then - nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; - else - if type -p "$hookExpr" > /dev/null; then - nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; - else - if [[ "$hookExpr" != "_callImplicitHook"* ]]; then - local exprToOutput; - if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then - exprToOutput="$hookExpr"; - else - local hookExprLine; - while IFS= read -r hookExprLine; do - hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; - if [[ -n "$hookExprLine" ]]; then - exprToOutput+="$hookExprLine\\n "; - fi; - done <<< "$hookExpr"; - exprToOutput="${exprToOutput%%\\n }"; - fi; - nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; - fi; - fi; - fi -} -_moveSystemdUserUnits () -{ - - if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then - return; - fi; - if [ ! -e "${prefix:?}/lib/systemd/user" ]; then - return; - fi; - local source="$prefix/lib/systemd/user"; - local target="$prefix/share/systemd/user"; - echo "moving $source/* to $target"; - mkdir -p "$target"; - ( shopt -s dotglob; - for i in "$source"/*; - do - mv "$i" "$target"; - done ); - rmdir "$source"; - ln -s "$target" "$source" -} -PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" -XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" - -eval "${shellHook:-}" -shopt -s expand_aliases - -exec /tmp/devenv-envtCMOZO/script \ No newline at end of file diff --git a/.devenv/shell-71ddd0fa90f49aae.sh b/.devenv/shell-71ddd0fa90f49aae.sh deleted file mode 100755 index 53ce09650..000000000 --- a/.devenv/shell-71ddd0fa90f49aae.sh +++ /dev/null @@ -1,2313 +0,0 @@ -if [ -n "$PS1" ] && [ -e $HOME/.bashrc ]; then - source $HOME/.bashrc; -fi - -shopt -u expand_aliases -PATH=${PATH:-} -nix_saved_PATH="$PATH" -XDG_DATA_DIRS=${XDG_DATA_DIRS:-} -nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" -declare -a envHostTargetHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -SOURCE_DATE_EPOCH='315532800' -export SOURCE_DATE_EPOCH -mesonFlags='' -export mesonFlags -declare -a pkgsHostTarget=() -_PYTHON_HOST_PLATFORM='linux-x86_64' -export _PYTHON_HOST_PLATFORM -shell='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export shell -prefix='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' -HOST_PATH='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' -export HOST_PATH -propagatedNativeBuildInputs='' -export propagatedNativeBuildInputs -XDG_DATA_DIRS='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/share:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/share:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/share:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/share:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/share:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/share:/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/share:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/share:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/share:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/share:/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/share:/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26/share:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/share:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share:/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/share:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/share:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/share:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/share:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/share' -export XDG_DATA_DIRS -outputBin='out' -declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) -outputInclude='out' -cmakeFlags='' -export cmakeFlags -GOROOT='/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share/go/' -export GOROOT -outputLib='out' -depsBuildTargetPropagated='' -export depsBuildTargetPropagated -hardeningDisable='' -export hardeningDisable -name='devenv-shell-env' -export name -DEVENV_TASK_FILE='/nix/store/67gwkyrn8qfd381zka7lgr23bm2d2v2a-tasks.json' -export DEVENV_TASK_FILE -LD='ld' -export LD -CC='gcc' -export CC -NIX_CFLAGS_COMPILE=' -frandom-seed=86aa67916d -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include' -export NIX_CFLAGS_COMPILE -NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -OPTERR='1' -DEVENV_RUNTIME='/run/user/1000/devenv-303d476' -export DEVENV_RUNTIME -PKG_CONFIG_PATH='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/lib/pkgconfig:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/pkgconfig:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/lib/pkgconfig:/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/lib/pkgconfig:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/lib/pkgconfig:/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/lib/pkgconfig:/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/lib/pkgconfig:/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/lib/pkgconfig:/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/lib/pkgconfig:/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/lib/pkgconfig:/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/lib/pkgconfig:/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/lib/pkgconfig:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share/pkgconfig:/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/lib/pkgconfig:/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/lib/pkgconfig' -export PKG_CONFIG_PATH -dontAddDisableDepTrack='1' -export dontAddDisableDepTrack -declare -a envHostHostHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -DEVENV_ROOT='/home/karim/Dev/DevOps-Intro' -export DEVENV_ROOT -pkg='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' -depsBuildBuild='' -export depsBuildBuild -NIX_STORE='/nix/store' -export NIX_STORE -preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' -BASH='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -LINENO='79' -RANLIB='ranlib' -export RANLIB -depsBuildBuildPropagated='' -export depsBuildBuildPropagated -nativeBuildInputs='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev /nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2 /nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1 /nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0 /nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0 /nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0 /nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1 /nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0 /nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22 /nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1 /nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0 /nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12 /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev /nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0 /nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' -export nativeBuildInputs -HOSTTYPE='x86_64' -stdenv='/nix/store/w708nqm6lvvikrq8d3x45g96hzfij0r8-stdenv-linux' -export stdenv -SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export SHELL -NM='nm' -export NM -configureFlags='' -export configureFlags -doCheck='' -export doCheck -depsBuildTarget='' -export depsBuildTarget -outputDoc='out' -depsTargetTargetPropagated='' -export depsTargetTargetPropagated -NIX_HARDENING_ENABLE='bindnow format fortify fortify3 libcxxhardeningfast pic relro stackclashprotection stackprotector strictflexarrays1 strictoverflow zerocallusedregs' -export NIX_HARDENING_ENABLE -declare -a envBuildHostHooks=('addPythonPath' 'sysconfigdataHook' ) -DEVENV_STATE='/home/karim/Dev/DevOps-Intro/.devenv/state' -export DEVENV_STATE -declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) -builder='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export builder -DEVENV_TASKS='' -export DEVENV_TASKS -NIX_CC='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' -export NIX_CC -system='x86_64-linux' -export system -PKG_CONFIG='pkg-config' -export PKG_CONFIG -declare -a preConfigureHooks=('_multioutConfig' ) -CONFIG_SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export CONFIG_SHELL -DETERMINISTIC_BUILD='1' -export DETERMINISTIC_BUILD -defaultNativeBuildInputs='/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2 /nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' -initialPath='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10 /nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0 /nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12 /nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9 /nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12 /nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0 /nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35 /nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14 /nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin /nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1 /nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9 /nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8 /nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin /nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45' -declare -a envBuildBuildHooks=('addPythonPath' 'sysconfigdataHook' ) -declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) -declare -a pkgsBuildBuild=() -doInstallCheck='' -export doInstallCheck -_substituteStream_has_warned_replace_deprecation='false' -GOPATH='/home/karim/Dev/DevOps-Intro/.devenv/state/go' -export GOPATH -GOTOOLDIR='/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin' -export GOTOOLDIR -PYTHONNOUSERSITE='1' -export PYTHONNOUSERSITE -outputDevdoc='REMOVE' -propagatedBuildInputs='' -export propagatedBuildInputs -out='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' -export out -AS='as' -export AS -PYTHONHASHSEED='0' -export PYTHONHASHSEED -NIX_BUILD_CORES='4' -export NIX_BUILD_CORES -NIX_BINTOOLS='/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' -export NIX_BINTOOLS -PATH='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/bin:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/bin:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/bin:/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin:/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0/bin:/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0/bin:/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1/bin:/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0/bin:/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22/bin:/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1/bin:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/bin:/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1/bin:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/bin:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/bin:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/bin:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/bin:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/bin:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/bin:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/bin:/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin/bin:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/bin:/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin/bin:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/bin:/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin/bin:/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin/bin:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/bin:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/bin:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/bin:/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0/bin:/nix/store/sanx9fg8mry8mq92zhlm5qvb83qlxrlx-gcc-15.2.0/bin:/nix/store/pf30k3mg7n6bibc1k6609gyq7glk00k2-glibc-2.42-61-bin/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46/bin:/nix/store/p2vkw5s89ff1fs2d2rxqxiqil9s0jpcm-binutils-2.46/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' -export PATH -declare -a pkgsHostHost=() -declare -a unpackCmdHooks=('_defaultUnpack' ) -declare -a envTargetTargetHooks=() -CXX='g++' -export CXX -IN_NIX_SHELL='impure' -export IN_NIX_SHELL -outputDev='out' -buildPhase='{ echo "------------------------------------------------------------"; - echo " WARNING: the existence of this path is not guaranteed."; - echo " It is an internal implementation detail for pkgs.mkShell."; - echo "------------------------------------------------------------"; - echo; - # Record all build inputs as runtime dependencies - export; -} >> "$out" -' -export buildPhase -__structuredAttrs='' -export __structuredAttrs -OLDPWD='' -export OLDPWD -STRINGS='strings' -export STRINGS -READELF='readelf' -export READELF -SIZE='size' -export SIZE -outputDevman='out' -OBJDUMP='objdump' -export OBJDUMP -NIX_NO_SELF_RPATH='1' -shellHook=' -export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}" - - -# Override temp directories that stdenv set to NIX_BUILD_TOP. -# Only reset those that still point to the Nix build dir; leave -# any user/CI-supplied value intact so child processes (e.g. -# `devenv processes wait`) compute the same runtime directory. -for var in TMP TMPDIR TEMP TEMPDIR; do - if [ -n "${!var-}" ] && [ "${!var}" = "${NIX_BUILD_TOP-}" ]; then - export "$var"=/tmp - fi -done -if [ -n "${NIX_BUILD_TOP-}" ]; then - unset NIX_BUILD_TOP -fi - -# set path to locales on non-NixOS Linux hosts -if [ -z "${LOCALE_ARCHIVE-}" ]; then - export LOCALE_ARCHIVE=/nix/store/sp7b84c2jnbskd6dm2n5splgipg9d1f0-glibc-locales-2.42-61/lib/locale/locale-archive -fi - - -# direnv helper -if [ ! type -p direnv &>/dev/null && -f .envrc ]; then - echo "An .envrc file was detected, but the direnv command is not installed." - echo "To use this configuration, please install direnv: https://direnv.net/docs/installation.html" -fi - -mkdir -p "$DEVENV_STATE" -if [ ! -L "$DEVENV_DOTFILE/profile" ] || [ "$(/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin/readlink $DEVENV_DOTFILE/profile)" != "/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile" ] -then - ln -snf /nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile "$DEVENV_DOTFILE/profile" -fi -unset HOST_PATH NIX_BUILD_CORES __structuredAttrs buildInputs buildPhase builder depsBuildBuild depsBuildBuildPropagated depsBuildTarget depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget depsTargetTargetPropagated dontAddDisableDepTrack doCheck doInstallCheck nativeBuildInputs out outputs patches phases preferLocalBuild propagatedBuildInputs propagatedNativeBuildInputs shell shellHook stdenv strictDeps - -mkdir -p /run/user/1000/devenv-303d476 -ln -snf /run/user/1000/devenv-303d476 /home/karim/Dev/DevOps-Intro/.devenv/run - - -export PATH=$GOPATH/bin:$PATH - -echo "✨ devenv 2.0.6 is out of date. Please update to 2.1.2: https://devenv.sh/getting-started/#installation" >&2 - - -# Check whether the direnv integration is out of date. -{ - if [[ ":${DIRENV_ACTIVE-}:" == *":/home/karim/Dev/DevOps-Intro:"* ]]; then - if [[ ! "${DEVENV_NO_DIRENVRC_OUTDATED_WARNING-}" == 1 && ! "${DEVENV_DIRENVRC_ROLLING_UPGRADE-}" == 1 ]]; then - if [[ ${DEVENV_DIRENVRC_VERSION:-0} -lt 2 ]]; then - direnv_line=$(grep --color=never -E "source_url.*cachix/devenv" .envrc || echo "") - - echo "✨ The direnv integration in your .envrc is out of date." - echo "" - echo -n "RECOMMENDED: devenv can now auto-upgrade the direnv integration. " - if [[ -n "$direnv_line" ]]; then - echo "To enable this feature, replace the following line in your .envrc:" - echo "" - echo " $direnv_line" - echo "" - echo "with:" - echo "" - echo " eval \"\$(devenv direnvrc)\"" - else - echo "To enable this feature, replace the \`source_url\` line that fetches the direnvrc integration in your .envrc with:" - echo "" - echo " eval \"$(devenv direnvrc)\"" - fi - echo "" - echo "If you prefer to continue managing the integration manually, follow the upgrade instructions at https://devenv.sh/integrations/direnv/." - echo "" - echo "To disable this message:" - echo "" - echo " Add the following environment to your .envrc before \`use devenv\`:" - echo "" - echo " export DEVENV_NO_DIRENVRC_OUTDATED_WARNING=1" - echo "" - echo " Or set the following option in your devenv configuration:" - echo "" - echo " devenv.warnOnNewVersion = false;" - echo "" - fi - fi - fi -} >&2 - -echo "── DevOps-Intro devenv ──" -go version -git --version -echo "QuickNotes: cd app && go run ." - -' -export shellHook -depsHostHost='' -export depsHostHost -STRIP='strip' -export STRIP -outputMan='out' -declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) -depsTargetTarget='' -export depsTargetTarget -buildInputs='' -export buildInputs -IFS=' -' -defaultBuildInputs='' -MACHTYPE='x86_64-pc-linux-gnu' -GOTOOLCHAIN='local' -export GOTOOLCHAIN -NIX_LDFLAGS='-rpath /nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib' -export NIX_LDFLAGS -_PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu' -export _PYTHON_SYSCONFIGDATA_NAME -depsHostHostPropagated='' -export depsHostHostPropagated -preferLocalBuild='1' -export preferLocalBuild -declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) -declare -a envBuildTargetHooks=('addPythonPath' 'sysconfigdataHook' ) -phases='buildPhase' -export phases -outputInfo='out' -PS4='+ ' -declare -a pkgsTargetTarget=() -patches='' -export patches -NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -outputs='out' -export outputs -NIX_ENFORCE_NO_NATIVE='1' -export NIX_ENFORCE_NO_NATIVE -OSTYPE='linux-gnu' -DEVENV_PROFILE='/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile' -export DEVENV_PROFILE -AR='ar' -export AR -declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelative' '_multioutPropagateDev' ) -declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) -OBJCOPY='objcopy' -export OBJCOPY -PYTHONPATH='/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/python3.13/site-packages' -export PYTHONPATH -DEVENV_DOTFILE='/home/karim/Dev/DevOps-Intro/.devenv' -export DEVENV_DOTFILE -declare -a pkgsBuildTarget=() -strictDeps='' -export strictDeps -declare -a pkgsBuildHost=('/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev' '/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9' '/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2' '/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1' '/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0' '/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0' '/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0' '/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1' '/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0' '/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22' '/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1' '/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0' '/nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev' '/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1' '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' '/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev' '/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev' '/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib' '/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0' '/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev' '/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib' '/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1' '/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev' '/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib' '/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1' '/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev' '/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0' '/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev' '/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0' '/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev' '/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin' '/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8' '/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev' '/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin' '/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1' '/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev' '/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26' '/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5' '/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev' '/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1' '/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev' '/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2' '/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev' '/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin' '/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7' '/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin' '/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0' '/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev' '/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin' '/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1' '/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0' '/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' '/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2' '/nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' '/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' ) -concatStringsSep () -{ - - local sep="$1"; - local name="$2"; - local type oldifs; - if type=$(declare -p "$name" 2> /dev/null); then - local -n nameref="$name"; - case "${type#* }" in - -A*) - echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; - return 1 - ;; - -a*) - local IFS="$(printf '\036')" - ;; - *) - local IFS=" " - ;; - esac; - local ifs_separated="${nameref[*]}"; - echo -n "${ifs_separated//"$IFS"/"$sep"}"; - fi -} -nixNoticeLog () -{ - - _nixLogWithLevel 2 "$*" -} -nixVomitLog () -{ - - _nixLogWithLevel 7 "$*" -} -findInputs () -{ - - local -r pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - local varVar="${pkgAccumVarVars[hostOffset + 1]}"; - local varRef="$varVar[$((targetOffset - hostOffset))]"; - local var="${!varRef}"; - unset -v varVar varRef; - local varSlice="$var[*]"; - case " ${!varSlice-} " in - *" $pkg "*) - return 0 - ;; - esac; - unset -v varSlice; - eval "$var"'+=("$pkg")'; - if ! [ -e "$pkg" ]; then - echo "build input $pkg does not exist" 1>&2; - exit 1; - fi; - function mapOffset () - { - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi - }; - local relHostOffset; - for relHostOffset in "${allPlatOffsets[@]}"; - do - local files="${propagatedDepFilesVars[relHostOffset + 1]}"; - local hostOffsetNext; - mapOffset "$relHostOffset" hostOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - local relTargetOffset; - for relTargetOffset in "${allPlatOffsets[@]}"; - do - (( "$relHostOffset" <= "$relTargetOffset" )) || continue; - local fileRef="${files}[$relTargetOffset - $relHostOffset]"; - local file="${!fileRef}"; - unset -v fileRef; - local targetOffsetNext; - mapOffset "$relTargetOffset" targetOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - [[ -f "$pkg/nix-support/$file" ]] || continue; - local pkgNext; - read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; - for pkgNext in $pkgNext; - do - findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; - done; - done; - done -} -_moveLib64 () -{ - - if [ "${dontMoveLib64-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then - return; - fi; - echo "moving $prefix/lib64/* to $prefix/lib"; - mkdir -p $prefix/lib; - shopt -s dotglob; - for i in $prefix/lib64/*; - do - mv --no-clobber "$i" $prefix/lib; - done; - shopt -u dotglob; - rmdir $prefix/lib64; - ln -s lib $prefix/lib64 -} -_logHook () -{ - - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - local hookKind="$1"; - local hookExpr="$2"; - shift 2; - if declare -F "$hookExpr" > /dev/null 2>&1; then - nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; - else - if type -p "$hookExpr" > /dev/null; then - nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; - else - if [[ "$hookExpr" != "_callImplicitHook"* ]]; then - local exprToOutput; - if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then - exprToOutput="$hookExpr"; - else - local hookExprLine; - while IFS= read -r hookExprLine; do - hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; - if [[ -n "$hookExprLine" ]]; then - exprToOutput+="$hookExprLine\\n "; - fi; - done <<< "$hookExpr"; - exprToOutput="${exprToOutput%%\\n }"; - fi; - nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; - fi; - fi; - fi -} -_overrideFirst () -{ - - if [ -z "${!1-}" ]; then - _assignFirst "$@"; - fi -} -ccWrapper_addCVars () -{ - - local role_post; - getHostRoleEnvHook; - local found=; - if [ -d "$1/include" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; - found=1; - fi; - if [ -d "$1/Library/Frameworks" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; - found=1; - fi; - if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then - local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; - export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; - fi -} -_pruneLibtoolFiles () -{ - - if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; -} -installPhase () -{ - - runHook preInstall; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom installPhase, doing nothing"; - runHook postInstall; - return; - else - foundMakefile=1; - fi; - if [ -n "$prefix" ]; then - mkdir -p "$prefix"; - fi; - local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; - echoCmd 'install flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - runHook postInstall -} -isMachO () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then - return 0; - else - return 1; - fi; - fi; - fi -} -patchShebangsAuto () -{ - - if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then - if [[ "$output" != out && "$output" = "$outputDev" ]]; then - patchShebangs --build "$prefix"; - else - patchShebangs --host "$prefix"; - fi; - fi -} -_allFlags () -{ - - export system pname name version; - while IFS='' read -r varName; do - nixTalkativeLog "@${varName}@ -> ${!varName}"; - args+=("--subst-var" "$varName"); - done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') -} -configurePhase () -{ - - runHook preConfigure; - : "${configureScript=}"; - if [[ -z "$configureScript" && -x ./configure ]]; then - configureScript=./configure; - fi; - if [ -z "${dontFixLibtool:-}" ]; then - export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; - local i; - find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do - echo "fixing libtool script $i"; - fixLibtool "$i"; - done; - CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); - find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; - rm -f "$CONFIGURE_MTIME_REFERENCE"; - fi; - if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; - if [ "${prefixKeyOrDefault: -1}" = " " ]; then - prependToVar configureFlags "$prefix"; - prependToVar configureFlags "${prefixKeyOrDefault::-1}"; - else - prependToVar configureFlags "$prefixKeyOrDefault$prefix"; - fi; - fi; - if [[ -f "$configureScript" ]]; then - if [ -z "${dontAddDisableDepTrack:-}" ]; then - if grep -q dependency-tracking "$configureScript"; then - prependToVar configureFlags --disable-dependency-tracking; - fi; - fi; - if [ -z "${dontDisableStatic:-}" ]; then - if grep -q enable-static "$configureScript"; then - prependToVar configureFlags --disable-static; - fi; - fi; - if [ -z "${dontPatchShebangsInConfigure:-}" ]; then - patchShebangs --build "$configureScript"; - fi; - fi; - if [ -n "$configureScript" ]; then - local -a flagsArray; - concatTo flagsArray configureFlags configureFlagsArray; - echoCmd 'configure flags' "${flagsArray[@]}"; - $configureScript "${flagsArray[@]}"; - unset flagsArray; - else - echo "no configure script, doing nothing"; - fi; - runHook postConfigure -} -genericBuild () -{ - - export GZIP_NO_TIMESTAMPS=1; - if [ -f "${buildCommandPath:-}" ]; then - source "$buildCommandPath"; - return; - fi; - if [ -n "${buildCommand:-}" ]; then - eval "$buildCommand"; - return; - fi; - definePhases; - for curPhase in ${phases[*]}; - do - runPhase "$curPhase"; - done -} -nixWarnLog () -{ - - _nixLogWithLevel 1 "$*" -} -getTargetRoleEnvHook () -{ - - getRole "$depTargetOffset" -} -recordPropagatedDependencies () -{ - - declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); - declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); - local propagatedInputsIndex; - for propagatedInputsIndex in "${!flatVars[@]}"; - do - local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; - local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; - [[ -n "${!propagatedInputsSlice}" ]] || continue; - mkdir -p "${!outputDev}/nix-support"; - printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; - done -} -toPythonPath () -{ - - local paths="$1"; - local result=; - for i in $paths; - do - p="$i/lib/python3.13/site-packages"; - result="${result}${result:+:}$p"; - done; - echo $result -} -showPhaseHeader () -{ - - local phase="$1"; - echo "Running phase: $phase"; - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" -} -checkPhase () -{ - - runHook preCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom checkPhase, doing nothing"; - runHook postCheck; - return; - fi; - if [[ -z "${checkTarget:-}" ]]; then - if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then - checkTarget="check"; - else - if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then - checkTarget="test"; - fi; - fi; - fi; - if [[ -z "${checkTarget:-}" ]]; then - echo "no check/test target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; - echoCmd 'check flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postCheck -} -substituteAllStream () -{ - - local -a args=(); - _allFlags; - substituteStream "$1" "$2" "${args[@]}" -} -_addToEnv () -{ - - local depHostOffset depTargetOffset; - local pkg; - for depHostOffset in "${allPlatOffsets[@]}"; - do - local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; - local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; - for depTargetOffset in "${allPlatOffsets[@]}"; - do - (( depHostOffset <= depTargetOffset )) || continue; - local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; - if [[ -z "${strictDeps-}" ]]; then - local visitedPkgs=""; - for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; - do - if [[ "$visitedPkgs" = *"$pkg"* ]]; then - continue; - fi; - runHook "${!hookRef}" "$pkg"; - visitedPkgs+=" $pkg"; - done; - else - local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - runHook "${!hookRef}" "$pkg"; - done; - fi; - done; - done -} -_assignFirst () -{ - - local varName="$1"; - local _var; - local REMOVE=REMOVE; - shift; - for _var in "$@"; - do - if [ -n "${!_var-}" ]; then - eval "${varName}"="${_var}"; - return; - fi; - done; - echo; - echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; - echo " The following variables were all unset or empty:"; - echo " $*"; - if [ -z "${out:-}" ]; then - echo ' If you do not want an "out" output in your derivation, make sure to define'; - echo ' the other specific required outputs. This can be achieved by picking one'; - echo " of the above as an output."; - echo ' You do not have to remove "out" if you want to have a different default'; - echo ' output, because the first output is taken as a default.'; - echo; - fi; - return 1 -} -stripDirs () -{ - - local cmd="$1"; - local ranlibCmd="$2"; - local paths="$3"; - local stripFlags="$4"; - local excludeFlags=(); - local pathsNew=; - [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; - [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; - local pattern; - if [ -n "${stripExclude:-}" ]; then - for pattern in "${stripExclude[@]}"; - do - excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); - done; - fi; - local p; - for p in ${paths}; - do - if [ -e "$prefix/$p" ]; then - pathsNew="${pathsNew} $prefix/$p"; - fi; - done; - paths=${pathsNew}; - if [ -n "${paths}" ]; then - echo "stripping (with command $cmd and flags $stripFlags) in $paths"; - local striperr; - striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; - find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; - [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); - rm "$striperr"; - find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; - fi -} -substituteAll () -{ - - local input="$1"; - local output="$2"; - local -a args=(); - _allFlags; - substitute "$input" "$output" "${args[@]}" -} -installCheckPhase () -{ - - runHook preInstallCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom installCheckPhase, doing nothing"; - else - if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then - echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; - echoCmd 'installcheck flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - fi; - runHook postInstallCheck -} -sysconfigdataHook () -{ - - if [ "$1" = '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' ]; then - export _PYTHON_HOST_PLATFORM='linux-x86_64'; - export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; - fi -} -printWords () -{ - - (( "$#" > 0 )) || return 0; - printf '%s ' "$@" -} -definePhases () -{ - - if [ -z "${phases[*]:-}" ]; then - phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; - fi -} -printLines () -{ - - (( "$#" > 0 )) || return 0; - printf '%s\n' "$@" -} -addEnvHooks () -{ - - local depHostOffset="$1"; - shift; - local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; - local pkgHookVar; - for pkgHookVar in "${!pkgHookVarsSlice}"; - do - eval "${pkgHookVar}s"'+=("$@")'; - done -} -updateAutotoolsGnuConfigScriptsPhase () -{ - - if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then - return; - fi; - for script in config.sub config.guess; - do - for f in $(find . -type f -name "$script"); - do - echo "Updating Autotools / GNU config script to a newer upstream version: $f"; - cp -f "/nix/store/kppfbp4x7mhfz1q5zswavxxxq71v2f7c-gnu-config-2024-01-01/$script" "$f"; - done; - done -} -_multioutDocs () -{ - - local REMOVE=REMOVE; - moveToOutput share/info "${!outputInfo}"; - moveToOutput share/doc "${!outputDoc}"; - moveToOutput share/gtk-doc "${!outputDevdoc}"; - moveToOutput share/devhelp/books "${!outputDevdoc}"; - moveToOutput share/man "${!outputMan}"; - moveToOutput share/man/man3 "${!outputDevman}" -} -addToSearchPath () -{ - - addToSearchPathWithCustomDelimiter ":" "$@" -} -_defaultUnpack () -{ - - local fn="$1"; - local destination; - if [ -d "$fn" ]; then - destination="$(stripHash "$fn")"; - if [ -e "$destination" ]; then - echo "Cannot copy $fn to $destination: destination already exists!"; - echo "Did you specify two \"srcs\" with the same \"name\"?"; - return 1; - fi; - cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; - else - case "$fn" in - *.tar.xz | *.tar.lzma | *.txz) - ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; - true ) | tar xf - --mode=+w --warning=no-timestamp - ;; - *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) - tar xf "$fn" --mode=+w --warning=no-timestamp - ;; - *) - return 1 - ;; - esac; - fi -} -_doStrip () -{ - - local -ra flags=(dontStripHost dontStripTarget); - local -ra debugDirs=(stripDebugList stripDebugListTarget); - local -ra allDirs=(stripAllList stripAllListTarget); - local -ra stripCmds=(STRIP STRIP_FOR_TARGET); - local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); - stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; - stripDebugListTarget=${stripDebugListTarget[*]:-}; - stripAllList=${stripAllList[*]:-}; - stripAllListTarget=${stripAllListTarget[*]:-}; - local i; - for i in ${!stripCmds[@]}; - do - local -n flag="${flags[$i]}"; - local -n debugDirList="${debugDirs[$i]}"; - local -n allDirList="${allDirs[$i]}"; - local -n stripCmd="${stripCmds[$i]}"; - local -n ranlibCmd="${ranlibCmds[$i]}"; - if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then - continue; - fi; - stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; - stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; - done -} -appendToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=(${nameref+"${nameref[@]}"} "$@"); - else - nameref="${nameref-} $*"; - fi -} -getTargetRoleWrapper () -{ - - case $targetOffset in - -1) - export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 - ;; - 0) - export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 - ;; - 1) - export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 - ;; - *) - echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -_moveSbin () -{ - - if [ "${dontMoveSbin-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then - return; - fi; - echo "moving $prefix/sbin/* to $prefix/bin"; - mkdir -p $prefix/bin; - shopt -s dotglob; - for i in $prefix/sbin/*; - do - mv "$i" $prefix/bin; - done; - shopt -u dotglob; - rmdir $prefix/sbin; - ln -s bin $prefix/sbin -} -_multioutDevs () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then - return; - fi; - moveToOutput include "${!outputInclude}"; - moveToOutput lib/pkgconfig "${!outputDev}"; - moveToOutput share/pkgconfig "${!outputDev}"; - moveToOutput lib/cmake "${!outputDev}"; - moveToOutput share/aclocal "${!outputDev}"; - for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; - do - echo "Patching '$f' includedir to output ${!outputInclude}"; - sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; - done -} -getHostRoleEnvHook () -{ - - getRole "$depHostOffset" -} -nixDebugLog () -{ - - _nixLogWithLevel 6 "$*" -} -_makeSymlinksRelative () -{ - - local prefixes; - prefixes=(); - for output in $(getAllOutputNames); - do - [ ! -e "${!output}" ] && continue; - prefixes+=("${!output}"); - done; - find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' - output="$1" - link="$2" - - linkTarget=$(readlink "$link") - - # only touch links that point inside the same output tree - [[ $linkTarget == "$output"/* ]] || exit 0 - - if [ ! -e "$linkTarget" ]; then - echo "the symlink $link is broken, it points to $linkTarget (which is missing)" - fi - - echo "making symlink relative: $link" - ln -snrf "$linkTarget" "$link" - ' _ -} -auditTmpdir () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "checking for references to $TMPDIR/ in $dir..."; - local tmpdir elf_fifo script_fifo; - tmpdir="$(mktemp -d)"; - elf_fifo="$tmpdir/elf"; - script_fifo="$tmpdir/script"; - mkfifo "$elf_fifo" "$script_fifo"; - ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do - if isELF "$file"; then - printf '%s\0' "$file" 1>&3; - else - if isScript "$file"; then - filename=${file##*/}; - dir=${file%/*}; - if [ -e "$dir/.$filename-wrapped" ]; then - printf '%s\0' "$file" 1>&4; - fi; - fi; - fi; - done; - exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then - echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$elf_fifo" ) & local pid_elf=$!; - local pid_script; - ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if grep -q -F "$TMPDIR/" "$1"; then - echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$script_fifo" ) & local pid_script=$!; - wait "$pid_elf" || { - echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - wait "$pid_script" || { - echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - rm -r "$tmpdir" -} -pkgConfigWrapper_addPkgConfigPath () -{ - - local role_post; - getHostRoleEnvHook; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" -} -_activatePkgs () -{ - - local hostOffset targetOffset; - local pkg; - for hostOffset in "${allPlatOffsets[@]}"; - do - local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; - for targetOffset in "${allPlatOffsets[@]}"; - do - (( hostOffset <= targetOffset )) || continue; - local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - activatePackage "$pkg" "$hostOffset" "$targetOffset"; - done; - done; - done -} -activatePackage () -{ - - local pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - if [ -f "$pkg" ]; then - nixTalkativeLog "sourcing setup hook '$pkg'"; - source "$pkg"; - fi; - if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then - addToSearchPath _PATH "$pkg/bin"; - fi; - if (( hostOffset <= -1 )); then - addToSearchPath _XDG_DATA_DIRS "$pkg/share"; - fi; - if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then - addToSearchPath _HOST_PATH "$pkg/bin"; - fi; - if [[ -f "$pkg/nix-support/setup-hook" ]]; then - nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; - source "$pkg/nix-support/setup-hook"; - fi -} -exitHandler () -{ - - exitCode="$?"; - set +e; - if [ -n "${showBuildStats:-}" ]; then - read -r -d '' -a buildTimes < <(times); - echo "build times:"; - echo "user time for the shell ${buildTimes[0]}"; - echo "system time for the shell ${buildTimes[1]}"; - echo "user time for all child processes ${buildTimes[2]}"; - echo "system time for all child processes ${buildTimes[3]}"; - fi; - if (( "$exitCode" != 0 )); then - runHook failureHook; - if [ -n "${succeedOnFailure:-}" ]; then - echo "build failed with exit code $exitCode (ignored)"; - mkdir -p "$out/nix-support"; - printf "%s" "$exitCode" > "$out/nix-support/failed"; - exit 0; - fi; - else - runHook exitHook; - fi; - return "$exitCode" -} -dumpVars () -{ - - if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then - local old_umask; - old_umask=$(umask); - umask 0077; - export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; - umask "$old_umask"; - fi -} -isELF () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [ "$magic" = 'ELF' ]; then - return 0; - else - return 1; - fi -} -_moveToShare () -{ - - if [ -n "$__structuredAttrs" ]; then - if [ -z "${forceShare-}" ]; then - forceShare=(man doc info); - fi; - else - forceShare=(${forceShare:-man doc info}); - fi; - if [[ -z "$out" ]]; then - return; - fi; - for d in "${forceShare[@]}"; - do - if [ -d "$out/$d" ]; then - if [ -d "$out/share/$d" ]; then - echo "both $d/ and share/$d/ exist!"; - else - echo "moving $out/$d to $out/share/$d"; - mkdir -p $out/share; - mv $out/$d $out/share/; - fi; - fi; - done -} -prependToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=("$@" ${nameref+"${nameref[@]}"}); - else - nameref="$* ${nameref-}"; - fi -} -stripHash () -{ - - local strippedName casematchOpt=0; - strippedName="$(basename -- "$1")"; - shopt -q nocasematch && casematchOpt=1; - shopt -u nocasematch; - if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then - echo "${strippedName:33}"; - else - echo "$strippedName"; - fi; - if (( casematchOpt )); then - shopt -s nocasematch; - fi -} -substitute () -{ - - local input="$1"; - local output="$2"; - shift 2; - if [ ! -f "$input" ]; then - echo "substitute(): ERROR: file '$input' does not exist" 1>&2; - return 1; - fi; - local content; - consumeEntire content < "$input"; - if [ -e "$output" ]; then - chmod +w "$output"; - fi; - substituteStream content "file '$input'" "$@" > "$output" -} -substituteInPlace () -{ - - local -a fileNames=(); - for arg in "$@"; - do - if [[ "$arg" = "--"* ]]; then - break; - fi; - fileNames+=("$arg"); - shift; - done; - if ! [[ "${#fileNames[@]}" -gt 0 ]]; then - echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; - return 1; - fi; - for file in "${fileNames[@]}"; - do - substitute "$file" "$file" "$@"; - done -} -showPhaseFooter () -{ - - local phase="$1"; - local startTime="$2"; - local endTime="$3"; - local delta=$(( endTime - startTime )); - (( delta < 30 )) && return; - local H=$((delta/3600)); - local M=$((delta%3600/60)); - local S=$((delta%60)); - echo -n "$phase completed in "; - (( H > 0 )) && echo -n "$H hours "; - (( M > 0 )) && echo -n "$M minutes "; - echo "$S seconds" -} -unpackPhase () -{ - - runHook preUnpack; - if [ -z "${srcs:-}" ]; then - if [ -z "${src:-}" ]; then - echo 'variable $src or $srcs should point to the source'; - exit 1; - fi; - srcs="$src"; - fi; - local -a srcsArray; - concatTo srcsArray srcs; - local dirsBefore=""; - for i in *; - do - if [ -d "$i" ]; then - dirsBefore="$dirsBefore $i "; - fi; - done; - for i in "${srcsArray[@]}"; - do - unpackFile "$i"; - done; - : "${sourceRoot=}"; - if [ -n "${setSourceRoot:-}" ]; then - runOneHook setSourceRoot; - else - if [ -z "$sourceRoot" ]; then - for i in *; - do - if [ -d "$i" ]; then - case $dirsBefore in - *\ $i\ *) - - ;; - *) - if [ -n "$sourceRoot" ]; then - echo "unpacker produced multiple directories"; - exit 1; - fi; - sourceRoot="$i" - ;; - esac; - fi; - done; - fi; - fi; - if [ -z "$sourceRoot" ]; then - echo "unpacker appears to have produced no directories"; - exit 1; - fi; - echo "source root is $sourceRoot"; - if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then - chmod -R u+w -- "$sourceRoot"; - fi; - runHook postUnpack -} -concatTo () -{ - - local -; - set -o noglob; - local -n targetref="$1"; - shift; - local arg default name type; - for arg in "$@"; - do - IFS="=" read -r name default <<< "$arg"; - local -n nameref="$name"; - if [[ -z "${nameref[*]}" && -n "$default" ]]; then - targetref+=("$default"); - else - if type=$(declare -p "$name" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; - return 1 - ;; - -a*) - targetref+=("${nameref[@]}") - ;; - *) - if [[ "$name" = *"Array" ]]; then - nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; - targetref+=(${nameref+"${nameref[@]}"}); - else - targetref+=(${nameref-}); - fi - ;; - esac; - fi; - fi; - done -} -runOneHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook ret=1; - for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - if _eval "$hook" "$@"; then - ret=0; - break; - fi; - done; - return "$ret" -} -_multioutPropagateDev () -{ - - if [ "$(getAllOutputNames)" = "out" ]; then - return; - fi; - local outputFirst; - for outputFirst in $(getAllOutputNames); - do - break; - done; - local propagaterOutput="$outputDev"; - if [ -z "$propagaterOutput" ]; then - propagaterOutput="$outputFirst"; - fi; - if [ -z "${propagatedBuildOutputs+1}" ]; then - local po_dirty="$outputBin $outputInclude $outputLib"; - set +o pipefail; - propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; - set -o pipefail; - fi; - if [ -z "$propagatedBuildOutputs" ]; then - return; - fi; - mkdir -p "${!propagaterOutput}"/nix-support; - for output in $propagatedBuildOutputs; - do - echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; - done -} -isScript () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 2 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" =~ \#! ]]; then - return 0; - else - return 1; - fi -} -substituteStream () -{ - - local var=$1; - local description=$2; - shift 2; - while (( "$#" )); do - local replace_mode="$1"; - case "$1" in - --replace) - if ! "$_substituteStream_has_warned_replace_deprecation"; then - echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; - _substituteStream_has_warned_replace_deprecation=true; - fi; - replace_mode='--replace-warn' - ;& - --replace-quiet | --replace-warn | --replace-fail) - pattern="$2"; - replacement="$3"; - shift 3; - if ! [[ "${!var}" == *"$pattern"* ]]; then - if [ "$replace_mode" == --replace-warn ]; then - printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - else - if [ "$replace_mode" == --replace-fail ]; then - printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - return 1; - fi; - fi; - fi; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var) - local varName="$2"; - shift 2; - if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then - echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; - return 1; - fi; - if [ -z ${!varName+x} ]; then - echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; - return 1; - fi; - pattern="@$varName@"; - replacement="${!varName}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var-by) - pattern="@$2@"; - replacement="$3"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - shift 3 - ;; - *) - echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; - return 1 - ;; - esac; - done; - printf "%s" "${!var}" -} -updateSourceDateEpoch () -{ - - local path="$1"; - [[ $path == -* ]] && path="./$path"; - local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); - local time="${res[0]//\.[0-9]*/}"; - local newestFile="${res[1]}"; - if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then - echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; - export SOURCE_DATE_EPOCH="$time"; - local now="$(date +%s)"; - if [ "$time" -gt $((now - 60)) ]; then - echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; - fi; - fi -} -_addRpathPrefix () -{ - - if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then - export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; - fi -} -patchPhase () -{ - - runHook prePatch; - local -a patchesArray; - concatTo patchesArray patches; - local -a flagsArray; - concatTo flagsArray patchFlags=-p1; - for i in "${patchesArray[@]}"; - do - echo "applying patch $i"; - local uncompress=cat; - case "$i" in - *.gz) - uncompress="gzip -d" - ;; - *.bz2) - uncompress="bzip2 -d" - ;; - *.xz) - uncompress="xz -d" - ;; - *.lzma) - uncompress="lzma -d" - ;; - esac; - $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; - done; - runHook postPatch -} -printPhases () -{ - - definePhases; - local phase; - for phase in ${phases[*]}; - do - printf '%s\n' "$phase"; - done -} -moveToOutput () -{ - - local patt="$1"; - local dstOut="$2"; - local output; - for output in $(getAllOutputNames); - do - if [ "${!output}" = "$dstOut" ]; then - continue; - fi; - local srcPath; - for srcPath in "${!output}"/$patt; - do - if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then - continue; - fi; - if [ "$dstOut" = REMOVE ]; then - echo "Removing $srcPath"; - rm -r "$srcPath"; - else - local dstPath="$dstOut${srcPath#${!output}}"; - echo "Moving $srcPath to $dstPath"; - if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then - rmdir "$srcPath" --ignore-fail-on-non-empty; - if [ -d "$srcPath" ]; then - mv -t "$dstPath" "$srcPath"/*; - rmdir "$srcPath"; - fi; - else - mkdir -p "$(readlink -m "$dstPath/..")"; - mv "$srcPath" "$dstPath"; - fi; - fi; - local srcParent="$(readlink -m "$srcPath/..")"; - if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then - echo "Removing empty $srcParent/ and (possibly) its parents"; - rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; - fi; - done; - done -} -runPhase () -{ - - local curPhase="$*"; - if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then - return; - fi; - if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then - return; - fi; - if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then - return; - fi; - if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then - return; - fi; - if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then - return; - fi; - if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then - return; - fi; - showPhaseHeader "$curPhase"; - dumpVars; - local startTime endTime; - startTime=$(date +"%s"); - eval "${!curPhase:-$curPhase}"; - endTime=$(date +"%s"); - showPhaseFooter "$curPhase" "$startTime" "$endTime"; - if [ "$curPhase" = unpackPhase ]; then - [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; - cd -- "${sourceRoot:-.}"; - fi -} -addPythonPath () -{ - - addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.13/site-packages -} -addToSearchPathWithCustomDelimiter () -{ - - local delimiter="$1"; - local varName="$2"; - local dir="$3"; - if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then - export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; - fi -} -patchShebangs () -{ - - local pathName; - local update=false; - while [[ $# -gt 0 ]]; do - case "$1" in - --host) - pathName=HOST_PATH; - shift - ;; - --build) - pathName=PATH; - shift - ;; - --update) - update=true; - shift - ;; - --) - shift; - break - ;; - -* | --*) - echo "Unknown option $1 supplied to patchShebangs" 1>&2; - return 1 - ;; - *) - break - ;; - esac; - done; - echo "patching script interpreter paths in $@"; - local f; - local oldPath; - local newPath; - local arg0; - local args; - local oldInterpreterLine; - local newInterpreterLine; - if [[ $# -eq 0 ]]; then - echo "No arguments supplied to patchShebangs" 1>&2; - return 0; - fi; - local f; - while IFS= read -r -d '' f; do - isScript "$f" || continue; - read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; - read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; - if [[ -z "${pathName:-}" ]]; then - if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then - pathName=HOST_PATH; - else - pathName=PATH; - fi; - fi; - if [[ "$oldPath" == *"/bin/env" ]]; then - if [[ $arg0 == "-S" ]]; then - arg0=${args%% *}; - [[ "$args" == *" "* ]] && args=${args#* } || args=; - newPath="$(PATH="${!pathName}" type -P "env" || true)"; - args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; - else - if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; - exit 1; - else - newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; - fi; - fi; - else - if [[ -z $oldPath ]]; then - oldPath="/bin/sh"; - fi; - newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; - args="$arg0 $args"; - fi; - newInterpreterLine="$newPath $args"; - newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; - if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then - if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then - echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; - escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; - timestamp=$(stat --printf "%y" "$f"); - tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); - sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; - local restoreReadOnly; - if [[ ! -w "$f" ]]; then - chmod +w "$f"; - restoreReadOnly=true; - fi; - cat "$tmpFile" > "$f"; - rm "$tmpFile"; - if [[ -n "${restoreReadOnly:-}" ]]; then - chmod -w "$f"; - fi; - touch --date "$timestamp" "$f"; - fi; - fi; - done < <(find "$@" -type f -perm -0100 -print0) -} -getTargetRole () -{ - - getRole "$targetOffset" -} -getRole () -{ - - case $1 in - -1) - role_post='_FOR_BUILD' - ;; - 0) - role_post='' - ;; - 1) - role_post='_FOR_TARGET' - ;; - *) - echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -nixLog () -{ - - [[ -z ${NIX_LOG_FD-} ]] && return 0; - local callerName="${FUNCNAME[1]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" -} -noBrokenSymlinks () -{ - - local -r output="${1:?}"; - local path; - local pathParent; - local symlinkTarget; - local -i numDanglingSymlinks=0; - local -i numReflexiveSymlinks=0; - local -i numUnreadableSymlinks=0; - if [[ ! -e $output ]]; then - nixWarnLog "skipping non-existent output $output"; - return 0; - fi; - nixInfoLog "running on $output"; - while IFS= read -r -d '' path; do - pathParent="$(dirname "$path")"; - if ! symlinkTarget="$(readlink "$path")"; then - nixErrorLog "the symlink $path is unreadable"; - numUnreadableSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget == /* ]]; then - nixInfoLog "symlink $path points to absolute target $symlinkTarget"; - else - nixInfoLog "symlink $path points to relative target $symlinkTarget"; - symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; - fi; - if [[ $symlinkTarget = "$TMPDIR"/* ]]; then - nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; - numDanglingSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then - nixInfoLog "symlink $path points outside the Nix store; ignoring"; - continue; - fi; - if [[ $path == "$symlinkTarget" ]]; then - nixErrorLog "the symlink $path is reflexive"; - numReflexiveSymlinks+=1; - else - if [[ ! -e $symlinkTarget ]]; then - nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; - numDanglingSymlinks+=1; - else - nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; - fi; - fi; - done < <(find "$output" -type l -print0); - if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then - nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; - exit 1; - fi; - return 0 -} -bintoolsWrapper_addLDVars () -{ - - local role_post; - getHostRoleEnvHook; - if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; - fi; - if [[ -d "$1/lib" ]]; then - local -a glob=($1/lib/lib*); - if [ "${#glob[*]}" -gt 0 ]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib"; - fi; - fi -} -runHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook; - for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - _eval "$hook" "$@"; - done; - return 0 -} -patchELF () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "shrinking RPATHs of ELF executables and libraries in $dir"; - local i; - while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if ! isELF "$i"; then - continue; - fi; - echo "shrinking $i"; - patchelf --shrink-rpath "$i" || true; - done < <(find "$dir" -type f -print0) -} -getHostRole () -{ - - getRole "$hostOffset" -} -_callImplicitHook () -{ - - local def="$1"; - local hookName="$2"; - if declare -F "$hookName" > /dev/null; then - nixTalkativeLog "calling implicit '$hookName' function hook"; - "$hookName"; - else - if type -p "$hookName" > /dev/null; then - nixTalkativeLog "sourcing implicit '$hookName' script hook"; - source "$hookName"; - else - if [ -n "${!hookName:-}" ]; then - nixTalkativeLog "evaling implicit '$hookName' string hook"; - eval "${!hookName}"; - else - return "$def"; - fi; - fi; - fi -} -_multioutConfig () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then - return; - fi; - if [ -z "${shareDocName:-}" ]; then - local confScript="${configureScript:-}"; - if [ -z "$confScript" ] && [ -x ./configure ]; then - confScript=./configure; - fi; - if [ -f "$confScript" ]; then - local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; - fi; - if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then - shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; - fi; - fi; - prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; - prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal -} -_moveSystemdUserUnits () -{ - - if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then - return; - fi; - if [ ! -e "${prefix:?}/lib/systemd/user" ]; then - return; - fi; - local source="$prefix/lib/systemd/user"; - local target="$prefix/share/systemd/user"; - echo "moving $source/* to $target"; - mkdir -p "$target"; - ( shopt -s dotglob; - for i in "$source"/*; - do - mv "$i" "$target"; - done ); - rmdir "$source"; - ln -s "$target" "$source" -} -echoCmd () -{ - - printf "%s:" "$1"; - shift; - printf ' %q' "$@"; - echo -} -nixInfoLog () -{ - - _nixLogWithLevel 3 "$*" -} -nixChattyLog () -{ - - _nixLogWithLevel 5 "$*" -} -buildPhase () -{ - - runHook preBuild; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom buildPhase, doing nothing"; - else - foundMakefile=1; - local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; - echoCmd 'build flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postBuild -} -_eval () -{ - - if declare -F "$1" > /dev/null 2>&1; then - "$@"; - else - eval "$1"; - fi -} -consumeEntire () -{ - - if IFS='' read -r -d '' "$1"; then - echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; - return 1; - fi -} -nixErrorLog () -{ - - _nixLogWithLevel 0 "$*" -} -substituteAllInPlace () -{ - - local fileName="$1"; - shift; - substituteAll "$fileName" "$fileName" "$@" -} -distPhase () -{ - - runHook preDist; - local flagsArray=(); - concatTo flagsArray distFlags distFlagsArray distTarget=dist; - echo 'dist flags: %q' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - if [ "${dontCopyDist:-0}" != 1 ]; then - mkdir -p "$out/tarballs"; - cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; - fi; - runHook postDist -} -fixupPhase () -{ - - local output; - for output in $(getAllOutputNames); - do - if [ -e "${!output}" ]; then - chmod -R u+w,u-s,g-s "${!output}"; - fi; - done; - runHook preFixup; - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" runHook fixupOutput; - done; - recordPropagatedDependencies; - if [ -n "${setupHook:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; - fi; - if [ -n "${setupHooks:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - local hook; - for hook in ${setupHooks[@]}; - do - local content; - consumeEntire content < "$hook"; - substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; - unset -v content; - done; - unset -v hook; - fi; - if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then - mkdir -p "${!outputBin}/nix-support"; - printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; - fi; - runHook postFixup -} -getAllOutputNames () -{ - - if [ -n "$__structuredAttrs" ]; then - echo "${!outputs[*]}"; - else - echo "$outputs"; - fi -} -unpackFile () -{ - - curSrc="$1"; - echo "unpacking source archive $curSrc"; - if ! runOneHook unpackCmd "$curSrc"; then - echo "do not know how to unpack source archive $curSrc"; - exit 1; - fi -} -_nixLogWithLevel () -{ - - [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; - local logLevel; - case "${1:?}" in - 0) - logLevel=ERROR - ;; - 1) - logLevel=WARN - ;; - 2) - logLevel=NOTICE - ;; - 3) - logLevel=INFO - ;; - 4) - logLevel=TALKATIVE - ;; - 5) - logLevel=CHATTY - ;; - 6) - logLevel=DEBUG - ;; - 7) - logLevel=VOMIT - ;; - *) - echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; - return 1 - ;; - esac; - local callerName="${FUNCNAME[2]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" -} -fixLibtool () -{ - - local search_path; - for flag in $NIX_LDFLAGS; - do - case $flag in - -L*) - search_path+=" ${flag#-L}" - ;; - esac; - done; - sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' -} -nixTalkativeLog () -{ - - _nixLogWithLevel 4 "$*" -} -noBrokenSymlinksInAllOutputs () -{ - - if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then - for output in $(getAllOutputNames); - do - noBrokenSymlinks "${!output}"; - done; - fi -} -compressManPages () -{ - - local dir="$1"; - if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then - return; - fi; - echo "gzipping man pages under $dir/share/man/"; - find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; - find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do - local target; - target="$(readlink -f "$f")"; - if [ -f "$target".gz ]; then - ln -sf "$target".gz "$f".gz && rm "$f"; - fi; - done -} -_updateSourceDateEpochFromSourceRoot () -{ - - if [ -n "$sourceRoot" ]; then - updateSourceDateEpoch "$sourceRoot"; - fi -} -mapOffset () -{ - - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi -} -PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" -XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" - -eval "${shellHook:-}" -shopt -s expand_aliases - -exec /tmp/devenv-envNaxiU5/script \ No newline at end of file diff --git a/.devenv/shell-92a0ad1c011413a7.sh b/.devenv/shell-92a0ad1c011413a7.sh deleted file mode 100755 index 8fddf6aac..000000000 --- a/.devenv/shell-92a0ad1c011413a7.sh +++ /dev/null @@ -1,2313 +0,0 @@ -if [ -n "$PS1" ] && [ -e $HOME/.bashrc ]; then - source $HOME/.bashrc; -fi - -shopt -u expand_aliases -PATH=${PATH:-} -nix_saved_PATH="$PATH" -XDG_DATA_DIRS=${XDG_DATA_DIRS:-} -nix_saved_XDG_DATA_DIRS="$XDG_DATA_DIRS" -prefix='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' -outputLib='out' -NIX_HARDENING_ENABLE='bindnow format fortify fortify3 libcxxhardeningfast pic relro stackclashprotection stackprotector strictflexarrays1 strictoverflow zerocallusedregs' -export NIX_HARDENING_ENABLE -LINENO='79' -AS='as' -export AS -PYTHONPATH='/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/python3.13/site-packages' -export PYTHONPATH -declare -a postUnpackHooks=('_updateSourceDateEpochFromSourceRoot' ) -AR='ar' -export AR -DEVENV_RUNTIME='/run/user/1000/devenv-303d476' -export DEVENV_RUNTIME -GOROOT='/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share/go/' -export GOROOT -GOTOOLCHAIN='local' -export GOTOOLCHAIN -PYTHONHASHSEED='0' -export PYTHONHASHSEED -NIX_NO_SELF_RPATH='1' -NM='nm' -export NM -_PYTHON_HOST_PLATFORM='linux-x86_64' -export _PYTHON_HOST_PLATFORM -mesonFlags='' -export mesonFlags -declare -a pkgsBuildHost=('/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev' '/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9' '/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2' '/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1' '/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0' '/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0' '/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0' '/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1' '/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0' '/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22' '/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1' '/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0' '/nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev' '/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1' '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' '/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev' '/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev' '/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib' '/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0' '/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev' '/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib' '/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1' '/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev' '/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib' '/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1' '/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev' '/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0' '/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev' '/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0' '/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev' '/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin' '/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8' '/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev' '/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin' '/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1' '/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev' '/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26' '/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5' '/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev' '/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1' '/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev' '/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2' '/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev' '/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin' '/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7' '/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin' '/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0' '/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev' '/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin' '/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1' '/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0' '/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' '/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2' '/nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook' '/nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh' '/nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh' '/nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh' '/nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh' '/nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh' '/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh' '/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh' '/nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh' '/nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh' '/nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh' '/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh' '/nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh' '/nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh' '/nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh' '/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' '/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' ) -READELF='readelf' -export READELF -DEVENV_TASKS='' -export DEVENV_TASKS -NIX_CC='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' -export NIX_CC -declare -a envBuildTargetHooks=('addPythonPath' 'sysconfigdataHook' ) -declare -a envHostHostHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -doInstallCheck='' -export doInstallCheck -CONFIG_SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export CONFIG_SHELL -IN_NIX_SHELL='impure' -export IN_NIX_SHELL -depsBuildTarget='' -export depsBuildTarget -doCheck='' -export doCheck -out='/nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env' -export out -outputInfo='out' -BASH='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -nativeBuildInputs='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev /nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2 /nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1 /nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0 /nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0 /nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0 /nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1 /nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0 /nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22 /nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1 /nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0 /nix/store/6c6l93vpax9nkk6xxznwjn3p3aybdmvs-openssh-10.3p1-dev /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12 /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev /nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0 /nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2' -export nativeBuildInputs -DETERMINISTIC_BUILD='1' -export DETERMINISTIC_BUILD -depsBuildBuild='' -export depsBuildBuild -shell='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export shell -IFS=' -' -declare -a propagatedTargetDepFiles=('propagated-target-target-deps' ) -depsTargetTargetPropagated='' -export depsTargetTargetPropagated -OBJDUMP='objdump' -export OBJDUMP -CC='gcc' -export CC -declare -a envHostTargetHooks=('pkgConfigWrapper_addPkgConfigPath' 'ccWrapper_addCVars' 'bintoolsWrapper_addLDVars' ) -depsHostHostPropagated='' -export depsHostHostPropagated -buildInputs='' -export buildInputs -declare -a envBuildHostHooks=('addPythonPath' 'sysconfigdataHook' ) -configureFlags='' -export configureFlags -defaultBuildInputs='' -outputMan='out' -propagatedNativeBuildInputs='' -export propagatedNativeBuildInputs -stdenv='/nix/store/w708nqm6lvvikrq8d3x45g96hzfij0r8-stdenv-linux' -export stdenv -PKG_CONFIG_PATH='/nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/lib/pkgconfig:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib/pkgconfig:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/lib/pkgconfig:/nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/lib/pkgconfig:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/lib/pkgconfig:/nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/lib/pkgconfig:/nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/lib/pkgconfig:/nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/lib/pkgconfig:/nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/lib/pkgconfig:/nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/lib/pkgconfig:/nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/lib/pkgconfig:/nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/lib/pkgconfig:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share/pkgconfig:/nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/lib/pkgconfig:/nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/lib/pkgconfig' -export PKG_CONFIG_PATH -NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -GOPATH='/home/karim/Dev/DevOps-Intro/.devenv/state/go' -export GOPATH -NIX_STORE='/nix/store' -export NIX_STORE -outputBin='out' -PKG_CONFIG='pkg-config' -export PKG_CONFIG -hardeningDisable='' -export hardeningDisable -SOURCE_DATE_EPOCH='315532800' -export SOURCE_DATE_EPOCH -buildPhase='{ echo "------------------------------------------------------------"; - echo " WARNING: the existence of this path is not guaranteed."; - echo " It is an internal implementation detail for pkgs.mkShell."; - echo "------------------------------------------------------------"; - echo; - # Record all build inputs as runtime dependencies - export; -} >> "$out" -' -export buildPhase -declare -a fixupOutputHooks=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi' 'if [[ -z "${noAuditTmpdir-}" && -e "$prefix" ]]; then auditTmpdir "$prefix"; fi' 'if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi' '_moveLib64' '_moveSbin' '_moveSystemdUserUnits' 'patchShebangsAuto' '_pruneLibtoolFiles' '_doStrip' ) -OBJCOPY='objcopy' -export OBJCOPY -declare -a preFixupHooks=('_moveToShare' '_multioutDocs' '_multioutDevs' ) -MACHTYPE='x86_64-pc-linux-gnu' -cmakeFlags='' -export cmakeFlags -STRINGS='strings' -export STRINGS -declare -a postFixupHooks=('noBrokenSymlinksInAllOutputs' '_makeSymlinksRelative' '_multioutPropagateDev' ) -depsHostHost='' -export depsHostHost -LD='ld' -export LD -_substituteStream_has_warned_replace_deprecation='false' -name='devenv-shell-env' -export name -declare -a envBuildBuildHooks=('addPythonPath' 'sysconfigdataHook' ) -depsBuildBuildPropagated='' -export depsBuildBuildPropagated -declare -a pkgsHostHost=() -NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_PKG_CONFIG_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -SIZE='size' -export SIZE -builder='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export builder -DEVENV_ROOT='/home/karim/Dev/DevOps-Intro' -export DEVENV_ROOT -NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu='1' -export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu -PYTHONNOUSERSITE='1' -export PYTHONNOUSERSITE -declare -a envTargetTargetHooks=() -initialPath='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10 /nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0 /nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12 /nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9 /nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12 /nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0 /nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35 /nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14 /nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin /nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1 /nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9 /nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8 /nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin /nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45' -SHELL='/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin/bash' -export SHELL -outputDev='out' -outputInclude='out' -outputs='out' -export outputs -declare -a preConfigureHooks=('_multioutConfig' ) -CXX='g++' -export CXX -HOSTTYPE='x86_64' -OPTERR='1' -DEVENV_PROFILE='/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile' -export DEVENV_PROFILE -declare -a pkgsBuildBuild=() -shellHook=' -export PS1="\[\e[0;34m\](devenv)\[\e[0m\] ${PS1-}" - - -# Override temp directories that stdenv set to NIX_BUILD_TOP. -# Only reset those that still point to the Nix build dir; leave -# any user/CI-supplied value intact so child processes (e.g. -# `devenv processes wait`) compute the same runtime directory. -for var in TMP TMPDIR TEMP TEMPDIR; do - if [ -n "${!var-}" ] && [ "${!var}" = "${NIX_BUILD_TOP-}" ]; then - export "$var"=/tmp - fi -done -if [ -n "${NIX_BUILD_TOP-}" ]; then - unset NIX_BUILD_TOP -fi - -# set path to locales on non-NixOS Linux hosts -if [ -z "${LOCALE_ARCHIVE-}" ]; then - export LOCALE_ARCHIVE=/nix/store/sp7b84c2jnbskd6dm2n5splgipg9d1f0-glibc-locales-2.42-61/lib/locale/locale-archive -fi - - -# direnv helper -if [ ! type -p direnv &>/dev/null && -f .envrc ]; then - echo "An .envrc file was detected, but the direnv command is not installed." - echo "To use this configuration, please install direnv: https://direnv.net/docs/installation.html" -fi - -mkdir -p "$DEVENV_STATE" -if [ ! -L "$DEVENV_DOTFILE/profile" ] || [ "$(/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin/readlink $DEVENV_DOTFILE/profile)" != "/nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile" ] -then - ln -snf /nix/store/dv1lfx9wp9d3lh0wl7rzqh63dknw9xp2-devenv-profile "$DEVENV_DOTFILE/profile" -fi -unset HOST_PATH NIX_BUILD_CORES __structuredAttrs buildInputs buildPhase builder depsBuildBuild depsBuildBuildPropagated depsBuildTarget depsBuildTargetPropagated depsHostHost depsHostHostPropagated depsTargetTarget depsTargetTargetPropagated dontAddDisableDepTrack doCheck doInstallCheck nativeBuildInputs out outputs patches phases preferLocalBuild propagatedBuildInputs propagatedNativeBuildInputs shell shellHook stdenv strictDeps - -mkdir -p /run/user/1000/devenv-303d476 -ln -snf /run/user/1000/devenv-303d476 /home/karim/Dev/DevOps-Intro/.devenv/run - - -export PATH=$GOPATH/bin:$PATH - -echo "✨ devenv 2.0.6 is out of date. Please update to 2.1.2: https://devenv.sh/getting-started/#installation" >&2 - - -# Check whether the direnv integration is out of date. -{ - if [[ ":${DIRENV_ACTIVE-}:" == *":/home/karim/Dev/DevOps-Intro:"* ]]; then - if [[ ! "${DEVENV_NO_DIRENVRC_OUTDATED_WARNING-}" == 1 && ! "${DEVENV_DIRENVRC_ROLLING_UPGRADE-}" == 1 ]]; then - if [[ ${DEVENV_DIRENVRC_VERSION:-0} -lt 2 ]]; then - direnv_line=$(grep --color=never -E "source_url.*cachix/devenv" .envrc || echo "") - - echo "✨ The direnv integration in your .envrc is out of date." - echo "" - echo -n "RECOMMENDED: devenv can now auto-upgrade the direnv integration. " - if [[ -n "$direnv_line" ]]; then - echo "To enable this feature, replace the following line in your .envrc:" - echo "" - echo " $direnv_line" - echo "" - echo "with:" - echo "" - echo " eval \"\$(devenv direnvrc)\"" - else - echo "To enable this feature, replace the \`source_url\` line that fetches the direnvrc integration in your .envrc with:" - echo "" - echo " eval \"$(devenv direnvrc)\"" - fi - echo "" - echo "If you prefer to continue managing the integration manually, follow the upgrade instructions at https://devenv.sh/integrations/direnv/." - echo "" - echo "To disable this message:" - echo "" - echo " Add the following environment to your .envrc before \`use devenv\`:" - echo "" - echo " export DEVENV_NO_DIRENVRC_OUTDATED_WARNING=1" - echo "" - echo " Or set the following option in your devenv configuration:" - echo "" - echo " devenv.warnOnNewVersion = false;" - echo "" - fi - fi - fi -} >&2 - -echo "── DevOps-Intro devenv ──" -go version -git --version -echo "QuickNotes: cd app && go run ." - -' -export shellHook -DEVENV_DOTFILE='/home/karim/Dev/DevOps-Intro/.devenv' -export DEVENV_DOTFILE -declare -a unpackCmdHooks=('_defaultUnpack' ) -preferLocalBuild='1' -export preferLocalBuild -OSTYPE='linux-gnu' -defaultNativeBuildInputs='/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2 /nix/store/9vv51km72lpngs6aixxplrr3c88q4c3c-update-autotools-gnu-config-scripts-hook /nix/store/0y5xmdb7qfvimjwbq7ibg1xdgkgjwqng-no-broken-symlinks.sh /nix/store/cv1d7p48379km6a85h4zp6kr86brh32q-audit-tmpdir.sh /nix/store/85clx3b0xkdf58jn161iy80y5223ilbi-compress-man-pages.sh /nix/store/p3l1a5y7nllfyrjn2krlwgcc3z0cd3fq-make-symlinks-relative.sh /nix/store/5yzw0vhkyszf2d179m0qfkgxmp5wjjx4-move-docs.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/pag6l61paj1dc9sv15l7bm5c17xn5kyk-move-systemd-user-units.sh /nix/store/cmzya9irvxzlkh7lfy6i82gbp0saxqj3-multiple-outputs.sh /nix/store/x8c40nfigps493a07sdr2pm5s9j1cdc0-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/xyff06pkhki3qy1ls77w10s0v79c9il0-reproducible-builds.sh /nix/store/z7k98578dfzi6l3hsvbivzm7hfqlk0zc-set-source-date-epoch-to-latest.sh /nix/store/pilsssjjdxvdphlg2h19p0bfx5q0jzkn-strip.sh /nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' -DEVENV_STATE='/home/karim/Dev/DevOps-Intro/.devenv/state' -export DEVENV_STATE -system='x86_64-linux' -export system -strictDeps='' -export strictDeps -depsBuildTargetPropagated='' -export depsBuildTargetPropagated -NIX_BINTOOLS='/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46' -export NIX_BINTOOLS -patches='' -export patches -OLDPWD='' -export OLDPWD -depsTargetTarget='' -export depsTargetTarget -PS4='+ ' -NIX_BUILD_CORES='4' -export NIX_BUILD_CORES -XDG_DATA_DIRS='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/share:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/share:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/share:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/share:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/share:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/share:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/share:/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/share:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/share:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/share:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/share:/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/share:/nix/store/g6q58mbnmi0f05xpm9nfvfhq963yv7wv-publicsuffix-list-0-unstable-2026-03-26/share:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/share:/nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/share:/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/share:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/share:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/share:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/share:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/share' -export XDG_DATA_DIRS -outputDoc='out' -declare -a pkgsTargetTarget=() -outputDevman='out' -declare -a propagatedHostDepFiles=('propagated-host-host-deps' 'propagated-build-inputs' ) -STRIP='strip' -export STRIP -NIX_LDFLAGS='-rpath /nix/store/86aa67916dbwn1h9rzc6ll79r4lc4dgm-devenv-shell-env/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib -L/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/lib -L/nix/store/7ff90dag7i173s49c5m614wny2lpps1l-brotli-1.2.0-lib/lib -L/nix/store/8cr60j6q7rqmcy4k8l6l1cay9579kd6y-krb5-1.22.1-lib/lib -L/nix/store/hms747x82q23p2g6r6kgzqf7li2ryk39-nghttp2-1.68.1-lib/lib -L/nix/store/133x0z91pizyk8zr4l2ccgqlclpkp1lj-nghttp3-1.15.0/lib -L/nix/store/g5sd94mk8w1a0wiipk81ri0prk136d32-ngtcp2-1.22.0/lib -L/nix/store/sgswwrxkhdlfskklqp4gsbi2cskfg07c-libidn2-2.3.8/lib -L/nix/store/wbyqkb1vpm41s4jb8pv0i9h4jv08xdrv-openssl-3.6.1/lib -L/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/lib -L/nix/store/9lzm6krq5ikzbqbmazbh5jmzwph99rz3-libssh2-1.11.1/lib -L/nix/store/ixhlv41i2wpl84xgjcks061dz4yssbg3-zlib-1.3.2/lib -L/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/lib -L/nix/store/pz6b64891m180yb4hadj1jjg3wm3ybng-curl-8.19.0/lib -L/nix/store/09bq2i0kb008ccg3qdbyxv81ggxxnn09-jq-1.8.1/lib' -export NIX_LDFLAGS -pkg='/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0' -preConfigurePhases=' updateAutotoolsGnuConfigScriptsPhase' -HOST_PATH='/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' -export HOST_PATH -declare -a pkgsBuildTarget=() -PATH='/nix/store/4bwbk4an4bx7cb8xwffghvjjyfyl7m2i-bash-interactive-5.3p9/bin:/nix/store/dimnagks1qsp7180yw74z0npp7z2ihs3-go-1.26.2/bin:/nix/store/6qbyi9hnp8haj2xjpcbkn8sgbi8nz61v-delve-1.26.1/bin:/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin:/nix/store/2v52hlwwjs856h62fay6a92wwv0pslzy-gomodifytags-1.17.0/bin:/nix/store/xhb065ccyh4nyqr8hrkvfwx1csv2a4bh-impl-1.5.0/bin:/nix/store/w0js44iyr636gg7gxq4nlprbh3l1n7sp-go-tools-2026.1/bin:/nix/store/v0p2b7kwssm5j3qrw0dcr9k15zvsnly1-gotests-1.9.0/bin:/nix/store/c8glgmzcs86c90172j8g4kibkp3z58vz-iferr-0-unstable-2024-01-22/bin:/nix/store/27awffybla1vqpjj2g8qmsgd1imj2w5l-gopls-0.21.1/bin:/nix/store/c0277k5giric1mn9dklllavbzvxl6hzb-git-2.53.0/bin:/nix/store/lj9iikldz29gc7nizgn4xh30cw33xvdl-openssh-10.3p1/bin:/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/bin:/nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/bin:/nix/store/mj1k1nsdqr0mp9wsnkg7blgh3xf5wssv-brotli-1.2.0/bin:/nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/bin:/nix/store/qp2qzmh67rqy6i36sh3iqznk1akiw4q1-krb5-1.22.1/bin:/nix/store/yvxyaqh3bzj7nr64zlr1axyf76fgcszb-nghttp2-1.68.1/bin:/nix/store/a327a5lqzwakcs3yjgx4sa1931fph5gf-libidn2-2.3.8-bin/bin:/nix/store/2di90l89y2ygdy3rbws7dhg9nrvd3pnx-openssl-3.6.1-bin/bin:/nix/store/79kr7fafcvvmch13cyczpckz40159pk5-libpsl-0.21.5/bin:/nix/store/91jddg4g6788ilnk3kww8j8jhxhzk6d3-zstd-1.5.7-bin/bin:/nix/store/k0rqiflg1vkn1kj96br5pfxj40p3srz4-zstd-1.5.7/bin:/nix/store/sm2nq18jjqp4x0sxpl6lrvwl9rx6mvj2-curl-8.19.0-bin/bin:/nix/store/v5c3inhfq6xshmwg1c254vfbcy4jp3k9-jq-1.8.1-bin/bin:/nix/store/y3m73nv1ry783kqfjqq17p3kxxaxx5d1-gh-2.92.0/bin:/nix/store/v7mjkia7ki79s5i24ldbzq1khalhgzk0-pkg-config-wrapper-0.29.2/bin:/nix/store/66lksljlljdd5ppgvfk8g89y8xgqcxd7-patchelf-0.15.2/bin:/nix/store/qd70v8g0561vm8m33kmnp79z00cgyi5n-gcc-wrapper-15.2.0/bin:/nix/store/sanx9fg8mry8mq92zhlm5qvb83qlxrlx-gcc-15.2.0/bin:/nix/store/pf30k3mg7n6bibc1k6609gyq7glk00k2-glibc-2.42-61-bin/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/kfwagnh6i1mysf7vxq679rzh30z9zj3g-binutils-wrapper-2.46/bin:/nix/store/p2vkw5s89ff1fs2d2rxqxiqil9s0jpcm-binutils-2.46/bin:/nix/store/jjxngswsb214vb58qx485jhmilf0kxxy-coreutils-9.10/bin:/nix/store/vhsirn9m1ifmnw5g1qczzhvqkx6lw1if-findutils-4.10.0/bin:/nix/store/hx084k7pgz4n0vgkvil9gbcnl8y6p1xf-diffutils-3.12/bin:/nix/store/af4a8i43kc2ss4rnmf0swkk2mprsw6xq-gnused-4.9/bin:/nix/store/wf7lr2hf43546jc5kwqh3dbxnpcnw1mn-gnugrep-3.12/bin:/nix/store/lakv43kv98sl6h0ba6wnyg513mcq61vl-gawk-5.4.0/bin:/nix/store/rnvb7bvp53v2dw7pcwh9xb89x5z4rjib-gnutar-1.35/bin:/nix/store/9lhr1c3l9qzv8pzp3idmii1nwvxxjys3-gzip-1.14/bin:/nix/store/zj6r42syyswkhrr174bzppj3n7xhq936-bzip2-1.0.8-bin/bin:/nix/store/yvrwcs1a45rj8142n0l2w9q9s6akamjr-gnumake-4.4.1/bin:/nix/store/i27rhb3nr65rkrwz36bchkwmav6ggsmn-bash-5.3p9/bin:/nix/store/zj7mxwji29zvj9vl70iip7gw4h6ljfam-patch-2.8/bin:/nix/store/2nm5c858fh52s6mhcffm07s3biaxys44-xz-5.8.3-bin/bin:/nix/store/iscmg3ivhx7z67dz14lrg7p77gnsa4dw-file-5.45/bin' -export PATH -NIX_CFLAGS_COMPILE=' -frandom-seed=86aa67916d -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include -isystem /nix/store/5bs057cgp4nxqff22jg0k1svs121z6a8-bash-interactive-5.3p9-dev/include -isystem /nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12/include -isystem /nix/store/7xvb5060qcf36ncp47wz62rl3fsccv1g-curl-8.19.0-dev/include -isystem /nix/store/1x1msj33z37b65vlxbs51l7i4j92qn9h-brotli-1.2.0-dev/include -isystem /nix/store/dgdzsx6i729gcp1rrz85zbaacgl86gab-krb5-1.22.1-dev/include -isystem /nix/store/iaf80mkaj9kfgy3h6hf1xqj7la8acr7y-nghttp2-1.68.1-dev/include -isystem /nix/store/d2xhslm8a0b1lk0p4plmyip3i194znhy-nghttp3-1.15.0-dev/include -isystem /nix/store/yp754aaxmfqdag95053yax1fdaa4s9ck-ngtcp2-1.22.0-dev/include -isystem /nix/store/j3ypygy4pwwgkdrkxkhnhxqkwx4yw8zq-libidn2-2.3.8-dev/include -isystem /nix/store/dy64cxaygvmjfznysgxk501yds8jij6s-openssl-3.6.1-dev/include -isystem /nix/store/ylldnaarbvwkvpn5dasnjjyvvghh6k3r-libpsl-0.21.5-dev/include -isystem /nix/store/5c04s19in4y2ij0zzkh4y9gqys8rwgc4-libssh2-1.11.1-dev/include -isystem /nix/store/3yl2s5r3yph88imzbgbdrh8pbs9rcjcs-zlib-1.3.2-dev/include -isystem /nix/store/vbqakw4shfcbmdxs6kkp3jmp9k5br94y-zstd-1.5.7-dev/include -isystem /nix/store/p8x5zv9s9qg3ld8b7jdm03hkpdqybjl9-jq-1.8.1-dev/include' -export NIX_CFLAGS_COMPILE -_PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu' -export _PYTHON_SYSCONFIGDATA_NAME -declare -a propagatedBuildDepFiles=('propagated-build-build-deps' 'propagated-native-build-inputs' 'propagated-build-target-deps' ) -dontAddDisableDepTrack='1' -export dontAddDisableDepTrack -GOTOOLDIR='/nix/store/mip3wvnnvakhk9q3jjr9b169lq6v60ln-gotools-0.44.0/bin' -export GOTOOLDIR -DEVENV_TASK_FILE='/nix/store/67gwkyrn8qfd381zka7lgr23bm2d2v2a-tasks.json' -export DEVENV_TASK_FILE -NIX_ENFORCE_NO_NATIVE='1' -export NIX_ENFORCE_NO_NATIVE -__structuredAttrs='' -export __structuredAttrs -declare -a pkgsHostTarget=() -propagatedBuildInputs='' -export propagatedBuildInputs -RANLIB='ranlib' -export RANLIB -phases='buildPhase' -export phases -outputDevdoc='REMOVE' -concatStringsSep () -{ - - local sep="$1"; - local name="$2"; - local type oldifs; - if type=$(declare -p "$name" 2> /dev/null); then - local -n nameref="$name"; - case "${type#* }" in - -A*) - echo "concatStringsSep(): ERROR: trying to use concatStringsSep on an associative array." 1>&2; - return 1 - ;; - -a*) - local IFS="$(printf '\036')" - ;; - *) - local IFS=" " - ;; - esac; - local ifs_separated="${nameref[*]}"; - echo -n "${ifs_separated//"$IFS"/"$sep"}"; - fi -} -checkPhase () -{ - - runHook preCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom checkPhase, doing nothing"; - runHook postCheck; - return; - fi; - if [[ -z "${checkTarget:-}" ]]; then - if make -n ${makefile:+-f $makefile} check > /dev/null 2>&1; then - checkTarget="check"; - else - if make -n ${makefile:+-f $makefile} test > /dev/null 2>&1; then - checkTarget="test"; - fi; - fi; - fi; - if [[ -z "${checkTarget:-}" ]]; then - echo "no check/test target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray checkFlags=VERBOSE=y checkFlagsArray checkTarget; - echoCmd 'check flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postCheck -} -distPhase () -{ - - runHook preDist; - local flagsArray=(); - concatTo flagsArray distFlags distFlagsArray distTarget=dist; - echo 'dist flags: %q' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - if [ "${dontCopyDist:-0}" != 1 ]; then - mkdir -p "$out/tarballs"; - cp -pvd ${tarballs[*]:-*.tar.gz} "$out/tarballs"; - fi; - runHook postDist -} -getTargetRole () -{ - - getRole "$targetOffset" -} -showPhaseFooter () -{ - - local phase="$1"; - local startTime="$2"; - local endTime="$3"; - local delta=$(( endTime - startTime )); - (( delta < 30 )) && return; - local H=$((delta/3600)); - local M=$((delta%3600/60)); - local S=$((delta%60)); - echo -n "$phase completed in "; - (( H > 0 )) && echo -n "$H hours "; - (( M > 0 )) && echo -n "$M minutes "; - echo "$S seconds" -} -appendToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "appendToVar(): ERROR: trying to use appendToVar on an associative array, use variable+=([\"X\"]=\"Y\") instead." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=(${nameref+"${nameref[@]}"} "$@"); - else - nameref="${nameref-} $*"; - fi -} -ccWrapper_addCVars () -{ - - local role_post; - getHostRoleEnvHook; - local found=; - if [ -d "$1/include" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -isystem $1/include"; - found=1; - fi; - if [ -d "$1/Library/Frameworks" ]; then - export NIX_CFLAGS_COMPILE${role_post}+=" -iframework $1/Library/Frameworks"; - found=1; - fi; - if [[ -n "" && -n ${NIX_STORE:-} && -n $found ]]; then - local scrubbed="$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${1#"$NIX_STORE"/*-}"; - export NIX_CFLAGS_COMPILE${role_post}+=" -fmacro-prefix-map=$1=$scrubbed"; - fi -} -moveToOutput () -{ - - local patt="$1"; - local dstOut="$2"; - local output; - for output in $(getAllOutputNames); - do - if [ "${!output}" = "$dstOut" ]; then - continue; - fi; - local srcPath; - for srcPath in "${!output}"/$patt; - do - if [ ! -e "$srcPath" ] && [ ! -L "$srcPath" ]; then - continue; - fi; - if [ "$dstOut" = REMOVE ]; then - echo "Removing $srcPath"; - rm -r "$srcPath"; - else - local dstPath="$dstOut${srcPath#${!output}}"; - echo "Moving $srcPath to $dstPath"; - if [ -d "$dstPath" ] && [ -d "$srcPath" ]; then - rmdir "$srcPath" --ignore-fail-on-non-empty; - if [ -d "$srcPath" ]; then - mv -t "$dstPath" "$srcPath"/*; - rmdir "$srcPath"; - fi; - else - mkdir -p "$(readlink -m "$dstPath/..")"; - mv "$srcPath" "$dstPath"; - fi; - fi; - local srcParent="$(readlink -m "$srcPath/..")"; - if [ -n "$(find "$srcParent" -maxdepth 0 -type d -empty 2> /dev/null)" ]; then - echo "Removing empty $srcParent/ and (possibly) its parents"; - rmdir -p --ignore-fail-on-non-empty "$srcParent" 2> /dev/null || true; - fi; - done; - done -} -isELF () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [ "$magic" = 'ELF' ]; then - return 0; - else - return 1; - fi -} -_addRpathPrefix () -{ - - if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then - export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"; - fi -} -nixTalkativeLog () -{ - - _nixLogWithLevel 4 "$*" -} -recordPropagatedDependencies () -{ - - declare -ra flatVars=(depsBuildBuildPropagated propagatedNativeBuildInputs depsBuildTargetPropagated depsHostHostPropagated propagatedBuildInputs depsTargetTargetPropagated); - declare -ra flatFiles=("${propagatedBuildDepFiles[@]}" "${propagatedHostDepFiles[@]}" "${propagatedTargetDepFiles[@]}"); - local propagatedInputsIndex; - for propagatedInputsIndex in "${!flatVars[@]}"; - do - local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"; - local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"; - [[ -n "${!propagatedInputsSlice}" ]] || continue; - mkdir -p "${!outputDev}/nix-support"; - printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"; - done -} -substituteStream () -{ - - local var=$1; - local description=$2; - shift 2; - while (( "$#" )); do - local replace_mode="$1"; - case "$1" in - --replace) - if ! "$_substituteStream_has_warned_replace_deprecation"; then - echo "substituteStream() in derivation $name: WARNING: '--replace' is deprecated, use --replace-{fail,warn,quiet}. ($description)" 1>&2; - _substituteStream_has_warned_replace_deprecation=true; - fi; - replace_mode='--replace-warn' - ;& - --replace-quiet | --replace-warn | --replace-fail) - pattern="$2"; - replacement="$3"; - shift 3; - if ! [[ "${!var}" == *"$pattern"* ]]; then - if [ "$replace_mode" == --replace-warn ]; then - printf "substituteStream() in derivation $name: WARNING: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - else - if [ "$replace_mode" == --replace-fail ]; then - printf "substituteStream() in derivation $name: ERROR: pattern %q doesn't match anything in %s\n" "$pattern" "$description" 1>&2; - return 1; - fi; - fi; - fi; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var) - local varName="$2"; - shift 2; - if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then - echo "substituteStream() in derivation $name: ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." 1>&2; - return 1; - fi; - if [ -z ${!varName+x} ]; then - echo "substituteStream() in derivation $name: ERROR: variable \$$varName is unset" 1>&2; - return 1; - fi; - pattern="@$varName@"; - replacement="${!varName}"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}' - ;; - --subst-var-by) - pattern="@$2@"; - replacement="$3"; - eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'; - shift 3 - ;; - *) - echo "substituteStream() in derivation $name: ERROR: Invalid command line argument: $1" 1>&2; - return 1 - ;; - esac; - done; - printf "%s" "${!var}" -} -sysconfigdataHook () -{ - - if [ "$1" = '/nix/store/0r6k8xa2kgqyp3r4v2w7yrb80ma2iawm-python3-3.13.12' ]; then - export _PYTHON_HOST_PLATFORM='linux-x86_64'; - export _PYTHON_SYSCONFIGDATA_NAME='_sysconfigdata__linux_x86_64-linux-gnu'; - fi -} -_callImplicitHook () -{ - - local def="$1"; - local hookName="$2"; - if declare -F "$hookName" > /dev/null; then - nixTalkativeLog "calling implicit '$hookName' function hook"; - "$hookName"; - else - if type -p "$hookName" > /dev/null; then - nixTalkativeLog "sourcing implicit '$hookName' script hook"; - source "$hookName"; - else - if [ -n "${!hookName:-}" ]; then - nixTalkativeLog "evaling implicit '$hookName' string hook"; - eval "${!hookName}"; - else - return "$def"; - fi; - fi; - fi -} -updateSourceDateEpoch () -{ - - local path="$1"; - [[ $path == -* ]] && path="./$path"; - local -a res=($(find "$path" -type f -not -newer "$NIX_BUILD_TOP/.." -printf '%T@ "%p"\0' | sort -n --zero-terminated | tail -n1 --zero-terminated | head -c -1)); - local time="${res[0]//\.[0-9]*/}"; - local newestFile="${res[1]}"; - if [ "${time:-0}" -gt "$SOURCE_DATE_EPOCH" ]; then - echo "setting SOURCE_DATE_EPOCH to timestamp $time of file $newestFile"; - export SOURCE_DATE_EPOCH="$time"; - local now="$(date +%s)"; - if [ "$time" -gt $((now - 60)) ]; then - echo "warning: file $newestFile may be generated; SOURCE_DATE_EPOCH may be non-deterministic"; - fi; - fi -} -fixupPhase () -{ - - local output; - for output in $(getAllOutputNames); - do - if [ -e "${!output}" ]; then - chmod -R u+w,u-s,g-s "${!output}"; - fi; - done; - runHook preFixup; - local output; - for output in $(getAllOutputNames); - do - prefix="${!output}" runHook fixupOutput; - done; - recordPropagatedDependencies; - if [ -n "${setupHook:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"; - fi; - if [ -n "${setupHooks:-}" ]; then - mkdir -p "${!outputDev}/nix-support"; - local hook; - for hook in ${setupHooks[@]}; - do - local content; - consumeEntire content < "$hook"; - substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"; - unset -v content; - done; - unset -v hook; - fi; - if [ -n "${propagatedUserEnvPkgs[*]:-}" ]; then - mkdir -p "${!outputBin}/nix-support"; - printWords "${propagatedUserEnvPkgs[@]}" > "${!outputBin}/nix-support/propagated-user-env-packages"; - fi; - runHook postFixup -} -stripDirs () -{ - - local cmd="$1"; - local ranlibCmd="$2"; - local paths="$3"; - local stripFlags="$4"; - local excludeFlags=(); - local pathsNew=; - [ -z "$cmd" ] && echo "stripDirs: Strip command is empty" 1>&2 && exit 1; - [ -z "$ranlibCmd" ] && echo "stripDirs: Ranlib command is empty" 1>&2 && exit 1; - local pattern; - if [ -n "${stripExclude:-}" ]; then - for pattern in "${stripExclude[@]}"; - do - excludeFlags+=(-a '!' '(' -name "$pattern" -o -wholename "$prefix/$pattern" ')'); - done; - fi; - local p; - for p in ${paths}; - do - if [ -e "$prefix/$p" ]; then - pathsNew="${pathsNew} $prefix/$p"; - fi; - done; - paths=${pathsNew}; - if [ -n "${paths}" ]; then - echo "stripping (with command $cmd and flags $stripFlags) in $paths"; - local striperr; - striperr="$(mktemp --tmpdir="$TMPDIR" 'striperr.XXXXXX')"; - find $paths -type f "${excludeFlags[@]}" -a '!' -path "$prefix/lib/debug/*" -printf '%D-%i,%p\0' | sort -t, -k1,1 -u -z | cut -d, -f2- -z | xargs -r -0 -n1 -P "$NIX_BUILD_CORES" -- $cmd $stripFlags 2> "$striperr" || exit_code=$?; - [[ "$exit_code" = 123 || -z "$exit_code" ]] || ( cat "$striperr" 1>&2 && exit 1 ); - rm "$striperr"; - find $paths -name '*.a' -type f -exec $ranlibCmd '{}' \; 2> /dev/null; - fi -} -_doStrip () -{ - - local -ra flags=(dontStripHost dontStripTarget); - local -ra debugDirs=(stripDebugList stripDebugListTarget); - local -ra allDirs=(stripAllList stripAllListTarget); - local -ra stripCmds=(STRIP STRIP_FOR_TARGET); - local -ra ranlibCmds=(RANLIB RANLIB_FOR_TARGET); - stripDebugList=${stripDebugList[*]:-lib lib32 lib64 libexec bin sbin Applications Library/Frameworks}; - stripDebugListTarget=${stripDebugListTarget[*]:-}; - stripAllList=${stripAllList[*]:-}; - stripAllListTarget=${stripAllListTarget[*]:-}; - local i; - for i in ${!stripCmds[@]}; - do - local -n flag="${flags[$i]}"; - local -n debugDirList="${debugDirs[$i]}"; - local -n allDirList="${allDirs[$i]}"; - local -n stripCmd="${stripCmds[$i]}"; - local -n ranlibCmd="${ranlibCmds[$i]}"; - if [[ -n "${dontStrip-}" || -n "${flag-}" ]] || ! type -f "${stripCmd-}" 2> /dev/null 1>&2; then - continue; - fi; - stripDirs "$stripCmd" "$ranlibCmd" "$debugDirList" "${stripDebugFlags[*]:--S -p}"; - stripDirs "$stripCmd" "$ranlibCmd" "$allDirList" "${stripAllFlags[*]:--s -p}"; - done -} -addEnvHooks () -{ - - local depHostOffset="$1"; - shift; - local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"; - local pkgHookVar; - for pkgHookVar in "${!pkgHookVarsSlice}"; - do - eval "${pkgHookVar}s"'+=("$@")'; - done -} -consumeEntire () -{ - - if IFS='' read -r -d '' "$1"; then - echo "consumeEntire(): ERROR: Input null bytes, won't process" 1>&2; - return 1; - fi -} -findInputs () -{ - - local -r pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - local varVar="${pkgAccumVarVars[hostOffset + 1]}"; - local varRef="$varVar[$((targetOffset - hostOffset))]"; - local var="${!varRef}"; - unset -v varVar varRef; - local varSlice="$var[*]"; - case " ${!varSlice-} " in - *" $pkg "*) - return 0 - ;; - esac; - unset -v varSlice; - eval "$var"'+=("$pkg")'; - if ! [ -e "$pkg" ]; then - echo "build input $pkg does not exist" 1>&2; - exit 1; - fi; - function mapOffset () - { - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi - }; - local relHostOffset; - for relHostOffset in "${allPlatOffsets[@]}"; - do - local files="${propagatedDepFilesVars[relHostOffset + 1]}"; - local hostOffsetNext; - mapOffset "$relHostOffset" hostOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - local relTargetOffset; - for relTargetOffset in "${allPlatOffsets[@]}"; - do - (( "$relHostOffset" <= "$relTargetOffset" )) || continue; - local fileRef="${files}[$relTargetOffset - $relHostOffset]"; - local file="${!fileRef}"; - unset -v fileRef; - local targetOffsetNext; - mapOffset "$relTargetOffset" targetOffsetNext; - (( -1 <= hostOffsetNext && hostOffsetNext <= 1 )) || continue; - [[ -f "$pkg/nix-support/$file" ]] || continue; - local pkgNext; - read -r -d '' pkgNext < "$pkg/nix-support/$file" || true; - for pkgNext in $pkgNext; - do - findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"; - done; - done; - done -} -patchELF () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "shrinking RPATHs of ELF executables and libraries in $dir"; - local i; - while IFS= read -r -d '' i; do - if [[ "$i" =~ .build-id ]]; then - continue; - fi; - if ! isELF "$i"; then - continue; - fi; - echo "shrinking $i"; - patchelf --shrink-rpath "$i" || true; - done < <(find "$dir" -type f -print0) -} -pkgConfigWrapper_addPkgConfigPath () -{ - - local role_post; - getHostRoleEnvHook; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/lib/pkgconfig"; - addToSearchPath "PKG_CONFIG_PATH${role_post}" "$1/share/pkgconfig" -} -getHostRole () -{ - - getRole "$hostOffset" -} -_activatePkgs () -{ - - local hostOffset targetOffset; - local pkg; - for hostOffset in "${allPlatOffsets[@]}"; - do - local pkgsVar="${pkgAccumVarVars[hostOffset + 1]}"; - for targetOffset in "${allPlatOffsets[@]}"; - do - (( hostOffset <= targetOffset )) || continue; - local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - activatePackage "$pkg" "$hostOffset" "$targetOffset"; - done; - done; - done -} -_eval () -{ - - if declare -F "$1" > /dev/null 2>&1; then - "$@"; - else - eval "$1"; - fi -} -auditTmpdir () -{ - - local dir="$1"; - [ -e "$dir" ] || return 0; - echo "checking for references to $TMPDIR/ in $dir..."; - local tmpdir elf_fifo script_fifo; - tmpdir="$(mktemp -d)"; - elf_fifo="$tmpdir/elf"; - script_fifo="$tmpdir/script"; - mkfifo "$elf_fifo" "$script_fifo"; - ( find "$dir" -type f -not -path '*/.build-id/*' -print0 | while IFS= read -r -d '' file; do - if isELF "$file"; then - printf '%s\0' "$file" 1>&3; - else - if isScript "$file"; then - filename=${file##*/}; - dir=${file%/*}; - if [ -e "$dir/.$filename-wrapped" ]; then - printf '%s\0' "$file" 1>&4; - fi; - fi; - fi; - done; - exec 3>&- 4>&- ) 3> "$elf_fifo" 4> "$script_fifo" & ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if { printf :; patchelf --print-rpath "$1"; } | grep -q -F ":$TMPDIR/"; then - echo "RPATH of binary $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$elf_fifo" ) & local pid_elf=$!; - local pid_script; - ( xargs -0 -r -P "$NIX_BUILD_CORES" -n 1 sh -c ' - if grep -q -F "$TMPDIR/" "$1"; then - echo "wrapper script $1 contains a forbidden reference to $TMPDIR/" - exit 1 - fi - ' _ < "$script_fifo" ) & local pid_script=$!; - wait "$pid_elf" || { - echo "Some binaries contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - wait "$pid_script" || { - echo "Some scripts contain forbidden references to $TMPDIR/. Check the error above!"; - exit 1 - }; - rm -r "$tmpdir" -} -dumpVars () -{ - - if [[ "${noDumpEnvVars:-0}" != 1 && -d "$NIX_BUILD_TOP" ]]; then - local old_umask; - old_umask=$(umask); - umask 0077; - export 2> /dev/null > "$NIX_BUILD_TOP/env-vars"; - umask "$old_umask"; - fi -} -runPhase () -{ - - local curPhase="$*"; - if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then - return; - fi; - if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then - return; - fi; - if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then - return; - fi; - if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then - return; - fi; - if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then - return; - fi; - if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then - return; - fi; - if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then - return; - fi; - if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then - return; - fi; - showPhaseHeader "$curPhase"; - dumpVars; - local startTime endTime; - startTime=$(date +"%s"); - eval "${!curPhase:-$curPhase}"; - endTime=$(date +"%s"); - showPhaseFooter "$curPhase" "$startTime" "$endTime"; - if [ "$curPhase" = unpackPhase ]; then - [ -n "${sourceRoot:-}" ] && chmod +x -- "${sourceRoot}"; - cd -- "${sourceRoot:-.}"; - fi -} -_defaultUnpack () -{ - - local fn="$1"; - local destination; - if [ -d "$fn" ]; then - destination="$(stripHash "$fn")"; - if [ -e "$destination" ]; then - echo "Cannot copy $fn to $destination: destination already exists!"; - echo "Did you specify two \"srcs\" with the same \"name\"?"; - return 1; - fi; - cp -r --preserve=timestamps --reflink=auto -- "$fn" "$destination"; - else - case "$fn" in - *.tar.xz | *.tar.lzma | *.txz) - ( XZ_OPT="--threads=$NIX_BUILD_CORES" xz -d < "$fn"; - true ) | tar xf - --mode=+w --warning=no-timestamp - ;; - *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz) - tar xf "$fn" --mode=+w --warning=no-timestamp - ;; - *) - return 1 - ;; - esac; - fi -} -_multioutDocs () -{ - - local REMOVE=REMOVE; - moveToOutput share/info "${!outputInfo}"; - moveToOutput share/doc "${!outputDoc}"; - moveToOutput share/gtk-doc "${!outputDevdoc}"; - moveToOutput share/devhelp/books "${!outputDevdoc}"; - moveToOutput share/man "${!outputMan}"; - moveToOutput share/man/man3 "${!outputDevman}" -} -_multioutPropagateDev () -{ - - if [ "$(getAllOutputNames)" = "out" ]; then - return; - fi; - local outputFirst; - for outputFirst in $(getAllOutputNames); - do - break; - done; - local propagaterOutput="$outputDev"; - if [ -z "$propagaterOutput" ]; then - propagaterOutput="$outputFirst"; - fi; - if [ -z "${propagatedBuildOutputs+1}" ]; then - local po_dirty="$outputBin $outputInclude $outputLib"; - set +o pipefail; - propagatedBuildOutputs=`echo "$po_dirty" | tr -s ' ' '\n' | grep -v -F "$propagaterOutput" | sort -u | tr '\n' ' ' `; - set -o pipefail; - fi; - if [ -z "$propagatedBuildOutputs" ]; then - return; - fi; - mkdir -p "${!propagaterOutput}"/nix-support; - for output in $propagatedBuildOutputs; - do - echo -n " ${!output}" >> "${!propagaterOutput}"/nix-support/propagated-build-inputs; - done -} -printPhases () -{ - - definePhases; - local phase; - for phase in ${phases[*]}; - do - printf '%s\n' "$phase"; - done -} -substituteInPlace () -{ - - local -a fileNames=(); - for arg in "$@"; - do - if [[ "$arg" = "--"* ]]; then - break; - fi; - fileNames+=("$arg"); - shift; - done; - if ! [[ "${#fileNames[@]}" -gt 0 ]]; then - echo "substituteInPlace called without any files to operate on (files must come before options!)" 1>&2; - return 1; - fi; - for file in "${fileNames[@]}"; - do - substitute "$file" "$file" "$@"; - done -} -definePhases () -{ - - if [ -z "${phases[*]:-}" ]; then - phases="${prePhases[*]:-} unpackPhase patchPhase ${preConfigurePhases[*]:-} configurePhase ${preBuildPhases[*]:-} buildPhase checkPhase ${preInstallPhases[*]:-} installPhase ${preFixupPhases[*]:-} fixupPhase installCheckPhase ${preDistPhases[*]:-} distPhase ${postPhases[*]:-}"; - fi -} -echoCmd () -{ - - printf "%s:" "$1"; - shift; - printf ' %q' "$@"; - echo -} -showPhaseHeader () -{ - - local phase="$1"; - echo "Running phase: $phase"; - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - printf "@nix { \"action\": \"setPhase\", \"phase\": \"%s\" }\n" "$phase" >&"$NIX_LOG_FD" -} -nixNoticeLog () -{ - - _nixLogWithLevel 2 "$*" -} -addToSearchPath () -{ - - addToSearchPathWithCustomDelimiter ":" "$@" -} -activatePackage () -{ - - local pkg="$1"; - local -r hostOffset="$2"; - local -r targetOffset="$3"; - (( hostOffset <= targetOffset )) || exit 1; - if [ -f "$pkg" ]; then - nixTalkativeLog "sourcing setup hook '$pkg'"; - source "$pkg"; - fi; - if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then - addToSearchPath _PATH "$pkg/bin"; - fi; - if (( hostOffset <= -1 )); then - addToSearchPath _XDG_DATA_DIRS "$pkg/share"; - fi; - if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then - addToSearchPath _HOST_PATH "$pkg/bin"; - fi; - if [[ -f "$pkg/nix-support/setup-hook" ]]; then - nixTalkativeLog "sourcing setup hook '$pkg/nix-support/setup-hook'"; - source "$pkg/nix-support/setup-hook"; - fi -} -isMachO () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 4 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xcf") || "$magic" = $(echo -ne "\xcf\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xfe\xed\xfa\xce") || "$magic" = $(echo -ne "\xce\xfa\xed\xfe") ]]; then - return 0; - else - if [[ "$magic" = $(echo -ne "\xca\xfe\xba\xbe") || "$magic" = $(echo -ne "\xbe\xba\xfe\xca") ]]; then - return 0; - else - return 1; - fi; - fi; - fi -} -_nixLogWithLevel () -{ - - [[ -z ${NIX_LOG_FD-} || ${NIX_DEBUG:-0} -lt ${1:?} ]] && return 0; - local logLevel; - case "${1:?}" in - 0) - logLevel=ERROR - ;; - 1) - logLevel=WARN - ;; - 2) - logLevel=NOTICE - ;; - 3) - logLevel=INFO - ;; - 4) - logLevel=TALKATIVE - ;; - 5) - logLevel=CHATTY - ;; - 6) - logLevel=DEBUG - ;; - 7) - logLevel=VOMIT - ;; - *) - echo "_nixLogWithLevel: called with invalid log level: ${1:?}" >&"$NIX_LOG_FD"; - return 1 - ;; - esac; - local callerName="${FUNCNAME[2]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s: %s\n" "$logLevel" "$callerName" "${2:?}" >&"$NIX_LOG_FD" -} -mapOffset () -{ - - local -r inputOffset="$1"; - local -n outputOffset="$2"; - if (( inputOffset <= 0 )); then - outputOffset=$((inputOffset + hostOffset)); - else - outputOffset=$((inputOffset - 1 + targetOffset)); - fi -} -substituteAllInPlace () -{ - - local fileName="$1"; - shift; - substituteAll "$fileName" "$fileName" "$@" -} -toPythonPath () -{ - - local paths="$1"; - local result=; - for i in $paths; - do - p="$i/lib/python3.13/site-packages"; - result="${result}${result:+:}$p"; - done; - echo $result -} -getTargetRoleEnvHook () -{ - - getRole "$depTargetOffset" -} -getRole () -{ - - case $1 in - -1) - role_post='_FOR_BUILD' - ;; - 0) - role_post='' - ;; - 1) - role_post='_FOR_TARGET' - ;; - *) - echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -addToSearchPathWithCustomDelimiter () -{ - - local delimiter="$1"; - local varName="$2"; - local dir="$3"; - if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" != *"${delimiter}${dir}${delimiter}"* ]]; then - export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"; - fi -} -addPythonPath () -{ - - addToSearchPathWithCustomDelimiter : PYTHONPATH $1/lib/python3.13/site-packages -} -unpackFile () -{ - - curSrc="$1"; - echo "unpacking source archive $curSrc"; - if ! runOneHook unpackCmd "$curSrc"; then - echo "do not know how to unpack source archive $curSrc"; - exit 1; - fi -} -genericBuild () -{ - - export GZIP_NO_TIMESTAMPS=1; - if [ -f "${buildCommandPath:-}" ]; then - source "$buildCommandPath"; - return; - fi; - if [ -n "${buildCommand:-}" ]; then - eval "$buildCommand"; - return; - fi; - definePhases; - for curPhase in ${phases[*]}; - do - runPhase "$curPhase"; - done -} -_multioutDevs () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${moveToDev-1}" ]; then - return; - fi; - moveToOutput include "${!outputInclude}"; - moveToOutput lib/pkgconfig "${!outputDev}"; - moveToOutput share/pkgconfig "${!outputDev}"; - moveToOutput lib/cmake "${!outputDev}"; - moveToOutput share/aclocal "${!outputDev}"; - for f in "${!outputDev}"/{lib,share}/pkgconfig/*.pc; - do - echo "Patching '$f' includedir to output ${!outputInclude}"; - sed -i "/^includedir=/s,=\${prefix},=${!outputInclude}," "$f"; - done -} -getHostRoleEnvHook () -{ - - getRole "$depHostOffset" -} -_moveLib64 () -{ - - if [ "${dontMoveLib64-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then - return; - fi; - echo "moving $prefix/lib64/* to $prefix/lib"; - mkdir -p $prefix/lib; - shopt -s dotglob; - for i in $prefix/lib64/*; - do - mv --no-clobber "$i" $prefix/lib; - done; - shopt -u dotglob; - rmdir $prefix/lib64; - ln -s lib $prefix/lib64 -} -_makeSymlinksRelative () -{ - - local prefixes; - prefixes=(); - for output in $(getAllOutputNames); - do - [ ! -e "${!output}" ] && continue; - prefixes+=("${!output}"); - done; - find "${prefixes[@]}" -type l -printf '%H\0%p\0' | xargs -0 -n2 -r -P "$NIX_BUILD_CORES" sh -c ' - output="$1" - link="$2" - - linkTarget=$(readlink "$link") - - # only touch links that point inside the same output tree - [[ $linkTarget == "$output"/* ]] || exit 0 - - if [ ! -e "$linkTarget" ]; then - echo "the symlink $link is broken, it points to $linkTarget (which is missing)" - fi - - echo "making symlink relative: $link" - ln -snrf "$linkTarget" "$link" - ' _ -} -_overrideFirst () -{ - - if [ -z "${!1-}" ]; then - _assignFirst "$@"; - fi -} -_moveToShare () -{ - - if [ -n "$__structuredAttrs" ]; then - if [ -z "${forceShare-}" ]; then - forceShare=(man doc info); - fi; - else - forceShare=(${forceShare:-man doc info}); - fi; - if [[ -z "$out" ]]; then - return; - fi; - for d in "${forceShare[@]}"; - do - if [ -d "$out/$d" ]; then - if [ -d "$out/share/$d" ]; then - echo "both $d/ and share/$d/ exist!"; - else - echo "moving $out/$d to $out/share/$d"; - mkdir -p $out/share; - mv $out/$d $out/share/; - fi; - fi; - done -} -_updateSourceDateEpochFromSourceRoot () -{ - - if [ -n "$sourceRoot" ]; then - updateSourceDateEpoch "$sourceRoot"; - fi -} -patchShebangs () -{ - - local pathName; - local update=false; - while [[ $# -gt 0 ]]; do - case "$1" in - --host) - pathName=HOST_PATH; - shift - ;; - --build) - pathName=PATH; - shift - ;; - --update) - update=true; - shift - ;; - --) - shift; - break - ;; - -* | --*) - echo "Unknown option $1 supplied to patchShebangs" 1>&2; - return 1 - ;; - *) - break - ;; - esac; - done; - echo "patching script interpreter paths in $@"; - local f; - local oldPath; - local newPath; - local arg0; - local args; - local oldInterpreterLine; - local newInterpreterLine; - if [[ $# -eq 0 ]]; then - echo "No arguments supplied to patchShebangs" 1>&2; - return 0; - fi; - local f; - while IFS= read -r -d '' f; do - isScript "$f" || continue; - read -r oldInterpreterLine < "$f" || [ "$oldInterpreterLine" ]; - read -r oldPath arg0 args <<< "${oldInterpreterLine:2}"; - if [[ -z "${pathName:-}" ]]; then - if [[ -n $strictDeps && $f == "$NIX_STORE"* ]]; then - pathName=HOST_PATH; - else - pathName=PATH; - fi; - fi; - if [[ "$oldPath" == *"/bin/env" ]]; then - if [[ $arg0 == "-S" ]]; then - arg0=${args%% *}; - [[ "$args" == *" "* ]] && args=${args#* } || args=; - newPath="$(PATH="${!pathName}" type -P "env" || true)"; - args="-S $(PATH="${!pathName}" type -P "$arg0" || true) $args"; - else - if [[ $arg0 == "-"* || $arg0 == *"="* ]]; then - echo "$f: unsupported interpreter directive \"$oldInterpreterLine\" (set dontPatchShebangs=1 and handle shebang patching yourself)" 1>&2; - exit 1; - else - newPath="$(PATH="${!pathName}" type -P "$arg0" || true)"; - fi; - fi; - else - if [[ -z $oldPath ]]; then - oldPath="/bin/sh"; - fi; - newPath="$(PATH="${!pathName}" type -P "$(basename "$oldPath")" || true)"; - args="$arg0 $args"; - fi; - newInterpreterLine="$newPath $args"; - newInterpreterLine=${newInterpreterLine%${newInterpreterLine##*[![:space:]]}}; - if [[ -n "$oldPath" && ( "$update" == true || "${oldPath:0:${#NIX_STORE}}" != "$NIX_STORE" ) ]]; then - if [[ -n "$newPath" && "$newPath" != "$oldPath" ]]; then - echo "$f: interpreter directive changed from \"$oldInterpreterLine\" to \"$newInterpreterLine\""; - escapedInterpreterLine=${newInterpreterLine//\\/\\\\}; - timestamp=$(stat --printf "%y" "$f"); - tmpFile=$(mktemp -t patchShebangs.XXXXXXXXXX); - sed -e "1 s|.*|#\!$escapedInterpreterLine|" "$f" > "$tmpFile"; - local restoreReadOnly; - if [[ ! -w "$f" ]]; then - chmod +w "$f"; - restoreReadOnly=true; - fi; - cat "$tmpFile" > "$f"; - rm "$tmpFile"; - if [[ -n "${restoreReadOnly:-}" ]]; then - chmod -w "$f"; - fi; - touch --date "$timestamp" "$f"; - fi; - fi; - done < <(find "$@" -type f -perm -0100 -print0) -} -noBrokenSymlinks () -{ - - local -r output="${1:?}"; - local path; - local pathParent; - local symlinkTarget; - local -i numDanglingSymlinks=0; - local -i numReflexiveSymlinks=0; - local -i numUnreadableSymlinks=0; - if [[ ! -e $output ]]; then - nixWarnLog "skipping non-existent output $output"; - return 0; - fi; - nixInfoLog "running on $output"; - while IFS= read -r -d '' path; do - pathParent="$(dirname "$path")"; - if ! symlinkTarget="$(readlink "$path")"; then - nixErrorLog "the symlink $path is unreadable"; - numUnreadableSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget == /* ]]; then - nixInfoLog "symlink $path points to absolute target $symlinkTarget"; - else - nixInfoLog "symlink $path points to relative target $symlinkTarget"; - symlinkTarget="$(realpath --no-symlinks --canonicalize-missing "$pathParent/$symlinkTarget")"; - fi; - if [[ $symlinkTarget = "$TMPDIR"/* ]]; then - nixErrorLog "the symlink $path points to $TMPDIR directory: $symlinkTarget"; - numDanglingSymlinks+=1; - continue; - fi; - if [[ $symlinkTarget != "$NIX_STORE"/* ]]; then - nixInfoLog "symlink $path points outside the Nix store; ignoring"; - continue; - fi; - if [[ $path == "$symlinkTarget" ]]; then - nixErrorLog "the symlink $path is reflexive"; - numReflexiveSymlinks+=1; - else - if [[ ! -e $symlinkTarget ]]; then - nixErrorLog "the symlink $path points to a missing target: $symlinkTarget"; - numDanglingSymlinks+=1; - else - nixDebugLog "the symlink $path is irreflexive and points to a target which exists"; - fi; - fi; - done < <(find "$output" -type l -print0); - if ((numDanglingSymlinks > 0 || numReflexiveSymlinks > 0 || numUnreadableSymlinks > 0)); then - nixErrorLog "found $numDanglingSymlinks dangling symlinks, $numReflexiveSymlinks reflexive symlinks and $numUnreadableSymlinks unreadable symlinks"; - exit 1; - fi; - return 0 -} -patchShebangsAuto () -{ - - if [[ -z "${dontPatchShebangs-}" && -e "$prefix" ]]; then - if [[ "$output" != out && "$output" = "$outputDev" ]]; then - patchShebangs --build "$prefix"; - else - patchShebangs --host "$prefix"; - fi; - fi -} -compressManPages () -{ - - local dir="$1"; - if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ]; then - return; - fi; - echo "gzipping man pages under $dir/share/man/"; - find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | xargs -0 -n1 -P "$NIX_BUILD_CORES" gzip -n -f; - find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 | sort -z | while IFS= read -r -d '' f; do - local target; - target="$(readlink -f "$f")"; - if [ -f "$target".gz ]; then - ln -sf "$target".gz "$f".gz && rm "$f"; - fi; - done -} -nixChattyLog () -{ - - _nixLogWithLevel 5 "$*" -} -runHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook; - for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - _eval "$hook" "$@"; - done; - return 0 -} -bintoolsWrapper_addLDVars () -{ - - local role_post; - getHostRoleEnvHook; - if [[ -d "$1/lib64" && ! -L "$1/lib64" ]]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib64"; - fi; - if [[ -d "$1/lib" ]]; then - local -a glob=($1/lib/lib*); - if [ "${#glob[*]}" -gt 0 ]; then - export NIX_LDFLAGS${role_post}+=" -L$1/lib"; - fi; - fi -} -configurePhase () -{ - - runHook preConfigure; - : "${configureScript=}"; - if [[ -z "$configureScript" && -x ./configure ]]; then - configureScript=./configure; - fi; - if [ -z "${dontFixLibtool:-}" ]; then - export lt_cv_deplibs_check_method="${lt_cv_deplibs_check_method-pass_all}"; - local i; - find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do - echo "fixing libtool script $i"; - fixLibtool "$i"; - done; - CONFIGURE_MTIME_REFERENCE=$(mktemp configure.mtime.reference.XXXXXX); - find . -executable -type f -name configure -exec grep -l 'GNU Libtool is free software; you can redistribute it and/or modify' {} \; -exec touch -r {} "$CONFIGURE_MTIME_REFERENCE" \; -exec sed -i s_/usr/bin/file_file_g {} \; -exec touch -r "$CONFIGURE_MTIME_REFERENCE" {} \;; - rm -f "$CONFIGURE_MTIME_REFERENCE"; - fi; - if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then - local -r prefixKeyOrDefault="${prefixKey:---prefix=}"; - if [ "${prefixKeyOrDefault: -1}" = " " ]; then - prependToVar configureFlags "$prefix"; - prependToVar configureFlags "${prefixKeyOrDefault::-1}"; - else - prependToVar configureFlags "$prefixKeyOrDefault$prefix"; - fi; - fi; - if [[ -f "$configureScript" ]]; then - if [ -z "${dontAddDisableDepTrack:-}" ]; then - if grep -q dependency-tracking "$configureScript"; then - prependToVar configureFlags --disable-dependency-tracking; - fi; - fi; - if [ -z "${dontDisableStatic:-}" ]; then - if grep -q enable-static "$configureScript"; then - prependToVar configureFlags --disable-static; - fi; - fi; - if [ -z "${dontPatchShebangsInConfigure:-}" ]; then - patchShebangs --build "$configureScript"; - fi; - fi; - if [ -n "$configureScript" ]; then - local -a flagsArray; - concatTo flagsArray configureFlags configureFlagsArray; - echoCmd 'configure flags' "${flagsArray[@]}"; - $configureScript "${flagsArray[@]}"; - unset flagsArray; - else - echo "no configure script, doing nothing"; - fi; - runHook postConfigure -} -fixLibtool () -{ - - local search_path; - for flag in $NIX_LDFLAGS; - do - case $flag in - -L*) - search_path+=" ${flag#-L}" - ;; - esac; - done; - sed -i "$1" -e "s^eval \(sys_lib_search_path=\).*^\1'${search_path:-}'^" -e 's^eval sys_lib_.+search_path=.*^^' -} -_multioutConfig () -{ - - if [ "$(getAllOutputNames)" = "out" ] || [ -z "${setOutputFlags-1}" ]; then - return; - fi; - if [ -z "${shareDocName:-}" ]; then - local confScript="${configureScript:-}"; - if [ -z "$confScript" ] && [ -x ./configure ]; then - confScript=./configure; - fi; - if [ -f "$confScript" ]; then - local shareDocName="$(sed -n "s/^PACKAGE_TARNAME='\(.*\)'$/\1/p" < "$confScript")"; - fi; - if [ -z "$shareDocName" ] || echo "$shareDocName" | grep -q '[^a-zA-Z0-9_-]'; then - shareDocName="$(echo "$name" | sed 's/-[^a-zA-Z].*//')"; - fi; - fi; - prependToVar configureFlags --bindir="${!outputBin}"/bin --sbindir="${!outputBin}"/sbin --includedir="${!outputInclude}"/include --mandir="${!outputMan}"/share/man --infodir="${!outputInfo}"/share/info --docdir="${!outputDoc}"/share/doc/"${shareDocName}" --libdir="${!outputLib}"/lib --libexecdir="${!outputLib}"/libexec --localedir="${!outputLib}"/share/locale; - prependToVar installFlags pkgconfigdir="${!outputDev}"/lib/pkgconfig m4datadir="${!outputDev}"/share/aclocal aclocaldir="${!outputDev}"/share/aclocal -} -concatTo () -{ - - local -; - set -o noglob; - local -n targetref="$1"; - shift; - local arg default name type; - for arg in "$@"; - do - IFS="=" read -r name default <<< "$arg"; - local -n nameref="$name"; - if [[ -z "${nameref[*]}" && -n "$default" ]]; then - targetref+=("$default"); - else - if type=$(declare -p "$name" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "concatTo(): ERROR: trying to use concatTo on an associative array." 1>&2; - return 1 - ;; - -a*) - targetref+=("${nameref[@]}") - ;; - *) - if [[ "$name" = *"Array" ]]; then - nixErrorLog "concatTo(): $name is not declared as array, treating as a singleton. This will become an error in future"; - targetref+=(${nameref+"${nameref[@]}"}); - else - targetref+=(${nameref-}); - fi - ;; - esac; - fi; - fi; - done -} -getTargetRoleWrapper () -{ - - case $targetOffset in - -1) - export NIX_BINTOOLS_WRAPPER_TARGET_BUILD_x86_64_unknown_linux_gnu=1 - ;; - 0) - export NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1 - ;; - 1) - export NIX_BINTOOLS_WRAPPER_TARGET_TARGET_x86_64_unknown_linux_gnu=1 - ;; - *) - echo "binutils-wrapper-2.46: used as improper sort of dependency" 1>&2; - return 1 - ;; - esac -} -_logHook () -{ - - if [[ -z ${NIX_LOG_FD-} ]]; then - return; - fi; - local hookKind="$1"; - local hookExpr="$2"; - shift 2; - if declare -F "$hookExpr" > /dev/null 2>&1; then - nixTalkativeLog "calling '$hookKind' function hook '$hookExpr'" "$@"; - else - if type -p "$hookExpr" > /dev/null; then - nixTalkativeLog "sourcing '$hookKind' script hook '$hookExpr'"; - else - if [[ "$hookExpr" != "_callImplicitHook"* ]]; then - local exprToOutput; - if [[ ${NIX_DEBUG:-0} -ge 5 ]]; then - exprToOutput="$hookExpr"; - else - local hookExprLine; - while IFS= read -r hookExprLine; do - hookExprLine="${hookExprLine#"${hookExprLine%%[![:space:]]*}"}"; - if [[ -n "$hookExprLine" ]]; then - exprToOutput+="$hookExprLine\\n "; - fi; - done <<< "$hookExpr"; - exprToOutput="${exprToOutput%%\\n }"; - fi; - nixTalkativeLog "evaling '$hookKind' string hook '$exprToOutput'"; - fi; - fi; - fi -} -buildPhase () -{ - - runHook preBuild; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom buildPhase, doing nothing"; - else - foundMakefile=1; - local flagsArray=(${enableParallelBuilding:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray buildFlags buildFlagsArray; - echoCmd 'build flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - runHook postBuild -} -isScript () -{ - - local fn="$1"; - local fd; - local magic; - exec {fd}< "$fn"; - LANG=C read -r -n 2 -u "$fd" magic; - exec {fd}>&-; - if [[ "$magic" =~ \#! ]]; then - return 0; - else - return 1; - fi -} -noBrokenSymlinksInAllOutputs () -{ - - if [[ -z ${dontCheckForBrokenSymlinks-} ]]; then - for output in $(getAllOutputNames); - do - noBrokenSymlinks "${!output}"; - done; - fi -} -_moveSystemdUserUnits () -{ - - if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then - return; - fi; - if [ ! -e "${prefix:?}/lib/systemd/user" ]; then - return; - fi; - local source="$prefix/lib/systemd/user"; - local target="$prefix/share/systemd/user"; - echo "moving $source/* to $target"; - mkdir -p "$target"; - ( shopt -s dotglob; - for i in "$source"/*; - do - mv "$i" "$target"; - done ); - rmdir "$source"; - ln -s "$target" "$source" -} -exitHandler () -{ - - exitCode="$?"; - set +e; - if [ -n "${showBuildStats:-}" ]; then - read -r -d '' -a buildTimes < <(times); - echo "build times:"; - echo "user time for the shell ${buildTimes[0]}"; - echo "system time for the shell ${buildTimes[1]}"; - echo "user time for all child processes ${buildTimes[2]}"; - echo "system time for all child processes ${buildTimes[3]}"; - fi; - if (( "$exitCode" != 0 )); then - runHook failureHook; - if [ -n "${succeedOnFailure:-}" ]; then - echo "build failed with exit code $exitCode (ignored)"; - mkdir -p "$out/nix-support"; - printf "%s" "$exitCode" > "$out/nix-support/failed"; - exit 0; - fi; - else - runHook exitHook; - fi; - return "$exitCode" -} -_allFlags () -{ - - export system pname name version; - while IFS='' read -r varName; do - nixTalkativeLog "@${varName}@ -> ${!varName}"; - args+=("--subst-var" "$varName"); - done < <(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }') -} -installPhase () -{ - - runHook preInstall; - if [[ -z "${makeFlags-}" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then - echo "no Makefile or custom installPhase, doing nothing"; - runHook postInstall; - return; - else - foundMakefile=1; - fi; - if [ -n "$prefix" ]; then - mkdir -p "$prefix"; - fi; - local flagsArray=(${enableParallelInstalling:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installFlags installFlagsArray installTargets=install; - echoCmd 'install flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - runHook postInstall -} -nixLog () -{ - - [[ -z ${NIX_LOG_FD-} ]] && return 0; - local callerName="${FUNCNAME[1]}"; - if [[ $callerName == "_callImplicitHook" ]]; then - callerName="${hookName:?}"; - fi; - printf "%s: %s\n" "$callerName" "$*" >&"$NIX_LOG_FD" -} -nixErrorLog () -{ - - _nixLogWithLevel 0 "$*" -} -nixVomitLog () -{ - - _nixLogWithLevel 7 "$*" -} -nixWarnLog () -{ - - _nixLogWithLevel 1 "$*" -} -nixDebugLog () -{ - - _nixLogWithLevel 6 "$*" -} -prependToVar () -{ - - local -n nameref="$1"; - local useArray type; - if [ -n "$__structuredAttrs" ]; then - useArray=true; - else - useArray=false; - fi; - if type=$(declare -p "$1" 2> /dev/null); then - case "${type#* }" in - -A*) - echo "prependToVar(): ERROR: trying to use prependToVar on an associative array." 1>&2; - return 1 - ;; - -a*) - useArray=true - ;; - *) - useArray=false - ;; - esac; - fi; - shift; - if $useArray; then - nameref=("$@" ${nameref+"${nameref[@]}"}); - else - nameref="$* ${nameref-}"; - fi -} -_moveSbin () -{ - - if [ "${dontMoveSbin-}" = 1 ]; then - return; - fi; - if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then - return; - fi; - echo "moving $prefix/sbin/* to $prefix/bin"; - mkdir -p $prefix/bin; - shopt -s dotglob; - for i in $prefix/sbin/*; - do - mv "$i" $prefix/bin; - done; - shopt -u dotglob; - rmdir $prefix/sbin; - ln -s bin $prefix/sbin -} -getAllOutputNames () -{ - - if [ -n "$__structuredAttrs" ]; then - echo "${!outputs[*]}"; - else - echo "$outputs"; - fi -} -printWords () -{ - - (( "$#" > 0 )) || return 0; - printf '%s ' "$@" -} -runOneHook () -{ - - local hookName="$1"; - shift; - local hooksSlice="${hookName%Hook}Hooks[@]"; - local hook ret=1; - for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; - do - _logHook "$hookName" "$hook" "$@"; - if _eval "$hook" "$@"; then - ret=0; - break; - fi; - done; - return "$ret" -} -patchPhase () -{ - - runHook prePatch; - local -a patchesArray; - concatTo patchesArray patches; - local -a flagsArray; - concatTo flagsArray patchFlags=-p1; - for i in "${patchesArray[@]}"; - do - echo "applying patch $i"; - local uncompress=cat; - case "$i" in - *.gz) - uncompress="gzip -d" - ;; - *.bz2) - uncompress="bzip2 -d" - ;; - *.xz) - uncompress="xz -d" - ;; - *.lzma) - uncompress="lzma -d" - ;; - esac; - $uncompress < "$i" 2>&1 | patch "${flagsArray[@]}"; - done; - runHook postPatch -} -stripHash () -{ - - local strippedName casematchOpt=0; - strippedName="$(basename -- "$1")"; - shopt -q nocasematch && casematchOpt=1; - shopt -u nocasematch; - if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then - echo "${strippedName:33}"; - else - echo "$strippedName"; - fi; - if (( casematchOpt )); then - shopt -s nocasematch; - fi -} -installCheckPhase () -{ - - runHook preInstallCheck; - if [[ -z "${foundMakefile:-}" ]]; then - echo "no Makefile or custom installCheckPhase, doing nothing"; - else - if [[ -z "${installCheckTarget:-}" ]] && ! make -n ${makefile:+-f $makefile} "${installCheckTarget:-installcheck}" > /dev/null 2>&1; then - echo "no installcheck target in ${makefile:-Makefile}, doing nothing"; - else - local flagsArray=(${enableParallelChecking:+-j${NIX_BUILD_CORES}} SHELL="$SHELL"); - concatTo flagsArray makeFlags makeFlagsArray installCheckFlags installCheckFlagsArray installCheckTarget=installcheck; - echoCmd 'installcheck flags' "${flagsArray[@]}"; - make ${makefile:+-f $makefile} "${flagsArray[@]}"; - unset flagsArray; - fi; - fi; - runHook postInstallCheck -} -substituteAll () -{ - - local input="$1"; - local output="$2"; - local -a args=(); - _allFlags; - substitute "$input" "$output" "${args[@]}" -} -_addToEnv () -{ - - local depHostOffset depTargetOffset; - local pkg; - for depHostOffset in "${allPlatOffsets[@]}"; - do - local hookVar="${pkgHookVarVars[depHostOffset + 1]}"; - local pkgsVar="${pkgAccumVarVars[depHostOffset + 1]}"; - for depTargetOffset in "${allPlatOffsets[@]}"; - do - (( depHostOffset <= depTargetOffset )) || continue; - local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"; - if [[ -z "${strictDeps-}" ]]; then - local visitedPkgs=""; - for pkg in "${pkgsBuildBuild[@]}" "${pkgsBuildHost[@]}" "${pkgsBuildTarget[@]}" "${pkgsHostHost[@]}" "${pkgsHostTarget[@]}" "${pkgsTargetTarget[@]}"; - do - if [[ "$visitedPkgs" = *"$pkg"* ]]; then - continue; - fi; - runHook "${!hookRef}" "$pkg"; - visitedPkgs+=" $pkg"; - done; - else - local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"; - local pkgsSlice="${!pkgsRef}[@]"; - for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; - do - runHook "${!hookRef}" "$pkg"; - done; - fi; - done; - done -} -substituteAllStream () -{ - - local -a args=(); - _allFlags; - substituteStream "$1" "$2" "${args[@]}" -} -unpackPhase () -{ - - runHook preUnpack; - if [ -z "${srcs:-}" ]; then - if [ -z "${src:-}" ]; then - echo 'variable $src or $srcs should point to the source'; - exit 1; - fi; - srcs="$src"; - fi; - local -a srcsArray; - concatTo srcsArray srcs; - local dirsBefore=""; - for i in *; - do - if [ -d "$i" ]; then - dirsBefore="$dirsBefore $i "; - fi; - done; - for i in "${srcsArray[@]}"; - do - unpackFile "$i"; - done; - : "${sourceRoot=}"; - if [ -n "${setSourceRoot:-}" ]; then - runOneHook setSourceRoot; - else - if [ -z "$sourceRoot" ]; then - for i in *; - do - if [ -d "$i" ]; then - case $dirsBefore in - *\ $i\ *) - - ;; - *) - if [ -n "$sourceRoot" ]; then - echo "unpacker produced multiple directories"; - exit 1; - fi; - sourceRoot="$i" - ;; - esac; - fi; - done; - fi; - fi; - if [ -z "$sourceRoot" ]; then - echo "unpacker appears to have produced no directories"; - exit 1; - fi; - echo "source root is $sourceRoot"; - if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then - chmod -R u+w -- "$sourceRoot"; - fi; - runHook postUnpack -} -nixInfoLog () -{ - - _nixLogWithLevel 3 "$*" -} -_assignFirst () -{ - - local varName="$1"; - local _var; - local REMOVE=REMOVE; - shift; - for _var in "$@"; - do - if [ -n "${!_var-}" ]; then - eval "${varName}"="${_var}"; - return; - fi; - done; - echo; - echo "error: _assignFirst: could not find a non-empty variable whose name to assign to ${varName}."; - echo " The following variables were all unset or empty:"; - echo " $*"; - if [ -z "${out:-}" ]; then - echo ' If you do not want an "out" output in your derivation, make sure to define'; - echo ' the other specific required outputs. This can be achieved by picking one'; - echo " of the above as an output."; - echo ' You do not have to remove "out" if you want to have a different default'; - echo ' output, because the first output is taken as a default.'; - echo; - fi; - return 1 -} -printLines () -{ - - (( "$#" > 0 )) || return 0; - printf '%s\n' "$@" -} -substitute () -{ - - local input="$1"; - local output="$2"; - shift 2; - if [ ! -f "$input" ]; then - echo "substitute(): ERROR: file '$input' does not exist" 1>&2; - return 1; - fi; - local content; - consumeEntire content < "$input"; - if [ -e "$output" ]; then - chmod +w "$output"; - fi; - substituteStream content "file '$input'" "$@" > "$output" -} -updateAutotoolsGnuConfigScriptsPhase () -{ - - if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then - return; - fi; - for script in config.sub config.guess; - do - for f in $(find . -type f -name "$script"); - do - echo "Updating Autotools / GNU config script to a newer upstream version: $f"; - cp -f "/nix/store/kppfbp4x7mhfz1q5zswavxxxq71v2f7c-gnu-config-2024-01-01/$script" "$f"; - done; - done -} -_pruneLibtoolFiles () -{ - - if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then - return; - fi; - find "$prefix" -type f -name '*.la' -exec grep -q '^# Generated by .*libtool' {} \; -exec grep -q "^old_library=''" {} \; -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; -} -PATH="$PATH${nix_saved_PATH:+:$nix_saved_PATH}" -XDG_DATA_DIRS="$XDG_DATA_DIRS${nix_saved_XDG_DATA_DIRS:+:$nix_saved_XDG_DATA_DIRS}" - -eval "${shellHook:-}" -shopt -s expand_aliases - -exec /tmp/devenv-envclAfdo/script \ No newline at end of file diff --git a/.devenv/state/files.json b/.devenv/state/files.json deleted file mode 100644 index b4c7443fe..000000000 --- a/.devenv/state/files.json +++ /dev/null @@ -1 +0,0 @@ -{"managedFiles":[]} diff --git a/.devenv/state/tasks.db b/.devenv/state/tasks.db deleted file mode 100644 index ea9212c5733bdca68b9aa5662070a8a0f5cd9ab7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36864 zcmeI)O>Em#00(dO^|lpRF)=Pn~1F!z==q$d-D3;O9BIUjfGXWo4HA`<G>EW_*Wb zV>wzmJHGPK{Gq?EcYKxc!*Gy|&CK}Tue!2g>7xaYo=^5GsT7uq;<4tFxhX<>OS@eW zZ;0z;ZGC06uzrW!6z|N_lws#cMZ8@hr7}IL#iEzwb@p^@y`h*FJU8^vKeR|9NpdfIom+C}X4x!JM@pA*OM2C@GRuHSmE zAC~O660PPG(y+U8j@vXm$GO=VXLg><+Ks!j@wk_{(Q;h69hN9oTdJE|P1!XYwsZ2@e+=McY8Qf#eZA?>%w%ch1|3T$ z#}Of#?x;<3*Q?<4sG$SEc3j!A=)m#PS60Q1N?~>F^blCCuCI%wiZr~%(;&oYsjBWc zr-n{1mHz3gJ5H-kmWt)2VVS)&y{)S)uT{Mf+i(70z)r>A@=wM#660`BVo2P{m;n8m z4S7Gc5qkKdpEC4?009U<00Izz00bZa0SG_<0uX?}*$TYtV}qA7VJmQH`?u>~ePi0D zn@*+qM2b&vJW1sjv)RQg_lab0KKfAn@x|t!d&TFE>?hAY`Zn}Xm~Gw0Vq-Dk!Z zH6?T9^Ggpt{^{}L*W?NN^VKQZFJJU`hQ1IW009U<00Izz00bZa0SG_<0uVS?0^vX~ z+*?WT_W$WW{UbmC0uX=z1Rwwb2tWV=5P$##AaITay#0U7|IhIkjIKcd0uX=z1Rwwb z2tWV=5P$##sDQWs@4xsR6Mc`qAwU2E5P$##AOHafKmY;|fB*#k*8-hbD9j`~Y`7B% zY5Kly?=RAaIqJ=gnr>N1+iWKt`V2=sscf6|odea$T6?=YdqPG~_O|Z{X{Eirub6G+ zAkoX5ILe$87E(N)7L;r{ujCX}&E(Y#r>KgN&Koo~n^kyaLCd9-Y>GFGoFJ=0Ce16V zwxBDST)s2ShM8<9GSV{dX`jxbYU#4w+8t?}%J1LfYjsU9?0PP1TN#sYZwd9fVDX&g zY_$iC>*i1N^BY{=kn@URXxX%q(>Okt$!mFDFjPa%@F_**bV1;BJ+1NrujCa@;B)zO zN>%bgZXuKAy#0TFbd8CAM&A%1009U<00Izz00bZa0SG_<0uXp9fz2SD?ECs_5dY~+ zpREMx3df-6qZNvg6@-7jyb%{2%-OXaB{a1rUG$1Rwwb2tWV=5P$##An+;)ylVUZ Fe*qA0soVen diff --git a/.devenv/task-names.txt b/.devenv/task-names.txt deleted file mode 100644 index be2db38fe..000000000 --- a/.devenv/task-names.txt +++ /dev/null @@ -1,5 +0,0 @@ -devenv:container:copy -devenv:enterShell -devenv:enterTest -devenv:files -devenv:files:cleanup \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1c0a1e94b..929b85093 100644 --- a/.gitignore +++ b/.gitignore @@ -52,6 +52,9 @@ Thumbs.db # Local agent config (not part of the course) .claude/ +# Devenv env +.devenv/ + # NOTE: deliberately NOT ignored, because students commit them as lab evidence: # submissions/labN.md (lab reports) # .github/workflows/*.yml (Lab 3 CI) From 7ead78844e5fd3c9597f01cb066bab728c5bffa2 Mon Sep 17 00:00:00 2001 From: GrandAdmiralBee Date: Tue, 23 Jun 2026 23:37:00 +0300 Subject: [PATCH 5/5] lab(lab6): multi-stage Dockerfile + compose + hardening Signed-off-by: GrandAdmiralBee --- app/Dockerfile | 35 +++ app/cmd/healthcheck/main.go | 23 ++ compose.yaml | 38 +++ submissions/lab6.md | 516 ++++++++++++++++++++++++++++++++++++ 4 files changed, 612 insertions(+) create mode 100644 app/Dockerfile create mode 100644 app/cmd/healthcheck/main.go create mode 100644 compose.yaml create mode 100644 submissions/lab6.md diff --git a/app/Dockerfile b/app/Dockerfile new file mode 100644 index 000000000..56f58dfac --- /dev/null +++ b/app/Dockerfile @@ -0,0 +1,35 @@ +# syntax=docker/dockerfile:1.7 + +# Stage 1: builder +FROM golang:1.24.13-alpine AS builder +WORKDIR /src + +# Layer-cache: dependencies before source +COPY go.mod ./ +RUN go mod download + +COPY . . + +ENV CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 + +RUN go build -trimpath -ldflags='-s -w' -o /out/quicknotes . \ + && go build -trimpath -ldflags='-s -w' -o /out/healthcheck ./cmd/healthcheck \ + && mkdir -p /out/data + +# Stage 2: runtime — distroless static, nonroot +FROM gcr.io/distroless/static-debian12:nonroot + +COPY --from=builder /out/quicknotes /quicknotes +COPY --from=builder /out/healthcheck /healthcheck +COPY --from=builder /src/seed.json /seed.json +COPY --from=builder --chown=65532:65532 /out/data /data + +ENV ADDR=:8080 \ + DATA_PATH=/data/notes.json \ + SEED_PATH=/seed.json + +EXPOSE 8080 +USER nonroot:nonroot +ENTRYPOINT ["/quicknotes"] diff --git a/app/cmd/healthcheck/main.go b/app/cmd/healthcheck/main.go new file mode 100644 index 000000000..52718246c --- /dev/null +++ b/app/cmd/healthcheck/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "net/http" + "os" + "time" +) + +func main() { + url := os.Getenv("HC_URL") + if url == "" { + url = "http://127.0.0.1:8080/health" + } + c := http.Client{Timeout: 2 * time.Second} + r, err := c.Get(url) + if err != nil { + os.Exit(1) + } + r.Body.Close() + if r.StatusCode != http.StatusOK { + os.Exit(1) + } +} diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 000000000..a238467cc --- /dev/null +++ b/compose.yaml @@ -0,0 +1,38 @@ +services: + quicknotes: + build: + context: ./app + dockerfile: Dockerfile + image: quicknotes:lab6 + ports: + - "127.0.0.1:8080:8080" + environment: + ADDR: ":8080" + DATA_PATH: "/data/notes.json" + SEED_PATH: "/seed.json" + volumes: + - quicknotes-data:/data + healthcheck: + test: ["CMD", "/healthcheck"] + interval: 10s + timeout: 3s + retries: 3 + start_period: 5s + restart: unless-stopped + + # Bonus: 6 hardening defaults: + # nonroot (matches distroless`:nonroot`) + # root filesystem is read-only + # scratch space for runtime; /data stays RW + # drop every Linux capability + user: "65532:65532" + read_only: true + tmpfs: + - /tmp + cap_drop: + - ALL + security_opt: + - "no-new-privileges:true" + +volumes: + quicknotes-data: diff --git a/submissions/lab6.md b/submissions/lab6.md new file mode 100644 index 000000000..412111316 --- /dev/null +++ b/submissions/lab6.md @@ -0,0 +1,516 @@ +# Lab 6 — Containers: Dockerize QuickNotes + +**Author:** Karim Abdulkin (@GrandAdmiralBee) +**Branch:** `feature/lab6` +**Container runtime:** podman 5.x with `dockerCompat = true` (NixOS); commands run via the `docker` shim, OCI semantics identical to Docker 28. + +--- + +## Task 1 — Multi-stage Dockerfile, ≤ 25 MB + +### `app/Dockerfile` + +```dockerfile +# syntax=docker/dockerfile:1.7 + +# Stage 1: builder +FROM golang:1.24.13-alpine AS builder +WORKDIR /src + +# Layer-cache: dependencies before source +COPY go.mod ./ +RUN go mod download + +COPY . . + +ENV CGO_ENABLED=0 \ + GOOS=linux \ + GOARCH=amd64 + +RUN go build -trimpath -ldflags='-s -w' -o /out/quicknotes . \ + && go build -trimpath -ldflags='-s -w' -o /out/healthcheck ./cmd/healthcheck \ + && mkdir -p /out/data + +# Stage 2: runtime — distroless static, nonroot +FROM gcr.io/distroless/static-debian12:nonroot + +COPY --from=builder /out/quicknotes /quicknotes +COPY --from=builder /out/healthcheck /healthcheck +COPY --from=builder /src/seed.json /seed.json +COPY --from=builder --chown=65532:65532 /out/data /data + +ENV ADDR=:8080 \ + DATA_PATH=/data/notes.json \ + SEED_PATH=/seed.json + +EXPOSE 8080 +USER nonroot:nonroot +ENTRYPOINT ["/quicknotes"] +``` + +The Dockerfile also ships a tiny **`app/cmd/healthcheck/main.go`** (~20 LoC, no deps) — a static Go binary that `GET`s `/health` and exits 0/1. +It's copied alongside `/quicknotes` so the distroless image can be healthchecked from inside (see Task 2 design question **e**). + +### Image size + composition + +```console +$ docker images | grep -E 'quicknotes|golang|distroless' +localhost/quicknotes lab6 ec82f821544e 14.6 MB +docker.io/library/golang 1.24.13-alpine 88aa171b8c32 274 MB +gcr.io/distroless/static-debian12 nonroot 8457fe6a812e 3.15 MB +``` + +Final image: **14.6 MB** vs the 25 MB cap — fully under, with ~10 MB headroom for future dependencies. Composition: +- Distroless static base: 3.15 MB +- Both Go binaries (`quicknotes` + `healthcheck`) + `seed.json` + `/data` skeleton: ~11.4 MB + +The 274 MB builder image is left in the *first stage* and never enters the runtime layer — that's multi-stage doing its job. + +### Image inspect + +```console +$ docker inspect quicknotes:lab6 | jq '.[0].Config | {User, ExposedPorts, Entrypoint, Env}' +{ + "User": "nonroot:nonroot", + "ExposedPorts": { "8080/tcp": {} }, + "Entrypoint": [ "/quicknotes" ], + "Env": [ + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", + "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt", + "ADDR=:8080", + "DATA_PATH=/data/notes.json", + "SEED_PATH=/seed.json" + ] +} +``` + +All Task 1 boxes ticked: `User: nonroot:nonroot` (not root), `Entrypoint` is exec form, `EXPOSE 8080` is declared, env defaults present, +`SSL_CERT_FILE` comes from the distroless base. + +### Smoke test + +```console +$ docker run -d --name qn-smoketest -p 18080:8080 quicknotes:lab6 +b5cd70b9b07a32ecb1ecb6b4c78e0b06d59f945444096c7c981379ef27930f52 + +$ docker ps | grep qn-smoketest +b5cd70b9b07a localhost/quicknotes:lab6 … Up 2 seconds 0.0.0.0:18080->8080/tcp qn-smoketest + +$ curl -s http://localhost:18080/health +{"notes":4,"status":"ok"} + +$ docker logs qn-smoketest +2026/06/23 20:00:23 quicknotes listening on :8080 (notes loaded: 4) +``` + +The image is **self-sufficient** — `/data` is pre-created in the build with nonroot ownership, so `docker run` works without a mounted volume. +Compose's named volume mounts on top later, overlaying the empty `/data` with a Docker-managed RW volume. + +### Design questions + +#### a) Why does layer-order matter? + +Each Dockerfile instruction creates a layer; layers are content-addressed by the instruction + the files it operated on. +A subsequent build with the same instruction + same inputs hits the cache and skips work. +A build that's just edited a Go file should not have to re-download dependencies. + +**The two orderings:** + +```dockerfile +# (A) bad — every source edit invalidates `go mod download` +COPY . . +RUN go mod download && go build ... +``` + +```dockerfile +# (B) good — only go.mod/go.sum edits invalidate `go mod download` +COPY go.mod go.sum ./ +RUN go mod download +COPY . . +RUN go build ... +``` + +Why (B) wins: the `COPY . .` layer changes whenever any file in `app/` changes (including `handlers.go`). +With ordering (A), that change cascades into the `go mod download` layer — invalidating it, forcing re-download of every module on every code edit. +With ordering (B), `go.mod`/`go.sum` are isolated; source edits don't touch the download layer; cache stays warm. + +For **QuickNotes today**, the savings are nominal — the module has zero external deps, so `go mod download` is a ~50 ms no-op. +But the pattern is correct now so the day a `go get github.com/gorilla/mux` lands, the cache behaviour doesn't silently regress. +Container layer-order is one of those costs you pay once and forget — paying it late is harder than paying it early. + +(I used `COPY go.mod ./` only, no `go.sum`, because the project has no transitive deps yet and `go.sum` doesn't exist. The wildcard `COPY go.mod go.sum* ./` would be necessary in a Dockerfile portable across modules where `go.sum` may or may not be present.) + +#### b) Why `CGO_ENABLED=0`? + +Without it, the Go compiler links against the system's `libc` (glibc on Debian builders, musl on alpine), producing a **dynamically linked** binary. The binary needs `ld-linux-x86-64.so.2` and `libc.so.6` at runtime. + +`gcr.io/distroless/static-debian12` is the **static** variant — it doesn't ship the dynamic linker or any `libc.so`. A dynamically linked binary in that image fails at exec time: + +``` +exec /quicknotes: no such file or directory +``` + +…and the error is especially confusing because `/quicknotes` clearly **is** there — but the kernel is reporting that the linker `/lib64/ld-linux-x86-64.so.2` isn't, +and Linux conflates the two error paths. `CGO_ENABLED=0` tells Go to use its own runtime for syscalls and `net`/`os/user` lookups (the parts that historically went through libc), +producing a fully self-contained binary that distroless-static can exec directly. + +If you wanted CGO (e.g., for SQLite via the standard driver), you'd use `gcr.io/distroless/cc-debian12` instead — same idea, but ships libc. + +#### c) What is `gcr.io/distroless/static-debian12:nonroot`? + +A minimal runtime image built by Google's distroless project. The `:nonroot` tag pre-sets `USER 65532:65532` (`nonroot:nonroot`). What's in it: + +- `ca-certificates` for outbound TLS +- `/etc/passwd`, `/etc/group`, `/etc/nsswitch.conf` so the runtime can resolve users and DNS +- `/etc/os-release`, tzdata +- A `/home/nonroot` directory owned by the nonroot user +- Almost literally nothing else + +What's **not** in it: + +- No shell — no `sh`, `bash`, `busybox` +- No package manager — no `apt`, `apk`, `yum` +- No debug tools — no `curl`, `wget`, `ps`, `ls`, `cat`, `nc` +- No `libc` — this is the *static* variant; the `cc` variant ships glibc + +**Why this matters for CVEs:** every package in an image is a potential CVE source. `ubuntu:24.04` has ~120 installed packages out of the box; +`debian:12-slim` has ~80; `gcr.io/distroless/static-debian12` has only **four**. When a new CVE drops for `libssl-dev` or `bash`, your `ubuntu`-based image is exposed and needs a rebuild; +your distroless-static image isn't because those packages aren't there. +That's exactly what Trivy showed below: the OS layer scored 0 HIGH/CRITICAL even on a multi-month-old base — there is barely any attack surface to score against. + +#### d) `-ldflags='-s -w'` and `-trimpath` + +- **`-s`** — strip the **symbol table**. Symbol tables map function addresses to function names. Without them, `nm`, `objdump -d`, and panics with `runtime/debug.Stack()` can't translate addresses back into names. +- **`-w`** — drop the **DWARF debug information**. Without it, `delve`/`gdb` can't step through the binary or show variable names, and stack traces in panics still work but won't include file:line annotations from the debugger. + +Combined, `-s -w` typically shaves **25-30%** off binary size on a small Go program — for QuickNotes, the difference was roughly 7-8 MB → 5-6 MB. + +- **`-trimpath`** — rewrites every embedded path in the binary to be relative to the module root. Without it, an absolute build path like `/home/karim/Dev/DevOps-Intro/app/handlers.go:42` ends up burned into the binary metadata. With it, that becomes `quicknotes/handlers.go:42`. +Trade-off: **build reproducibility** — two students building the same commit on different machines now produce byte-identical binaries (modulo Go version + arch); +also less leaked info about build environment. + +The cost of all three: **harder post-mortem debugging from production binaries**. Production stack traces lose file:line annotations; +`delve` can't introspect a stripped binary. The conventional mitigation is to ship the *unstripped* binary in CI artefacts (for offline debug), +and the stripped binary in the deployed image — `-ldflags='-s -w'` is a runtime image flag, not a CI artefact flag. + +--- + +## Task 2 — Compose + healthcheck + persistent volume + +### `compose.yaml` + +```yaml +services: + quicknotes: + build: + context: ./app + dockerfile: Dockerfile + image: quicknotes:lab6 + ports: + - "127.0.0.1:8080:8080" + environment: + ADDR: ":8080" + DATA_PATH: "/data/notes.json" + SEED_PATH: "/seed.json" + volumes: + - quicknotes-data:/data + healthcheck: + test: ["CMD", "/healthcheck"] + interval: 10s + timeout: 3s + retries: 3 + start_period: 5s + restart: unless-stopped + + # Bonus: 6 hardening defaults (Lecture 6) + user: "65532:65532" + read_only: true + tmpfs: + - /tmp + cap_drop: + - ALL + security_opt: + - "no-new-privileges:true" + +volumes: + quicknotes-data: +``` + +Port is bound to `127.0.0.1` (consistent with Lab 5 — no need to expose to LAN for a local dev exercise). `start_period: 5s` gives the Go binary time to load seed.json before the first healthcheck fires. + +### Healthcheck status + +```console +$ docker inspect "$CID" --format '{{ .State.Health.Status }}' +healthy + +$ docker inspect "$CID" --format '{{ json .State.Health }}' | jq '.Status, .FailingStreak, (.Log | map({End, ExitCode}))' +"healthy" +0 +[ + { "End": "2026-06-23T23:05:02.641312544+03:00", "ExitCode": 0 }, + { "End": "2026-06-23T23:05:13.640557182+03:00", "ExitCode": 0 }, + { "End": "2026-06-23T23:05:24.643340397+03:00", "ExitCode": 0 }, + { "End": "2026-06-23T23:05:35.632956826+03:00", "ExitCode": 0 }, + { "End": "2026-06-23T23:05:46.634184003+03:00", "ExitCode": 0 } +] +``` + +5 consecutive checks, all `ExitCode: 0`, status `healthy`, zero failing streak. Each call took ~10 ms (timestamps confirm). + +### Persistence test + +```console +$ docker compose up --build -d +[+] up 4/4 + ✔ Image quicknotes:lab6 Built 18.6s + ✔ Network devops-intro_default Created 0.0s + ✔ Volume devops-intro_quicknotes-data Created 0.0s + ✔ Container devops-intro-quicknotes-1 Started 0.3s + +$ curl -X POST -H 'Content-Type: application/json' \ + -d '{"title":"durable","body":"survive a restart"}' \ + http://localhost:8080/notes +{"id":5,"title":"durable","body":"survive a restart","created_at":"2026-06-23T20:03:56.200138623Z"} + +$ curl -s http://localhost:8080/notes | grep -q durable && echo "PRESENT-1" +PRESENT-1 + +$ docker compose down # NOT `down -v` +[+] down 2/2 + ✔ Container devops-intro-quicknotes-1 Removed + ✔ Network devops-intro_default Removed + # Volume devops-intro_quicknotes-data NOT removed + +$ docker compose up -d && sleep 5 +[+] up 2/2 + ✔ Network devops-intro_default Created + ✔ Container devops-intro-quicknotes-1 Started + +$ curl -s http://localhost:8080/notes | grep -q durable && echo "PRESENT-2 (survived down/up)" +PRESENT-2 (survived down/up) + +$ docker compose down -v # explicit volume wipe +[+] down 3/3 + ✔ Container devops-intro-quicknotes-1 Removed + ✔ Volume devops-intro_quicknotes-data Removed + ✔ Network devops-intro_default Removed + +$ docker compose up -d && sleep 5 + +$ curl -s http://localhost:8080/notes | grep -q durable && echo "STILL THERE (bug)" || echo "GONE (correct)" +GONE (correct) +``` + +`PRESENT-1 → PRESENT-2 → GONE` — the named volume survives `down`, the volume dies on `down -v`. After the wipe, only the 4 seed notes from `/seed.json` come back, as expected. + +### Design questions + +#### e) Distroless has no shell. How do you healthcheck it? + +The four options listed in the lab: + +| Option | Cost | When it's right | +|-------------------------------------|-----------------------------------------------|-----------------| +| HTTP via a sidecar | Whole extra container per service; orchestration complexity | When the app is closed-source and changing it isn't on the table | +| `wget`-only debug image variant | Two images to build/scan/push; drift between them | When you need the same scaffolding for `kubectl exec` debugging | +| "Process is alive" (no HEALTHCHECK) | Doesn't actually check serving health — process can be deadlocked while running | Quick prototypes, never production | +| **Use a binary already in the image** | One extra small binary to build and copy | The pragmatic default for Go services | + +I picked **option 4**: build a tiny static `healthcheck` binary alongside `quicknotes` in the same multi-stage Dockerfile, copy it to `/healthcheck`, and reference it from compose's `healthcheck.test: ["CMD", "/healthcheck"]`. + +**Why this wins for QuickNotes:** +- The whole thing is ~20 lines of Go, zero external deps. (`app/cmd/healthcheck/main.go`.) +- Adds ~3 MB to the image (one more static Go binary), but the budget was 25 MB and we land at 14.6 MB. +- The semantics match the app: same TCP stack, same kernel-level routing, same `/health` endpoint — if the binary's HTTP GET succeeds, the app is genuinely serving. +- Static: no glibc / dynamic linker, works in distroless-static unmodified. +- No external attack surface added — the healthcheck doesn't listen on a port, doesn't read disk, doesn't touch `/data`. + +**What it doesn't catch:** if the app crashes between the `/health` route handler and the data path (e.g., note creation hangs but `/health` still returns 200), the healthcheck is happy but the app is broken. Real production setups add a deeper "synthetic" endpoint that exercises the storage layer — out of scope for this lab. + +#### f) Why does `volumes: [quicknotes-data:/data]` survive `docker compose down`? + +Named volumes are *first-class objects* in Docker, owned by the compose **project** rather than any individual container. The project name is `devops-intro` (the working directory), so the actual volume name is `devops-intro_quicknotes-data`. Container lifecycle (create/stop/remove) is orthogonal to volume lifecycle. + +`docker compose down` removes containers, networks, and (project-level) configs — but **not** volumes, by design. The reason is exactly the use case we just demonstrated: an operator needs to be able to drop and recreate the app without losing user data. + +**What does destroy it:** +- `docker compose down -v` — the explicit "yes, I want my data gone" flag. +- `docker volume rm devops-intro_quicknotes-data` — manual delete. +- `docker volume prune` — prunes dangling (unreferenced) volumes; if the compose stack is down, the volume is dangling and gets caught. +- Backend storage failure on the host (the volume lives in `/var/lib/containers/storage/volumes/...` on podman). + +The takeaway: `down` is *idempotent* and *safe* (data preserved); `down -v` and `prune` are *destructive* — make them harder to type by accident in production scripts. + +#### g) `depends_on` without `condition: service_healthy` + +`depends_on: [db]` without `condition` only waits for the **container** to be *started* — that is, the Docker daemon has created it and exec'd its entrypoint. It does **not** wait for the process inside to be ready to serve. + +The classic failure mode: app A `depends_on: [db]`. Docker brings up `db`'s container in ~200 ms. App A's container starts at ~200 ms + 1, tries `pg.Connect("db:5432")` immediately, but Postgres is still in its boot sequence (~5-15 s). App A gets `connection refused`, panics, container crash-loops. Docker's restart policy may or may not paper over it depending on how robust the retry is. + +The fix: + +```yaml +depends_on: + db: + condition: service_healthy +``` + +…with a `healthcheck` defined on `db`. Now App A waits for the *health* signal, not just the *exec* signal. + +--- + +## Bonus — 6 hardening defaults + Trivy + +### Per-default verification + +#### 1. `USER nonroot` (image-level) + +```console +$ docker inspect quicknotes:lab6 --format '{{ .Config.User }}' +nonroot:nonroot +``` + +Backed up at runtime by `user: "65532:65532"` in compose — `nonroot` resolves to UID 65532 in the distroless base. + +#### 2. Distroless base — no shell + +```console +$ docker compose exec quicknotes sh -c 'echo this should fail' +Error: crun: executable file `sh` not found in $PATH: No such file or directory: + OCI runtime attempted to invoke a command that was not found +EXEC sh FAILED — expected + +$ docker compose exec quicknotes /bin/sh +Error: crun: executable file `/bin/sh` not found: + No such file or directory: + OCI runtime attempted to invoke a command that was not found +/bin/sh FAILED — expected +``` + +Both `sh` and `/bin/sh` resolve to nothing — the runtime image genuinely doesn't contain any shell. A would-be attacker who finds an RCE in QuickNotes can't `system('curl … | sh')` because `sh` doesn't exist. + +#### 3. Capabilities dropped + +```console +$ docker inspect "$CID" --format '{{ .HostConfig.CapDrop }}' +[CAP_CHOWN CAP_DAC_OVERRIDE CAP_FOWNER CAP_FSETID CAP_KILL CAP_NET_BIND_SERVICE + CAP_SETFCAP CAP_SETGID CAP_SETPCAP CAP_SETUID CAP_SYS_CHROOT] +``` + +Podman expands `cap_drop: [ALL]` into the explicit list of default container capabilities — functionally identical to `[ALL]` (every default capability is dropped), the format just differs from Docker. None of these are added back via `cap_add`, so the container has the **empty** capability set in practice. + +(QuickNotes is a userspace HTTP server on port 8080 — it needs zero capabilities. If we'd tried port 80, we'd need `cap_add: [NET_BIND_SERVICE]`, but loopback-bound 8080 doesn't.) + +#### 4. Read-only root filesystem + +```console +$ docker inspect "$CID" --format '{{ .HostConfig.ReadonlyRootfs }}' +true +``` + +Enforcement proof — verified via an Alpine sidecar that shares the target container's PID/network namespaces but mounts its own read-only rootfs (distroless has no `touch`, so we can't test from inside): + +```console +$ docker run --rm --pid="container:$CID" --net="container:$CID" \ + --user 65532 --read-only \ + alpine sh -c 'touch /etc/test 2>&1 || echo "WRITE BLOCKED — expected"' +touch: /etc/test: Read-only file system +WRITE BLOCKED — expected +``` + +The app still needs *somewhere* to write, which is what `/tmp` (tmpfs) and `/data` (named volume) are for — both are RW mountpoints over the otherwise read-only rootfs. + +#### 5. `no-new-privileges` + +```console +$ docker inspect "$CID" --format '{{ .HostConfig.SecurityOpt }}' +[no-new-privileges] +``` + +This sets the kernel-level `NO_NEW_PRIVS` bit on the container's processes. Any future `setuid` binary the container exec's *cannot* gain privileges from its file mode bits — `sudo`, `su`, `mount`-like helpers are neutered. Combined with `USER nonroot`, this prevents the classic "vulnerability → setuid binary → root" escalation chain. + +#### 6. Trivy scan — before / after Go bump + +Initial scan with `golang:1.24.5-alpine` builder (the version we used in Lab 5 for consistency): + +``` +/img.tar (debian 12.14) +======================= +Total: 0 (HIGH: 0, CRITICAL: 0) + +healthcheck (gobinary) +====================== +Total: 16 (HIGH: 15, CRITICAL: 1) + +quicknotes (gobinary) +===================== +Total: 16 (HIGH: 15, CRITICAL: 1) +``` + +Distroless gave us **zero** OS-level vulnerabilities at HIGH/CRITICAL — that's the value of a 4-package base. But both Go binaries each had 16 stdlib CVEs because `golang:1.24.5` was 8 patch releases stale. + +After bumping the Dockerfile builder to `golang:1.24.13-alpine`: + +``` +/img.tar (debian 12.14) +======================= +Total: 0 (HIGH: 0, CRITICAL: 0) + +healthcheck (gobinary) +====================== +Total: 13 (HIGH: 13, CRITICAL: 0) + +quicknotes (gobinary) +===================== +Total: 13 (HIGH: 13, CRITICAL: 0) +``` + +| Surface | Before (Go 1.24.5) | After (Go 1.24.13) | Δ | +|-------------------|-------------------:|-------------------:|-------------:| +| OS layer | 0H / 0C | 0H / 0C | unchanged | +| `healthcheck` bin | 15H / 1C | 13H / 0C | −2H / −1C | +| `quicknotes` bin | 15H / 1C | 13H / 0C | −2H / −1C | +| **Total H+C** | **32** | **26** | **−6 (−19%)** | + +Image size: **14.6 MB** before, **14.6 MB** after — the bump didn't bloat anything. + +**What the remaining 13 HIGH's tell us:** every one of them is in Go `stdlib` and the "Fixed Version" column points exclusively to **1.25.x or 1.26.x**, with no 1.24.x backport. Translation: Go 1.24 has effectively entered **security-EOL** for these CVEs — upstream isn't backporting fixes to the 1.24 line anymore, so further patch-level bumps within 1.24 won't close them. The next mitigation is a *minor* bump to 1.25.x — but Lab 6 acceptance pins Go 1.24, so that bump belongs in a follow-up PR. + +**The supply-chain lesson here is the whole point of the bonus** — pinning gives you reproducibility (the Lab 5 design Q d benefit), but turns into a *liability* the moment upstream ships a security release you haven't merged. The system answer is automation: Renovate / Dependabot raises the PR, Trivy in CI gates merge on HIGH/CRITICAL, the bump ships continuously. Without that pipeline, you're one stale dependency away from owning every published Go CVE — exactly what the 1.24.5 baseline showed. + +### Most security per line of YAML + +If I had to rank the six by *security delivered ÷ YAML cost*, my ordering is: + +1. **`USER nonroot` + `cap_drop: [ALL]`** (tied) — these two together convert "RCE inside the container" from a kernel-level threat into "userspace nuisance restricted to UID 65532 with no capabilities". One Dockerfile line + 2 compose lines, and the worst-case payload of the worst-case exploit drops by an order of magnitude. The "must" pair. +2. **`read_only: true` + tmpfs** — three compose lines that prevent attackers from persisting on the filesystem (writing webshells, droppers, modifying binaries). Forces them to live in memory. Combined with `cap_drop`, even a kernel exploit can't pivot to ring 0. +3. **`no-new-privileges`** — one line; closes the escalation paths via setuid binaries. Cheap, but mostly redundant in an image that already drops every capability and has no setuid binaries to begin with — the value is **defense in depth** for the day you accidentally add `sudo` to debug an issue and forget to remove it. +4. **Distroless base** — biggest *latent* win, but it's an image-build choice, not a YAML line. Already baked into Task 1. +5. **Trivy in CI** — not a YAML line in `compose.yaml` at all (it's a CI workflow step, coming in Lab 9), but in raw "CVEs caught per line of CI YAML" it's probably first overall. The bonus's Trivy run already paid for itself by surfacing the Go-bump-needed signal. + +The pair I'd never ship without: **`USER nonroot` + `cap_drop: [ALL]`**. Those two close the most common container-escape paths from CVE writeups. + +--- + +## Pitfalls I hit (for the next student with Russian Internet or Podman instead of Docker) + +- **`golang:1.24.5-alpine3.20` doesn't exist on Docker Hub** — golang only ships *one* alpine tag per Go version (the alpine current at release time). Use `golang:1.24.X-alpine` (no `3.X`) unless you've verified the exact tag exists. +- **`docker run` with distroless and no `-v` fails** — without a writable `/data` directory in the image, QuickNotes panics in `os.MkdirAll(dirname("/data/notes.json"), 0o755)` because nonroot can't write to `/`. Fix: pre-create `/data` in the Dockerfile with `COPY --chown=65532:65532 ... /data`. Compose's named volume papers over it, but `docker run` on the bare image needs the precreated dir. +- **Podman `docker.sock` doesn't exist** — Trivy's standard `docker run -v /var/run/docker.sock:...` doesn't work. Workaround: `docker save quicknotes:lab6 -o /tmp/img.tar` then `trivy image --input /tmp/img.tar`. Runtime-agnostic. +- **`docker images foo:bar baz:qux` (multiple args) fails under podman's docker-compat** — podman only accepts one repo arg. Use `| grep -E 'foo|baz'` instead. +- **proxychains doesn't route `docker pull`** — daemonless or not, podman spawns helper processes that escape `LD_PRELOAD`. Use `HTTPS_PROXY=socks5://...` env vars on the docker/podman CLI directly. + +--- + +## Checklist + +- [x] `app/Dockerfile` — multi-stage, `1.24.13-alpine` builder, distroless-static-nonroot runtime, ≤25 MB (actual: 14.6 MB) +- [x] `app/cmd/healthcheck/main.go` — tiny static Go healthcheck binary +- [x] `compose.yaml` — named volume, healthcheck, env, restart, ports loopback-bound +- [x] All 4 Task 1 design questions answered +- [x] Persistence test PRESENT-1 → PRESENT-2 → GONE +- [x] All 3 Task 2 design questions answered +- [x] Bonus: all 6 hardening defaults applied + per-default verification commands captured +- [x] Trivy ran (before + after Go bump), supply-chain lesson documented +- [x] Commits signed (`git log --show-signature`)