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

Taffybar fails to build in nixpackages #298

Closed
PierreR opened this issue Apr 29, 2018 · 27 comments
Closed

Taffybar fails to build in nixpackages #298

PierreR opened this issue Apr 29, 2018 · 27 comments
Labels
blocked This issue is blocked on something in a dependency hard Fixing this issue is likely to be difficult help wanted Help is wanted on this issue in progress This issue is actively being worked on

Comments

@PierreR
Copy link
Contributor

PierreR commented Apr 29, 2018

The introduction of haskell-gi in v1.0.2 has been a huge change. Indeed haskell-gi does not work in ghc-8.2.x due to apparently a regression bug in ghc.

IMHO this kind of change need a version bump far greater than the mere third digit ... In nixos for instance, taffybar can't be built anymore (as the current default is still ghc-8.2.x).

I guess it is now too late but maybe for next time it would better to mark such changes with a second digit version bump (1.1.x in this case). On the other hand, using the latest digit forces everyone to update asap but well.

@colonelpanic8
Copy link
Member

colonelpanic8 commented Apr 29, 2018

@PierreR haskell-gi does work in ghc-8.2.x . Overloading is broken, but I was careful to avoid overloading. 1.0.2 has an important memory leak bug fix, but otherwise no changes in functionality. It was necessary to use gi-gtk to solve the issue, so I didn't have much choice in the matter, but I still think a point release version bump was the correct move here, since the changes are not backwards incompatible in any way, and no new functionality was introduced.

@colonelpanic8
Copy link
Member

IMHO this kind of change need a version bump far greater than the mere third digit ... In nixos for instance, taffybar can't be built anymore (as the current default is still ghc-8.2.x).

Are you sure about this? Can you show me the failing build log. I literally just built master with 8.2.2 on my machine.

@colonelpanic8
Copy link
Member

@PierreR IF it really is the case that this fails to build in nix os (using cabal/nix) why not just use stack to build, which will almost certainly work.

@colonelpanic8
Copy link
Member

@PierreR See my comment here:

NixOS/nixpkgs#37724 (comment)

I think you may have misidentified the cause of the failed build.

@colonelpanic8 colonelpanic8 changed the title Version 1.0.1 vs 1.0.2 is insanely different (dependencies wise) Taffybar fails to build in nixpackages Apr 29, 2018
@PierreR
Copy link
Contributor Author

PierreR commented May 7, 2018

@IvanMalison Thanks for your input.

The haskell-gi issue has been fixed. There is a new one specific to taffybar-2.0 that prevents the build to succeed:
taffybar/status-notifier-item#1

@colonelpanic8
Copy link
Member

See NixOS/nixpkgs#40186

@colonelpanic8 colonelpanic8 added blocked This issue is blocked on something in a dependency in progress This issue is actively being worked on hard Fixing this issue is likely to be difficult help wanted Help is wanted on this issue labels May 10, 2018
@puffnfresh
Copy link

I've submitted haskell-gi/haskell-gi#172 and NixOS/cabal2nix#353. I'm not sure which is the appropriate place to make the change but either should work. Both are better than changes directly in nixpkgs.

@puffnfresh
Copy link

After getting past haskell-gi, we hit the command line argument limit known issue.

@puffnfresh
Copy link

I can get past that problem with:

haskellPackages.taffybar.overrideDerivation (drv: { strictDeps = true; })

But there's yet another problem:

[ 5 of 65] Compiling System.Taffybar.DBus.Client.UPowerDevice ( src/System/Taffybar/DBus/Client/UPowerDevice.hs, dist/build/System/Taffybar/DBus/Client/UPowerDevice.o )

src/System/Taffybar/DBus/Client/UPowerDevice.hs:1:1: error:
    Exception when trying to run compile-time code:
      dbus-xml/org.freedesktop.UPower.Device.xml: openFile: does not exist (No such file or directory)
    Code: generateClientFromFile
            defaultRecordGenerationParams
              {recordName = Just "BatteryInfo", recordPrefix = "battery",
               recordTypeForName = batteryTypeForName}
            uPowerGenerationParams
            False
            $ "dbus-xml" </> "org.freedesktop.UPower.Device.xml"

@puffnfresh
Copy link

Which is because that file isn't in the Hackage source! https://hackage.haskell.org/package/taffybar-2.1.0/src/

@puffnfresh
Copy link

#363 already fixed, awaiting a release.

@colonelpanic8
Copy link
Member

@puffnfresh Just published a new release

@colonelpanic8
Copy link
Member

@puffnfresh Any idea how I might leverage strictDeps to fix the stack build, which seems to run in to the same issue?

@puffnfresh
Copy link

@IvanMalison no sorry, I don't even understand strictDeps from nixpkgs but I can just confirm that it fixes the problem.

@colonelpanic8
Copy link
Member

@puffnfresh Hmm I'm actually in the process of migrating to nixOS from arch right now, but I can't get taffybar working at all. Can you share your config maybe?

@puffnfresh
Copy link

@colonelpanic8
Copy link
Member

@puffnfresh I'm not seeing where you used the strictDeps piece. Or is that already applied somewhere? What channel are you using?

@puffnfresh
Copy link

@IvanMalison I'm currently running something like:

{
  nixpkgs.config = {
    packageOverrides = super: let self = super.pkgs; in {
      haskellPackages = super.haskellPackages.override {
        overrides = self': super': {
          gi-dbusmenugtk3 = self.haskell.lib.addPkgconfigDepend super'.gi-dbusmenugtk3 self.gtk3;
          taffybar = super'.taffybar.overrideDerivation (drv: {
            strictDeps = true;
            src = self.fetchFromGitHub {
              owner = "taffybar";
              repo = "taffybar";
              rev = "v2.1.1";
              sha256 = "12g9i0wbh4i66vjhwzcawb27r9pm44z3la4693s6j21cig521dqq";
            };
          });
        };
      };
    };
  };
}

From nixpkgs master. I've had to work around a few other bugs with master, but this might work for you!

@colonelpanic8
Copy link
Member

@puffnfresh ah I see, you are installing form nixpkgs master.

The strict deps option hasn't even appreared in the unstable channel yet, and I'm not sure I want to switch to using the git master. I suppose it is worth a shot though.

@PierreR
Copy link
Contributor Author

PierreR commented Jun 3, 2018

@IvanMalison FWIW you can keep your system on the stable channel and pin to a precise nixpkgs commit to build taffybar. That's what I am doing.

@colonelpanic8
Copy link
Member

@PierreR Cool. I'm new to nix. How exactly do you do that?

@colonelpanic8
Copy link
Member

@PierreR Found some info here: https://nixos.wiki/wiki/FAQ/Pinning_Nixpkgs

@PierreR
Copy link
Contributor Author

PierreR commented Jun 3, 2018

@IvanMalison Here is some extra info from my note: http://pierrer.github.io/notebook/#_nix (search for "Pinned a version of nixpkgs"). with recent version of nix fetchTarball is usually the way to go.

@colonelpanic8
Copy link
Member

See my comment NixOS/nixpkgs#40013 (comment). I suspect that the latest commits that I have pushed may be getting us close to a solution!

@PierreR
Copy link
Contributor Author

PierreR commented Jun 4, 2018

@IvanMalison I have managed to get taffybar-v2.1.1 up and running on nixos following @puffnfresh recipe and using this pinned info:

λ ~ → cat .config/nixpkgs/.nixpkgs.json 
{
  "url": "https://github.com/NixOS/nixpkgs.git",
  "rev": "448d7d648d1a2e8aacc85f9d0abc90643ca2e89b",
  "date": "2018-06-03T13:52:13+02:00",
  "sha256": "04ph82bxms8j9hdx2k9irikzxmg4lqr6vq7h97bgvfgxy4f6ssw7",
  "fetchSubmodules": true
}

But I still need to adjust the default UI which is really awful for me. I don't know why it is suddenly so big ;-)
taffybar

@colonelpanic8
Copy link
Member

Are you using the default config? Looks like you have some bar padding. You can turn that off by adjusting the barPadding value in your config.

@PierreR
Copy link
Contributor Author

PierreR commented Jun 27, 2018

The lastest nixpkgs is building taffybar-2.1.1 just fine. Feel free to re-open the issue if necessary.

@PierreR PierreR closed this as completed Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This issue is blocked on something in a dependency hard Fixing this issue is likely to be difficult help wanted Help is wanted on this issue in progress This issue is actively being worked on
Projects
None yet
Development

No branches or pull requests

3 participants