Skip to content

Comments

doc/qt: refresh#287169

Merged
K900 merged 1 commit intoNixOS:masterfrom
K900:qt-docs
Feb 12, 2024
Merged

doc/qt: refresh#287169
K900 merged 1 commit intoNixOS:masterfrom
K900:qt-docs

Conversation

@K900
Copy link
Contributor

@K900 K900 commented Feb 8, 2024

Make examples don't require a custom callPackage, remove note on multiversioning, reword a few things.

Fixes #287015

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: qt/kde Object-oriented framework for GUI creation 8.has: documentation This PR adds or changes documentation labels Feb 8, 2024
@K900
Copy link
Contributor Author

K900 commented Feb 8, 2024

Whether we want to recommend taking qtbase or qt6 is kind of debatable, but I think I do prefer the qt6 approach, since it works better with pkgs/by-name, multiversioning within the same major Qt version is gone, and splicing works properly on it now.

@K900 K900 requested review from Aleksanaa, NickCao and ttuegel February 8, 2024 07:01
@ofborg ofborg 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. labels Feb 8, 2024
Copy link
Member

Choose a reason for hiding this comment

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

But where should they place the new packages in this kind?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the old structure, at least for now.

Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to use syntax like this:

{
  # in all-packages.nix
  a = callPackage ./... { }; # not needed in by-name though
  a-qt5 = callPackage ./... { qt6 = qt5; };
}

Or if we can't make the two Qt sets consistent:

{ lib
, something
, qt6
, libsForQt5
, qtVersion? "6"
, ...
}:

something.makePackage {
  ...
  buildInputs = [
     ...
  ] ++ lib.optionals (qtVersion == "6") [
    ...
  ] ++ lib.optionals (qtVersion == "5") [
    ...
  ];
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Theoretically possible, but the sets would never be consistent, because there are major API changes between 5 and 6.

Copy link
Member

@Aleksanaa Aleksanaa Feb 8, 2024

Choose a reason for hiding this comment

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

In the old structure, at least for now.

As far as I'm concerned, we shouldn't depend on the old structure from now on. If it belongs to a package set or scope or has special dependencies, there may be exceptions, but there are too many applications that support both qt5 and qt6. For packages already in Nixpkgs, we should also make treewide changes after the automatic migration is completed, so that they can be migrated to the by-name directory structure.

Copy link
Member

Choose a reason for hiding this comment

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

Are there really that many?

It seems that not many of them already support qt5 and qt6 in nixpkgs, but there may be many that "should support" but don't.

And do we really need to shove them all into by-name?

Maybe ask @infinisil. The RFC and the guide don't say that it must be placed in by-name, but perhaps we should still try to minimize this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I generally don't think we should be having two versions of every single package that can be built with both Qt versions. It's fine to use whatever is preferred upstream, and multiple versions can be added if there's actual demand for them and the maintenance costs aren't too much.

Copy link
Contributor

Choose a reason for hiding this comment

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

For top-level attrs, I'd rather discourage these custom callPackages entirely, as all they're really doing is masking which package set the expression args come from.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's what the by-name structure already achieves.

Copy link
Contributor

@eclairevoyant eclairevoyant Feb 11, 2024

Choose a reason for hiding this comment

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

using by-name doesn't prevent a custom callPackage though

(edit: after checking again, it seems the intention was to only permit the regular callPackage, so other callPackages slipping through might be a CI bug.)

@Aleksanaa Aleksanaa requested a review from infinisil February 8, 2024 07:46
Copy link
Member

@Aleksanaa Aleksanaa Feb 8, 2024

Choose a reason for hiding this comment

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

Please also provide an example for Qt5.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do we really need one? It feels pretty obvious to me.

Copy link
Member

Choose a reason for hiding this comment

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

Okay then.

Copy link
Contributor

Choose a reason for hiding this comment

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

For top-level attrs, I'd rather discourage these custom callPackages entirely, as all they're really doing is masking which package set the expression args come from.

@K900
Copy link
Contributor Author

K900 commented Feb 11, 2024

Rewrote a bunch of it, feels better now.

@K900
Copy link
Contributor Author

K900 commented Feb 11, 2024

@NixOS/documentation-reviewers

Make examples don't require a custom callPackage, remove note on multiversioning, reword a few things.

Fixes NixOS#287015
Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

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

Just a minor suggestion

:::

## Locating runtime dependencies {#qt-runtime-dependencies}
## Packages supporting multiple Qt versions {#qt-versions}
Copy link
Member

Choose a reason for hiding this comment

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

The header ids are here so that documentation links don't become invalid. We can manually add anchors for previous ids:

Suggested change
## Packages supporting multiple Qt versions {#qt-versions}
[]{#qt-runtime-dependencies}
## Packages supporting multiple Qt versions {#qt-versions}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just github diffs being shitty, the next header still has that anchor.

@K900 K900 merged commit 4dd2122 into NixOS:master Feb 12, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-deal-with-two-versions-of-a-package-in-by-name/40841/10

@infinisil infinisil mentioned this pull request May 28, 2024
13 tasks
@fgaz fgaz mentioned this pull request Oct 2, 2024
3 tasks
@K900 K900 deleted the qt-docs branch July 27, 2025 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: qt/kde Object-oriented framework for GUI creation 8.has: documentation This PR adds or changes documentation 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation: Qt callPackage approach incompatible with pkgs/by-name

5 participants