Skip to content

buildstream-plugins: Use finalAttrs pattern, fix meta.changelog - #510073

Merged
SuperSandro2000 merged 1 commit into
NixOS:masterfrom
shymega:shymega/tweak-bst-plugins-python
Oct 1, 2026
Merged

SuperSandro2000 merged 1 commit into
NixOS:masterfrom
shymega:shymega/tweak-bst-plugins-python

Conversation

@shymega

@shymega shymega commented Apr 14, 2026 •

Copy link
Copy Markdown
Member

We switch to using finalAttrs for referring to declared attributes within the derivation, and fix the meta.changelog attribute, which pointed at a nonexistent GitHub Release for this tag; it now points at the NEWS file at the tag instead.

Note

This was produced with the assistance of an LLM (Claude Code, model claude-sonnet-5), reviewed and taken responsibility for by me. See the Assisted-by trailer on the commit.

Things done

@shymega shymega self-assigned this Apr 14, 2026
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. 6.topic: python Python is a high-level, general-purpose programming language. labels Apr 14, 2026
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 87ee646 to 678d89b Compare May 2, 2026 19:50
@shymega shymega changed the title buildstream-plugins: Set meta.platforms to BuildStream's buildstream-plugins: Set meta.platforms to BuildStream's and use finalAttrs. May 3, 2026
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 678d89b to 20e3939 Compare May 3, 2026 16:31
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 20e3939 to 31c5925 Compare May 5, 2026 21:07
@nixpkgs-ci nixpkgs-ci Bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label May 6, 2026
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 31c5925 to 624087d Compare May 7, 2026 18:09
@shymega
shymega requested a review from SuperSandro2000 May 7, 2026 18:13
@shymega

shymega commented May 7, 2026 •

Copy link
Copy Markdown
Member Author

@SuperSandro2000 Depending on when this PR is ready for merge,, and gets merged, I'd like to backport it to 25.11, but I don't have that privilege, as its a python3Package. If you could backport it (or anyone else with access), that would be wonderful - we use it at $work.

@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 624087d to 4914d3d Compare June 6, 2026 18:11
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 4914d3d to 0c2923c Compare July 4, 2026 15:59
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 0c2923c to e61f923 Compare July 11, 2026 17:49
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch 2 times, most recently from 1f55945 to fb9c6b0 Compare July 30, 2026 15:51
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from fb9c6b0 to 08320b4 Compare August 15, 2026 17:40
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 08320b4 to d912dfd Compare September 3, 2026 17:54
@Skyb0rg007

Copy link
Copy Markdown
Contributor

Using buildstream.meta.platforms here seems fragile, as now there is a dependency loop. buildstream.meta.platforms is also set to lib.platforms.linux so nothing is changing.

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 4, 2026
@shymega

shymega commented Sep 17, 2026

Copy link
Copy Markdown
Member Author

Using buildstream.meta.platforms here seems fragile, as now there is a dependency loop. buildstream.meta.platforms is also set to lib.platforms.linux so nothing is changing.

@Skyb0rg007 I think to unblock this MR, I'll revert the meta.platforms change. I think there's value in having finalAttrs though.

@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from d912dfd to 0c4de1a Compare September 17, 2026 17:40
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 17, 2026
@shymega shymega changed the title buildstream-plugins: Set meta.platforms to BuildStream's and use finalAttrs. buildstream-plugins: Use finalAttrs and set meta.changelog attribute Sep 17, 2026
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 17, 2026

@Skyb0rg007 Skyb0rg007 left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't like the mutual dependency here.
Since buildstream is only needed for tests, break the cycle by running the tests in a separate derivation (ex. passthru.tests.<name> = ...).

@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 70fd03c to 11550a4 Compare September 27, 2026 22:56
@shymega shymega changed the title buildstream-plugins: Use finalAttrs, fix buildstream dependency, and enable tests buildstream-plugins: Use finalAttrs pattern, fix meta.changelog Sep 27, 2026
@nixpkgs-ci nixpkgs-ci Bot removed the 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. label Sep 27, 2026
@shymega

shymega commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

@Skyb0rg007 I agree with your comments. Some tests need to be disabled until upstream fix it - I'll raise this when I return to the office.

As for the other comments, I think we can solve a majority by using VM tests. This is something now being worked on. I will also get the same done in the buildstream-plugins-community and for BuildStream itself, so we're not relying on disabling /dev/fuse in BuildBox, which is abnormal. A new PR will be opened to add a VM test to buildstream-plugins and linked to this PR.

@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 7.no default reviewers This PR targets a package or module with no existing maintainers; roving reviewers, take pity! and removed 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. labels Sep 27, 2026
@shymega

shymega commented Sep 27, 2026

Copy link
Copy Markdown
Member Author

Opened #567698 as a complementary way to run buildstream-plugins' test suite: as a NixOS VM test (nixosTests.buildstream-plugins) with real /dev/fuse access, instead of the sandboxed nativeCheckInputs-based derivation check. It's rebased on top of this PR's finalAttrs branch, so it depends on this one merging first.

shymega added a commit to shymega/nixpkgs that referenced this pull request Sep 27, 2026
The upstream pytest suite needs `buildstream` present (including its
shared source-plugin test helpers and templated repo-kind tests) and
needs buildbox-casd's real FUSE-based staging, which needs `/dev/fuse`
and a working mount path via setuid `fusermount3` -- neither of which
the Nix build sandbox provides.

Add nixosTests.buildstream-plugins-community and point
passthru.tests.pytest at it instead: programs.fuse.enable gives real
/dev/fuse and fusermount3 access, so the suite exercises the actual
FUSE-backed staging path. `buildstream`'s own `bst` entry point bakes
its dependencies' site-packages directories into that script rather
than exposing them under its own site-packages directory, so
`toPythonModule` is used to pull `buildstream` and its dependencies
into a shared environment that `pytest` can import from.

Deselect the handful of tests that reach out to gitlab.com for real
network fetches (bazel/bazel_file manifest downloads, the git-lfs test
repo), since network access isn't available in the test VM either.
Also deselect the shared repo-kind tests pulled in from
buildstream._testing._sourcetests via sourcetests_collection_hook:
pytest-datafiles copies their datafiles fixtures from buildstream's
own installed (Nix-store-read-only) package data, preserving the
missing write bit, so code that writes into the copy fails with
PermissionError. This is the same upstream bug as
apache/buildstream#2196 (see also PR NixOS#510073
for the same fix in the sibling buildstream-plugins package), and
isn't specific to the build sandbox, so it still applies in the VM.

Assisted-by: Claude <[email protected]>
shymega added a commit to shymega/nixpkgs that referenced this pull request Sep 28, 2026
The upstream pytest suite needs `buildstream` present (including its
shared source-plugin test helpers and templated repo-kind tests) and
needs buildbox-casd's real FUSE-based staging, which needs `/dev/fuse`
and a working mount path that the Nix build sandbox doesn't provide.

Add nixosTests.buildstream-plugins-community and point
passthru.tests.pytest at it instead: programs.fuse.enable gives real
/dev/fuse access, so the suite exercises the actual FUSE-backed
staging path. `buildstream`'s own `bst` entry point bakes its
dependencies' site-packages directories into that script rather than
exposing them under its own site-packages directory, so
`toPythonModule` is used to pull `buildstream` and its dependencies
into a shared environment that `pytest` can import from.

Deselect the handful of tests that reach out to gitlab.com for real
network fetches (bazel/bazel_file manifest downloads, the git-lfs test
repo), since network access isn't available in the test VM either.
Also deselect the shared repo-kind tests pulled in from
buildstream._testing._sourcetests via sourcetests_collection_hook:
pytest-datafiles copies their datafiles fixtures from buildstream's
own installed (Nix-store-read-only) package data, preserving the
missing write bit, so code that writes into the copy fails with
PermissionError. This is the same upstream bug as
apache/buildstream#2196 (see also PR NixOS#510073
for the same fix in the sibling buildstream-plugins package), and
isn't specific to the build sandbox, so it still applies in the VM.

Assisted-by: Claude <[email protected]>
@shymega

shymega commented Sep 28, 2026

Copy link
Copy Markdown
Member Author

@SuperSandro2000 following up on your CHANGES_REQUESTED review from 2026-05-06 — the repo = pname anti-pattern you flagged has been fixed since, and Skyb0rg007 re-reviewed the subsequent changes (including a later dependency-cycle concern) and approved. Would you mind taking another look or dismissing your review if it no longer applies? Thanks!

shymega added a commit to shymega/nixpkgs that referenced this pull request Sep 28, 2026
The upstream pytest suite needs `buildstream` present (including its
shared source-plugin test helpers and templated repo-kind tests) and
needs buildbox-casd's real FUSE-based staging, which needs `/dev/fuse`
and a working mount path that the Nix build sandbox doesn't provide.

Add nixosTests.buildstream-plugins-community and point
passthru.tests.pytest at it instead: programs.fuse.enable gives real
/dev/fuse access, so the suite exercises the actual FUSE-backed
staging path. `buildstream`'s own `bst` entry point bakes its
dependencies' site-packages directories into that script rather than
exposing them under its own site-packages directory, so
`toPythonModule` is used to pull `buildstream` and its dependencies
into a shared environment that `pytest` can import from.

Deselect the handful of tests that reach out to gitlab.com for real
network fetches (bazel/bazel_file manifest downloads, the git-lfs test
repo), since network access isn't available in the test VM either.
Also deselect the shared repo-kind tests pulled in from
buildstream._testing._sourcetests via sourcetests_collection_hook:
pytest-datafiles copies their datafiles fixtures from buildstream's
own installed (Nix-store-read-only) package data, preserving the
missing write bit, so code that writes into the copy fails with
PermissionError. This is the same upstream bug as
apache/buildstream#2196 (see also PR NixOS#510073
for the same fix in the sibling buildstream-plugins package), and
isn't specific to the build sandbox, so it still applies in the VM.

Assisted-by: Claude <[email protected]>
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 11550a4 to 93bd5cc Compare September 28, 2026 18:20
shymega added a commit to shymega/nixpkgs that referenced this pull request Sep 28, 2026
The upstream pytest suite needs `buildstream` present (including its
shared source-plugin test helpers and templated repo-kind tests) and
needs buildbox-casd's real FUSE-based staging, which needs `/dev/fuse`
and a working mount path that the Nix build sandbox doesn't provide.

Add nixosTests.buildstream-plugins-community and point
passthru.tests.pytest at it instead: programs.fuse.enable gives real
/dev/fuse access, so the suite exercises the actual FUSE-backed
staging path. `buildstream`'s own `bst` entry point bakes its
dependencies' site-packages directories into that script rather than
exposing them under its own site-packages directory, so
`toPythonModule` is used to pull `buildstream` and its dependencies
into a shared environment that `pytest` can import from.

Deselect the handful of tests that reach out to gitlab.com for real
network fetches (bazel/bazel_file manifest downloads, the git-lfs test
repo), since network access isn't available in the test VM either.
Also deselect the shared repo-kind tests pulled in from
buildstream._testing._sourcetests via sourcetests_collection_hook:
pytest-datafiles copies their datafiles fixtures from buildstream's
own installed (Nix-store-read-only) package data, preserving the
missing write bit, so code that writes into the copy fails with
PermissionError. This is the same upstream bug as
apache/buildstream#2196 (see also PR NixOS#510073
for the same fix in the sibling buildstream-plugins package), and
isn't specific to the build sandbox, so it still applies in the VM.

Assisted-by: Claude <[email protected]>
shymega added a commit to shymega/nixpkgs that referenced this pull request Sep 28, 2026
The upstream pytest suite needs `buildstream` present (including its
shared source-plugin test helpers and templated repo-kind tests) and
needs buildbox-casd's real FUSE-based staging, which needs `/dev/fuse`
and a working mount path that the Nix build sandbox doesn't provide.

Add nixosTests.buildstream-plugins-community and point
passthru.tests.pytest at it instead: programs.fuse.enable gives real
/dev/fuse access, so the suite exercises the actual FUSE-backed
staging path. `buildstream`'s own `bst` entry point bakes its
dependencies' site-packages directories into that script rather than
exposing them under its own site-packages directory, so
`toPythonModule` is used to pull `buildstream` and its dependencies
into a shared environment that `pytest` can import from.

Deselect the handful of tests that reach out to gitlab.com for real
network fetches (bazel/bazel_file manifest downloads, the git-lfs test
repo), since network access isn't available in the test VM either.
Also deselect the shared repo-kind tests pulled in from
buildstream._testing._sourcetests via sourcetests_collection_hook:
pytest-datafiles copies their datafiles fixtures from buildstream's
own installed (Nix-store-read-only) package data, preserving the
missing write bit, so code that writes into the copy fails with
PermissionError. This is the same upstream bug as
apache/buildstream#2196 (see also PR NixOS#510073
for the same fix in the sibling buildstream-plugins package), and
isn't specific to the build sandbox, so it still applies in the VM.

Assisted-by: Claude <[email protected]>
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 93bd5cc to 1ad5823 Compare September 28, 2026 19:24
shymega added a commit to shymega/nixpkgs that referenced this pull request Sep 28, 2026
The upstream pytest suite needs `buildstream` present (including its
shared source-plugin test helpers and templated repo-kind tests) and
needs buildbox-casd's real FUSE-based staging, which needs `/dev/fuse`
and a working mount path that the Nix build sandbox doesn't provide.

Add nixosTests.buildstream-plugins-community and point
passthru.tests.pytest at it instead: programs.fuse.enable gives real
/dev/fuse access, so the suite exercises the actual FUSE-backed
staging path. `buildstream`'s own `bst` entry point bakes its
dependencies' site-packages directories into that script rather than
exposing them under its own site-packages directory, so
`toPythonModule` is used to pull `buildstream` and its dependencies
into a shared environment that `pytest` can import from.

Deselect the handful of tests that reach out to gitlab.com for real
network fetches (bazel/bazel_file manifest downloads, the git-lfs test
repo), since network access isn't available in the test VM either.
Also deselect the shared repo-kind tests pulled in from
buildstream._testing._sourcetests via sourcetests_collection_hook:
pytest-datafiles copies their datafiles fixtures from buildstream's
own installed (Nix-store-read-only) package data, preserving the
missing write bit, so code that writes into the copy fails with
PermissionError. This is the same upstream bug as
apache/buildstream#2196 (see also PR NixOS#510073
for the same fix in the sibling buildstream-plugins package), and
isn't specific to the build sandbox, so it still applies in the VM.

Assisted-by: Claude <[email protected]>
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 93bd5cc to 1ad5823 Compare September 28, 2026 19:24
Also fixes the `meta.changelog` attribute, which pointed at a
nonexistent release-tag page; use the NEWS file at the tag instead.
shymega added a commit to shymega/nixpkgs that referenced this pull request Oct 1, 2026
The upstream pytest suite needs `buildstream` present (including its
shared source-plugin test helpers and templated repo-kind tests) and
needs buildbox-casd's real FUSE-based staging, which needs `/dev/fuse`
and a working mount path that the Nix build sandbox doesn't provide.

Add nixosTests.buildstream-plugins-community and point
passthru.tests.pytest at it instead: programs.fuse.enable gives real
/dev/fuse access, so the suite exercises the actual FUSE-backed
staging path. `buildstream`'s own `bst` entry point bakes its
dependencies' site-packages directories into that script rather than
exposing them under its own site-packages directory, so
`toPythonModule` is used to pull `buildstream` and its dependencies
into a shared environment that `pytest` can import from.

Deselect the handful of tests that reach out to gitlab.com for real
network fetches (bazel/bazel_file manifest downloads, the git-lfs test
repo), since network access isn't available in the test VM either.
Also deselect the shared repo-kind tests pulled in from
buildstream._testing._sourcetests via sourcetests_collection_hook:
pytest-datafiles copies their datafiles fixtures from buildstream's
own installed (Nix-store-read-only) package data, preserving the
missing write bit, so code that writes into the copy fails with
PermissionError. This is the same upstream bug as
apache/buildstream#2196 (see also PR NixOS#510073
for the same fix in the sibling buildstream-plugins package), and
isn't specific to the build sandbox, so it still applies in the VM.

Assisted-by: Claude <[email protected]>
@shymega
shymega force-pushed the shymega/tweak-bst-plugins-python branch from 1ad5823 to 06feda8 Compare October 1, 2026 20:17
shymega added a commit to shymega/nixpkgs that referenced this pull request Oct 1, 2026
The upstream pytest suite needs `buildstream` present (including its
shared source-plugin test helpers and templated repo-kind tests) and
needs buildbox-casd's real FUSE-based staging, which needs `/dev/fuse`
and a working mount path that the Nix build sandbox doesn't provide.

Add nixosTests.buildstream-plugins-community and point
passthru.tests.pytest at it instead: programs.fuse.enable gives real
/dev/fuse access, so the suite exercises the actual FUSE-backed
staging path. `buildstream`'s own `bst` entry point bakes its
dependencies' site-packages directories into that script rather than
exposing them under its own site-packages directory, so
`toPythonModule` is used to pull `buildstream` and its dependencies
into a shared environment that `pytest` can import from.

Deselect the handful of tests that reach out to gitlab.com for real
network fetches (bazel/bazel_file manifest downloads, the git-lfs test
repo), since network access isn't available in the test VM either.
Also deselect the shared repo-kind tests pulled in from
buildstream._testing._sourcetests via sourcetests_collection_hook:
pytest-datafiles copies their datafiles fixtures from buildstream's
own installed (Nix-store-read-only) package data, preserving the
missing write bit, so code that writes into the copy fails with
PermissionError. This is the same upstream bug as
apache/buildstream#2196 (see also PR NixOS#510073
for the same fix in the sibling buildstream-plugins package), and
isn't specific to the build sandbox, so it still applies in the VM.

Assisted-by: Claude <[email protected]>
@SuperSandro2000
SuperSandro2000 added this pull request to the merge queue Oct 1, 2026
Merged via the queue into NixOS:master with commit 6cf74fe Oct 1, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: python Python is a high-level, general-purpose programming language. 7.no default reviewers This PR targets a package or module with no existing maintainers; roving reviewers, take pity! 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants