{
  "slug": "cargo-lambda-build-accepts-environment-variables-7208f8303734",
  "title": "cargo-lambda build accepts environment variables",
  "tools": [
    "cargo-lambda"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-02-15T19:11:15.000Z",
  "announced_at": "2026-02-15T19:11:15.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When a build needs environment variables, pass them with `--env-var` or load them with `--env-file`; CLI values override metadata, and `--env-var` overrides `--env-file`.",
    "examples": [
      "cargo lambda build --env-var <KEY>=<VALUE>",
      "cargo lambda build --env-file <PATH>",
      "[package.metadata.lambda.build]\nenv_var = [\"<KEY>=<VALUE>\"]\nenv_file = \"<PATH>\""
    ],
    "gotchas": [
      "Version: v1.9.0",
      "--env-var <KEY>=<VALUE>: Sets environment variables for the cargo build process. Repeat the flag or give comma-separated pairs.",
      "--env-file <PATH>: Loads environment variables from a file, one `KEY=VALUE` entry per line.",
      "env_var: Cargo metadata array of `KEY=VALUE` strings for build-time variables.",
      "env_file: Cargo metadata path to an environment file for the build.",
      "Environment files should contain one `KEY=VALUE` entry per line.",
      "The stated precedence is environment file, then command-line `--env-var`; CLI values override metadata."
    ]
  },
  "why_it_matters": "Build a project that needs configured environment variables during the cargo build process.",
  "sources": [
    "https://github.com/cargo-lambda/cargo-lambda/releases/tag/v1.9.0",
    "https://github.com/cargo-lambda/cargo-lambda/pull/917",
    "https://github.com/cargo-lambda/cargo-lambda/blob/v1.9.0/docs/commands/build.md"
  ],
  "rank": 0.98034,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1b-tools-20261017",
    "verdict_id": "wave1b-tools-20261017:wave1b-tools-20261017-755fa2cb01364297-9:gate",
    "evidence_hash": "aa219556fc6395aa6acfa392dbfa7af6b7cb3cfcb85a92922d99c616f256163a"
  },
  "review": {
    "draft_hash": "aca4e4e79d007378412e3fb9235b8bb625cc85c0ddcdc254d88f8f5c5a13ba95",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-tools-20261017:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.98 >= 0.9; 2 needed) and Jev gave 0.79 (>= 0.6 needed)."
  }
}
