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

haskellPackages.bustle: fix building on Hydra #78559

Merged
merged 2 commits into from Jan 28, 2020

Conversation

jtojnar
Copy link
Contributor

@jtojnar jtojnar commented Jan 26, 2020

For some reasons, perhaps inherited from hgettext, bustle had
hydraPlatforms = stdenv.lib.platforms.none set in hackage-packages.nix.

It builds fine with our overrides so let's unset the attribute.

@infinisil
Copy link
Member

Updates to haskell packages should go to the haskell-updates branch (which is then eventually merged into master)

@jtojnar
Copy link
Contributor Author

jtojnar commented Jan 27, 2020

Updates to haskell packages should go to the haskell-updates branch (which is then eventually merged into master)

Should not it be okay to merge this to master and then possibly merge master to haskell-updates since this is just overrides change?

# https://gitlab.freedesktop.org/bustle/bustle/issues/13
(bustle: bustle.override { hgettext = null; })
(bustle: disableCabalFlag bustle "hgettext")
(bustle: bustle.overrideAttrs (attrs: { meta = builtins.removeAttrs attrs.meta [ "hydraPlatforms" ]; }))
Copy link
Member

Choose a reason for hiding this comment

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

(edit: The following is incorrect. See my next message.)

I don't know anything about bustle, but my guess is that hydraPlatforms being set to none is a bug in hackage2nix.

hydraPlatforms is set to none automatically by hackage2nix/cabal2nix when the package is marked broken. However, the hydraPlatforms setting should be removed automatically when the package is marked unbroken.

In this case, it appears that the package was marked unbroken, but the hydraPlatforms setting was not removed.

I feel like I've seen something like this happen before, but I don't remember the underlying cause.

Maybe @peti has an idea what could be going on here?

Copy link
Member

Choose a reason for hiding this comment

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

I think I figured out what is going on here.

bustle has a license set as OtherLicense:

https://gitlab.freedesktop.org/bustle/bustle/blob/27ac836202028d1a9e4f18fff21d10aff802b04b/bustle.cabal#L8

However, bustle's actual license is some combination of LGPL and GPL:

https://gitlab.freedesktop.org/bustle/bustle/blob/27ac836202028d1a9e4f18fff21d10aff802b04b/LICENSE

hackage2nix sets hydraPlatforms to none by default for OtherLicense:

https://github.com/NixOS/cabal2nix/blob/b942b6aedd11852f6dc995bea944ca1c39ccc200/src/Distribution/Nixpkgs/Haskell/FromCabal.hs#L111


So I think the correct solution here is to send a PR to cabal2nix overriding the hdyraPlatforms setting for bustle.

Here's the function this needs to be added to:

https://github.com/NixOS/cabal2nix/blob/b942b6aedd11852f6dc995bea944ca1c39ccc200/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs#L72-L77

@jtojnar Could you send this PR? If you don't know Haskell, I can try to put together a PR for this.

Copy link
Contributor Author

@jtojnar jtojnar Jan 27, 2020

Choose a reason for hiding this comment

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

Hmm, looks like it no longer depends on dbus-core so upstream can switch to LGPL.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will be fixed in https://gitlab.freedesktop.org/bustle/bustle/merge_requests/17, I think the temporary fix is fine here.

Copy link
Member

Choose a reason for hiding this comment

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

In this case, it appears that the package was marked unbroken, but the hydraPlatforms setting was not removed.

The license might be a problem, indeed. Another problem is the system dependency on gio-unix which hackage2nix cannot resolve because we have no package of that name. We should probably add an appropriate name mapping to https://github.com/NixOS/cabal2nix/blob/master/src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs to remedy that issue. I can do that, but someone would have to tell me what that name should be mapped to, because I don't know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

gio-unix-2.0 is part of glib package.

@cdepillabout
Copy link
Member

Should not it be okay to merge this to master and then possibly merge master to haskell-updates since this is just overrides change?

The way the Haskell stuff works in nixpkgs is that updates to the files in pkgs/development/haskell-modules generally go to the haskell-updates branch.

Once a week, @peti cleans up the branch, makes sure nothing too major has stopped working, and merges haskell-updates into master. (He usually does it live if you're interested in watching: https://discourse.nixos.org/t/please-join-the-new-weekly-haskell-updates-video-livestream/4420)

Cleaning up the haskell-updates branch can be quite an annoying process, so we try to make it as easy as possible for him. By putting all the haskell-related changes on haskell-updates, we can make sure there are no merge conflicts when the haskell-updates branch merges back into master.

So while it would be possible to merge this into master (and then into haskell-updates), I'd prefer not to create an extra step that @peti has to remember to do.

@jtojnar jtojnar changed the base branch from master to haskell-updates January 27, 2020 01:56
Bustle is proclaiming OtherLicense even though the code is licensed under LGPL 2.1+. This causes cabal2nix to set hydraPlatforms = stdenv.lib.platforms.none in hackage-packages.nix for the package.

Lets let's unset the attribute and fix the license.
@cdepillabout
Copy link
Member

Good use of lib.pipe btw. I'll have to remember to start using this in my own code.

@jtojnar jtojnar merged commit 67f498c into NixOS:haskell-updates Jan 28, 2020
@jtojnar jtojnar deleted the bustleFix branch January 28, 2020 14:20
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.

None yet

5 participants