Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qt5: fix cross #264965

Merged
17 commits merged into from Nov 5, 2023
Merged

qt5: fix cross #264965

17 commits merged into from Nov 5, 2023

Conversation

ghost
Copy link

@ghost ghost commented Nov 2, 2023

Reengineered to avoid rebuilding anything. Should have ~0 rebuilds.

To be useful, you also need this two-commit PR from staging (which does cause rebuilds; that's why it's a separate PR):

Description of changes

This commit fixes builds of pkgsCross.*.qt5.qtbase by:

  • Adding the buildPlatform compiler to depsBuildBuild in qtbase.nix and qtModule.nix. The qtbase build machinery expects to find it in the $PATH in unprefixed form.

  • Setting the PKG_CONFIG_SYSROOT_DIR and PKG_CONFIG_LIBDIR environment variables when compiling a cross-targeted qmake. This is required; if these environment variables are unset, qmake won't even try to use pkg-config.

  • Adding the -device and -device-option flags necessary for cross compilation to configureFlags.

  • Adding the (one-entry at the moment) Rosetta Stone for QT-5 as a let-defined qtPlatform function which takes a nixpkgs platform and returns a QT-5 mkspecs-string.

Includes

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/)
  • 23.11 Release Notes (or backporting 23.05 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.

@ghost ghost mentioned this pull request Nov 2, 2023
13 tasks
];

# TODO: figure out why the env hooks aren't adding these inclusions automatically
Copy link
Member

Choose a reason for hiding this comment

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

Only the /include is added , not any sub paths IIRC

Many of the includes in https://github.com/search?q=%2F%23Include.%2BQtWebChannel%2F&type=code have a / so I don't know if they're supposed to be added to it.

@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different sort platform than than they will be run on label Nov 2, 2023
@github-actions github-actions bot added the 6.topic: lib The Nixpkgs function library label Nov 2, 2023
@ghost
Copy link
Author

ghost commented Nov 3, 2023

@ofborg build pkgsCross.aarch64-multiplatform.qt5.qutebrowser

Adam Joseph added 6 commits November 3, 2023 22:28
Our qutebrowser package has been vandalized by various commits, such
as c9cc3a2 and
ad0bbaf, which made erroneous
assertions such as "since qutebrowser 3.0.0 the derivation is only
building for qt6."

This commit repairs the vandalism.
@ghost
Copy link
Author

ghost commented Nov 5, 2023

@ofborg eval

@ofborg ofborg bot requested a review from dotlambda November 5, 2023 00:37
@ghost
Copy link
Author

ghost commented Nov 5, 2023

This works; along with #264964:

  • pkgsCross.aarch64-multiplatform.qt5.qutebrowser on x86_64-linux — Success

It causes no rebuilds:

no-rebuilds

There are a lot of conditionals; most can be removed, but doing so causes rebuilds, so the conditional-removals must go to staging.

I'm incredibly tired of rebasing this.

I'm merging it.

Maybe somebody will rage-revert it, maybe not.

In either case I'll stay on the branch (local if necessary) that keeps it in-tree, because it's kind of insane to use a distribution with a browser-only forge that repeatedly breaks your web browser. If I can stop spending all my time rebasing this I might actually be able to finish getting qt6 to cross-compile after 23.11:

@ghost ghost merged commit 510397a into NixOS:master Nov 5, 2023
20 of 23 checks passed
@ghost ghost deleted the qt5-fix-cross branch November 5, 2023 00:55
@dotlambda
Copy link
Member

Why did you neither implement my suggestion nor wait for other reviews?

@winterqt
Copy link
Member

winterqt commented Nov 5, 2023

Maybe somebody will rage-revert it, maybe not.

This is possibly the most self-aware yet utterly absurd comment I've seen here to date.

A gentle reminder that we are a team, and you are expected to work with others to meet our shared goals; completely blindsiding the active reviewers goes against that entirely.

(args.nativeBuildInputs or []) ++ [
perl qmake
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
pkgsHostTarget.qt5.qtbase.dev
Copy link
Member

@Artturin Artturin Nov 5, 2023

Choose a reason for hiding this comment

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

why a buildInput in nativeBuildInputs, the programs there shouldn't be executable?

Copy link
Author

Choose a reason for hiding this comment

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

Normally no, except it's QT, and QT has both qmake-which-runs-on-the-buildPlatform as well as libQtBase-which-is-built-for-the-hostPlatform mashed into the same package.

Comment on lines -316 to +318
propagatedBuildInputs = [ qtbase.dev ];
${if stdenv.buildPlatform == stdenv.hostPlatform
then "propagatedBuildInputs"
else "depsTargetTargetPropagated"} = [ qtbase.dev ];
Copy link
Member

Choose a reason for hiding this comment

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

Seems wrong, the binaries in qtbase won't be in PATH

Copy link
Author

Choose a reason for hiding this comment

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

Remember, qtbase is both a build tool (qmake) and a library (libQt5Base). The line above deals with the library.

Copy link
Member

@Artturin Artturin Nov 5, 2023

Choose a reason for hiding this comment

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

Copy link
Member

@Artturin Artturin Nov 5, 2023

Choose a reason for hiding this comment

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

I> Normally no, except it's QT, and QT has both qmake-which-runs-on-the-buildPlatform as well as libQtBase-which-is-built-for-the-hostPlatform mashed into the same package.

Gotta add comments, really confusing

@Artturin
Copy link
Member

Artturin commented Nov 5, 2023

github removed all my nixpkgs notifications and unsubscribed me from all the nixpkgs PRs and issues (4k+) 😠 so ping directly in other PRs which i haven't been in since ~Friday, November 3rd, 2023 at 10:37 PM

https://discourse.nixos.org/t/github-unsubscribed-me-from-all-nixpkgs-prs-and-issues/35026

@rnhmjoj
Copy link
Contributor

rnhmjoj commented Nov 5, 2023

You sneaked controversial changes (the qutebrowser stuff) in an unrelated PR and self-merged them without waiting for anyone to review. I think this behavior is borderline malicious and I seriously suggest that your commit rights be revoked.

@winterqt
Copy link
Member

winterqt commented Nov 5, 2023

You sneaked controversial changes (the qutebrowser stuff) in an unrelated PR

At least the merged change didn't make it so that any usage of qutebrowser would be downgraded to an insecure version, like a previous version of that PR apparently did. 😕

@ghost
Copy link
Author

ghost commented Nov 6, 2023

You sneaked controversial changes (the qutebrowser stuff) in

I think you are confused here.

It was in fact you who sneaked controversial changes to qutebrowser in #250171 which deleted qt5.qutebrowser (the only one that builds under many configurations) into a version-bump PR titled "qutebrowser: 2.5.4 -> 3.0.0".

@dotlambda dotlambda mentioned this pull request Nov 6, 2023
13 tasks
@nrdxp
Copy link
Contributor

nrdxp commented Nov 6, 2023

It was in fact you who sneaked controversial changes to qutebrowser

Who, besides you, agrees that the upgrade to qt6 was controversial? Certainly not upstream. In fact, it is often considered controversial to break from upstream packaging norms in any serious manner, which means you have the burden of proof here, not us.

In addition, I think most users were anxious for the qt6 version, seeing as the qt5 webengine was already severely outdated by the time qt6 support was made stable in qutebrowser. I would bet that there would be a much larger popullation of confused users if qt6 wasn't made the default as soon as it was stable.

Besides that, it is just plain subversive to sneak in changes like this when maintainers don't agree with you, especially if you don't take a share of the maintenance burden by adding yourself as a maintainer.

@ghost
Copy link
Author

ghost commented Nov 6, 2023

Who, besides you, agrees that the upgrade to qt6 was controversial?

Please don't put words in my mouth.

Take a moment to read the PR that I linked to. Before that PR qutebrowser supported both qt5 and qt6. I have no objection to the addition of support for qt6.

if stdenv.buildPlatform == stdenv.hostPlatform
then bootstrapScope.qttranslations
else null;
qutebrowser = final.callPackage ../../../../applications/networking/browsers/qutebrowser { };
Copy link
Member

Choose a reason for hiding this comment

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

Applications don't belong here so I suggest #251671.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants