Skip to content

treewide: mostly noop: refer to src.name or similar in sourceRoot where appropriate#245388

Merged
mweinelt merged 5 commits intoNixOS:masterfrom
oxij:source-root-src
Aug 3, 2023
Merged

treewide: mostly noop: refer to src.name or similar in sourceRoot where appropriate#245388
mweinelt merged 5 commits intoNixOS:masterfrom
oxij:source-root-src

Conversation

@oxij
Copy link
Member

@oxij oxij commented Jul 25, 2023

Description of changes

This replaces all the uses of sourceRoot = "source";, sourceRoot = "source/subdir";, and similar in package derivations that use the default unpackPhase with sourceRoot = src.name, sourceRoot = "${src.name}/subdir"; and similar.

It also fixes sourceRoot and setSourceRoot description in the docs to match the implementation, and deprecates the old usage in release notes.

The primary motivation for this change is to make #49862 (or its reverse) trivial to implement.

Things done

It's a mostly noop change except for the changes to documentation (which cause nixos-install-tools to be rebuilt).

@github-actions github-actions bot added 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: haskell General-purpose, statically typed, purely functional programming language 8.has: documentation This PR adds or changes documentation 8.has: changelog This PR adds or changes release notes 6.topic: emacs Text editor 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 6.topic: Lumina DE The Lumina Desktop Environment labels Jul 25, 2023
@oxij oxij force-pushed the source-root-src branch from 331955c to 369237b Compare July 25, 2023 14:16
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jul 25, 2023
@oxij oxij force-pushed the source-root-src branch from 369237b to 7f35dc1 Compare August 1, 2023 10:07
@oxij
Copy link
Member Author

oxij commented Aug 1, 2023

Rebased onto master to fix a conflict with qrcodegen, it will get rebuilt now as 0164461 started to use preBuild for doing the same thing (without good reason, AFAICS).

@drupol
Copy link
Contributor

drupol commented Aug 1, 2023

I did use finalAttrs in the expression that used them already, I was trying to do the minimal change...

I know, but what I'm saying here is a bit different... I'm saying that we should avoid using rec when finalAttrs can be used.

@AndersonTorres
Copy link
Member

The removal of rec can be done in other PRs.

@oxij
Copy link
Member Author

oxij commented Aug 2, 2023

OfBorg seems to be stuck? Pending eval for 20 hours.

@oxij
Copy link
Member Author

oxij commented Aug 2, 2023

@drupol I pushed a new commit that replaces all newly introduced mkDerivation recs with fixpoints. buildRustPackage and buildGoModule do not support this yet, so can't do that there. I consider changing recs that I did not put there to be out of scope of this PR because that's a lot of package-specific work right there. I hope your objection can be withdrawn now?

@drupol
Copy link
Contributor

drupol commented Aug 2, 2023

Excellent, thanks !!!!

@AndersonTorres
Copy link
Member

OfBorg seems to be stuck? Pending eval for 20 hours.

aarch64-darwin usually spends days bootstrapping.
Whereas x86_64-darwin dies of timeout :)

@oxij
Copy link
Member Author

oxij commented Aug 3, 2023

Yay! All checks pass, still no conflicts. A prime opportunity to merge. :)

@AndersonTorres
Copy link
Member

Except merge conflicts.

Maybe because I burned it up :(

@oxij oxij force-pushed the source-root-src branch from 81e6087 to a0a909f Compare August 3, 2023 16:48
@oxij
Copy link
Member Author

oxij commented Aug 3, 2023

Rebased.

@mweinelt mweinelt merged commit 169e4c4 into NixOS:master Aug 3, 2023
@oxij
Copy link
Member Author

oxij commented Aug 3, 2023

🍻

@oxij
Copy link
Member Author

oxij commented Aug 8, 2023

This now has a continuation in #247977.

@ShamrockLee
Copy link
Contributor

ShamrockLee commented Mar 10, 2024

Please take a look at #294334 for yet another cleanup regarding such hard-coding sourceRoot specification.

This is required for #294068, after which non-compliant packages should fail to build, saving future maintenance overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: emacs Text editor 6.topic: haskell General-purpose, statically typed, purely functional programming language 6.topic: Lumina DE The Lumina Desktop Environment 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: python Python is a high-level, general-purpose programming language. 6.topic: rust General-purpose programming language emphasizing performance, type safety, and concurrency. 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants