Add SNAPCRAFT_PROJECT_DIR environment variable.
Metadata
Current evaluation
Merged after approval and CI checks. Adds SNAPCRAFT_PROJECT_DIR environment variable pointing to the project directory. Resolves Launchpad bug 1824417. Reviewer noted minor coverage decrease and suggested follow-up integration tests.
Suggested action: —
No scores available.
Issue body
New variable pointing to the project directory, the directory
the snapcraft command was run from. This variable should be correct
regardless of what build environment (container or host) the build
is running in. This allows easy reference to supporting script or
other resources inside snapcraft.yaml overrides sections.
Fixes https://bugs.launchpad.net/snapcraft/+bug/1824417
- [X] Have you followed the [guidelines for contributing](https://github.com/snapcore/snapcraft/blob/master/CONTRIBUTING.md)?
- [X] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [X] Have you successfully run `./runtests.sh static`?
- [X] Have you successfully run `./runtests.sh tests/unit`?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged after approval and CI checks. Adds SNAPCRAFT_PROJECT_DIR environment variable pointing to the project directory. Resolves Launchpad bug 1824417. Reviewer noted minor coverage decrease and suggested follow-up integration tests. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged into master, adding the SNAPCRAFT_PROJECT_DIR environment variable to reference the project directory in snapcraft.yaml overrides. Resolves bug #1824417. Maintainer requested follow-up integration tests. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged. Adds the SNAPCRAFT_PROJECT_DIR environment variable to expose the project directory during builds, resolving bug #1824417. Maintainer requested follow-up integration tests. Code coverage impact is negligible. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2122 many: introduce variables for part src and build | snapcraft | merged | Merged following approval. Introduces new environment variables and replacements for part src and build directories, resolving LP #1763028. Consolidates SNAPCRAFT_* environment handling into a single location. Approved by one reviewer with passing CI checks. | |
| #5396 Export variables to testing environment | snapcraft | open | Enhancement to export SNAPCRAFT_PROJECT_DIR, SNAPCRAFT_PROJECT_VERSION, and CRAFT_ARCH_BUILD_FOR into the testing environment so test projects can reference the generated snap path. Triaged by maintainer; no implementation or PR found in repo. | |
| #3208 snap: set PATH for snapcraft command | snapcraft | merged | Merged to configure the PATH for the snapcraft command in the build environment, ensuring parity with launchpad buildd and destructive-mode instances. Approved, passed CI, and modified three files. | |
| #4041 utils: log envvar SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT when invalid | snapcraft | merged | Merged into main. Adds logging for the SNAPCRAFT_MAX_PARALLEL_BUILD_COUNT environment variable when invalid. Approved by reviewer, passed CI, and contains no functional changes. |