Conversation
|
@microsoft-github-policy-service agree |
Package apm with uv2nix so it can be run via `nix run github:microsoft/apm` on Linux and macOS. Add a GitHub Actions workflow using magic-nix-cache for fast CI builds.
There was a problem hiding this comment.
Pull request overview
Adds Nix flake packaging for APM so it can be executed via nix run github:microsoft/apm, and documents the new install path.
Changes:
- Introduces
flake.nix/flake.lockusinguv2nix+pyproject-nixto build a Python 3.12 virtualenv that runsapm. - Adds a GitHub Actions workflow to build and smoke-run the flake on CI.
- Documents Nix installation in the docs site (and also in README).
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Adds Nix to the “Other install methods” snippet. |
| flake.nix | Defines the flake outputs for building/running APM via Nix using uv2nix. |
| flake.lock | Pins Nix flake inputs for reproducible builds. |
| docs/src/content/docs/getting-started/installation.md | Documents Nix install path for macOS/Linux. |
| .gitignore | Ignores Nix result output artifact. |
| .github/workflows/nix.yml | Adds CI job to nix build and run apm --version from the flake. |
| # Nix | ||
| nix run github:microsoft/apm |
There was a problem hiding this comment.
Per the repo documentation rules, changes to README.md require explicit approval before merging. Please confirm that README should include Nix install instructions (or move this guidance to the docs page only and keep README unchanged).
| # Nix | |
| nix run github:microsoft/apm |
| - uses: DeterminateSystems/nix-installer-action@main | ||
| - uses: DeterminateSystems/magic-nix-cache-action@main |
There was a problem hiding this comment.
These third-party actions are referenced by branch ("@main"). For supply-chain safety and reproducibility, pin to an immutable tag or (preferably) a specific commit SHA.
| - uses: DeterminateSystems/nix-installer-action@main | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | |
| - uses: DeterminateSystems/nix-installer-action@v16 | |
| - uses: DeterminateSystems/magic-nix-cache-action@v7 |
| pull_request: | ||
| push: | ||
| branches: [main] | ||
|
|
There was a problem hiding this comment.
This workflow doesn't set top-level GITHUB_TOKEN permissions. To follow least-privilege (as used in other workflows), explicitly set permissions: { contents: read } (and add more only if needed).
| permissions: | |
| contents: read |
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest] |
There was a problem hiding this comment.
Running Nix builds on macos-latest for every PR can significantly increase CI time/cost and may be subject to long runner queues. Consider limiting PR runs to Linux only, or switching macOS to a more predictable runner (e.g., the same macOS intel runner used elsewhere) and/or gating macOS builds to push/release-only.
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| if: ${{ github.event_name != 'pull_request' || matrix.run_on_pr }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| run_on_pr: true | |
| - os: macos-13 | |
| run_on_pr: false |
|
Thanks for the contribution! I'm not ready to support Nix packaging at this stage — I don't have Nix expertise to maintain it, and I haven't seen user demand yet. If this becomes a frequently requested feature, I'd love to revisit. |
|
Hi @srid -- circling back on this with more concrete context now that #675 has landed. #675 added a build-time For Nix, I'd love to support users via the same model rather than carrying Reasons:
If you'd be up for shepherding APM into Leaving #540 closed for now, but very much open to revisiting via this route. Thanks again for the contribution and for caring enough to push on this. |
|
@danielmeppiel Makes full sense to me. Somebody will eventually package apm in All of those tend to be behind, so I've resolved to using |
Description
Package apm with uv2nix so it can be run via
nix run github:microsoft/apm(what's Nix?) on Linux and macOS (and Windows, via WSL).To test, run:
Type of change
Testing