danth / stylix

System-wide colorscheming and typography for NixOS
https://stylix.danth.me/
MIT License
906 stars 105 forks source link

palette-generator coredumps when rebuilding #333

Closed SrEstegosaurio closed 2 months ago

SrEstegosaurio commented 2 months ago

Trying to rebuild my system results in an error due to palette-generator coredumping.

This has happen on several commits across different days, I'm currently in: f9b9bc7c8e69942cd2583a3309f86fc5260f1275

It only outputs this:

/build/.attr-0l2nkwhif96f51f4amnlf414lhl4rv9vh8iffyp431v6s28gsr90: line 1:     3 Segmentation fault      (core dumped) /nix/store/ii28gjbmpkhwvcq7sa5g5risk29fcm4n-palette-generator/bin/palette-generator dark /nix/store/vdgsfcwl37xmr6sjjgx9wflp1xxhjc56-5cmpersecond.png $out

And the coredump has no message at all.

I don't even use the palette generated by it since I've provide my own one via: stylix.override.inputs.nix-colors.colorSchemes.catppuccin-mocha.

SrEstegosaurio commented 2 months ago

I've even tried running #318 just in case (it was mentioned as the only pending pr for https://github.com/danth/stylix/issues/330) with the same results.

trueNAHO commented 2 months ago

Could you git bisect run (as described in https://github.com/danth/stylix/issues/324) in order to find the faulty commit?

SrEstegosaurio commented 2 months ago

Never interacted with those parts of gitat all, but sure.

SrEstegosaurio commented 2 months ago

A first run returned 50cae37cfe23e5ad202ed53f48529139dfa0d008 as the first problematic commit tho it looks estrange so I'm going to run some more tests. I'm pretty new at this so sorry for the uncertainty.

SrEstegosaurio commented 2 months ago

The problem is that the commit is the one I inputted as good because due to the timestamp I recalled it worked.

SrEstegosaurio commented 2 months ago

I picked an absurd ancient commit to basically test the whole repo and still gave an error on the oldest commit possible which does not seam right.

trueNAHO commented 2 months ago

TBH, git bisect is fairly confusing if you have never used it.

Otherwise, just go back in the commit history one-by-one until you hit a point where it works again.

SrEstegosaurio commented 2 months ago

After some more testing I've found out that: 1) The error was comming from some inputs overrides. 2) I'm stupid for not realizing.

Sorry for not checking that before the bug report.

trueNAHO commented 2 months ago

After some more testing I've found out that:

  1. The error was comming from some inputs overrides.

Just to clarify: Was the error on your side or on Stylix' side?

  1. I'm stupid for not realizing.

Sounds like a typical programming session to me.

Sorry for not checking that before the bug report.

No worries!

SrEstegosaurio commented 2 months ago

Just to clarify: Was the error on your side or on Stylix' side?

The error only arises when having nixpkgs OR home-manager manually overriden to follow latest. The error is the same no matter the combination which is somewhat estrange but as it only happens when manually overriding the inputs I believe it is indeed on my end.

Sounds like a typical programming session to me.

Thanks :) (Also thankful for the quick response).

SrEstegosaurio commented 2 months ago

And here I am back with an horror story filled with what appears to be state. Let me explain:

Disabling both inputs overrides apparently solved the problem, I was finally able to rebuild and update my system. I rebooted and now it fails again with the exact same configuration.

The fact that the problem was fixed by disabling not one but two different overrides that used to work and didn't change by git bisect run was pretty suspicious to being with. (After giving some thoughts to this I would be scared if that was actually a solution).

Why do I think it has to do with state (and a cursed one for that matter)? Simple, this is a root-on-tmpfs system with manually persisted state. I have some finicky settings when it comes to nix, its cache and maybe some of its files so the fact that now I cannot build my system while having the exact same configuration while it used to work before is something bad.

I don't exactly know where does this leave me, for all I know the error could still be on my side due to some finicky, obscure and custom thing I even forgot I had, I wouldn't want to waste anyone's time on a me problem.

I've tried running pallette-generator outside the system building process via nix run github:danth/stylix\#packages.x86_64-linux.palette-generator dark /some/image /some/outputfile and it does not coredump, instead it works just fine.

My current theory is that it might be closer to being a me issue but I don't know what else could I do to test it.

trueNAHO commented 2 months ago

Disabling both inputs overrides apparently solved the problem, I was finally able to rebuild and update my system.

I rebooted and now it fails again with the exact same configuration.

This definitely sounds worth an investigation.

I've tried running pallette-generator outside the system building process via nix run github:danth/stylix\#packages.x86_64-linux.palette-generator dark /some/image /some/outputfile and it does not coredump, instead it works just fine.

My current theory is that it might be closer to being a me issue but I don't know what else could I do to test it.

Unfortunately, I am currently massively refactoring my "dotfiles" repository and would prefer not to update my inputs until I am done with it. This (hopefully) takes one month at most. Until then I sadly can't properly investigate your issue. For reference, my "dotfiles" repository is currently using Stylix at fcff15ac5ffbe81f1c66e352f3167c270d79cdab.

SrEstegosaurio commented 2 months ago

Don't worry, I'll manage until then. I also shouldn't be spending my time trying to get a cute looking desktop while I have important exams...

I'll post here updates if any to this issue, good luck refactoring dots it can be quite tedious.

Thanks!

danth commented 2 months ago

This is very strange indeed. Are you able to share the exact Nixpkgs and Home Manager revisions where the issue occurs?

And good luck with your exams!

SrEstegosaurio commented 2 months ago

This is very strange indeed. Are you able to share the exact Nixpkgs and Home Manager revisions where the issue occurs?

Well, things got even funnier since it started working again next morning no question asked.

I've been testing it a few on my end and I still had no idea why or how but it seams it was some sort of state/race condition on my end. So I'm closing this since I was unable to reproduce it anywhere else and it disappeared without updating my inputs...

And good luck with your exams!

Thanks! :)