NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.05k stars 14.08k forks source link

gitk does not run #86003

Open anm opened 4 years ago

anm commented 4 years ago

Describe the bug

gitk does not run.

To Reproduce

nix-shell -p gitFull

$ gitk Error in startup script: expected integer but got "Vera" (database entry for "-font" in widget "._tk_setpalette.button") invoked from within "$q .tk_set_palette.$q" (procedure "tk_setPalette" line 82) invoked from within "tk_setPalette background $c selectColor $selc" (procedure "setui" line 8) invoked from within "setui $uicolor" (file "/nix/store/922lxf3iy0mznrll0lrvy9vrwjan0d50-git-2.23.1/bin/gitk" line 12410)

Notify maintainers

Metadata

$ nix-shell -p nix-info --run "nix-info -m"

Maintainer information:

iblech commented 4 years ago

Thank you for the report! I'm not the maintainer of the git package, but still I quickly looked into it.

Unfortunately I cannot reproduce this. Could you paste the contents of your ~/.config/git/gitk? I have the impression that as uicolor, somehow a font (Vera) was sent instead of a proper color. (For instance, in my (auto-generated) config file, grey85 is given as uicolor.

I also have a question to the experts of my own: I tried to obtain exactly the version of gitk used by @anm, by nix-shell -I nixpkgs=https://releases.nixos.org/nixos/19.09/nixos-19.09.2426.9237a09d8ed/nixexprs.tar.xz -p gitFull. However that way I still get a slightly newer version of gitk (2.23.2 instead of 2.23.1). Do you know why?

anm commented 4 years ago

I had an autogenerated config file. Deleting it made no difference. In any case, it contained set uicolor grey85

iblech commented 4 years ago

Thank you for the quick reply. I can reproduce this now; the problem has apparently affected other people with other Tcl/Tk software as well, see for instance https://github.com/unknown-horizons/unknown-horizons/issues/2298.

To reproduce, issue echo "*font: xft:Bitstream Vera Sans Mono" | xrdb -merge. gitk will fail to start then, even on latest unstable. The problem are the spaces in the font name.

@anm, you can dump your X Resources with xrdb -query and remove them for the current session by xrdb -remove. This should allow you to use gitk, but is of course not a proper solution. If you can confirm that this indeed solves the issue for you, then the next step is probably to open an upstream bug for gitk.

stale[bot] commented 4 years ago

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

iblech commented 4 years ago

Unfortunately, I can confirm that the issue still persists, even on current unstable. I escalated this bug to the git developer mailing list.

anm commented 3 years ago

Thanks for investigating this. xrdb -remove does not work for me. It seems that I get the same error so I guess this font is used as a default anyway. The following workaround does work though, where I picked a random font that does not have a space in the name: echo "*font: xft:LucidaBright" | xrdb -merge

I have now encountered the same bug, and workaround, when running puredata which also uses Tk.

anm commented 3 years ago

The maintainers of tk seem to be @lovek323 and @vrthra - maybe you can help with this, or I should open a bug for tk generally?

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

nat-418 commented 1 year ago

NixOS 22,11 proposes nix-shell -p git-doc to provide gitk. After entering that shell, gitk is still not found and the same shell suggestion is given.

patka-123 commented 11 months ago

Hello @anm :wave:

I have tried to reproduce this error, but when I run nix-shell -p gitFull and then run gitk everything seems to work normally. Does this mean your issue has been resolved by now? If so, would you be able to close this issue?

(I'm going through issues marked as stale to see what can be resolved. If this is still an issue then don't mind me).

anm commented 11 months ago

I no longer use nixos so cannot test.

On Thu, 23 Nov 2023, 18:00 Patka, @.***> wrote:

Hello @anm https://github.com/anm 👋

I have tried to reproduce this error, but when I run nix-shell -p gitFull and then run gitk everything seems to work normally. Does this mean your issue has been resolved by now? If so, would you be able to close this issue?

(I'm going through issues marked as stale to see what can be resolved. If this is still an issue then don't mind me).

— Reply to this email directly, view it on GitHub https://github.com/NixOS/nixpkgs/issues/86003#issuecomment-1824659993, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADQPS6QVRDXBUAXVKBGG63YF5XKNAVCNFSM4MQXOTD2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBSGQ3DKOJZHEZQ . You are receiving this because you were mentioned.Message ID: @.***>

iblech commented 11 months ago

Unfortunately the issue still persists. I'm not personally affected by it. But it does exist.

It surfaces if via X Resources there is a font configured whose name contains a space.

You can reproduce as follows: https://github.com/NixOS/nixpkgs/issues/86003#issuecomment-619420738

iblech commented 11 months ago

I tracked this down a bit further.

This issue is entirely unrelated to gitk. Already pure Tk has this issue. You can reproduce as follows:

$ nix-shell -p tk
[nix-shell:~]$ echo "*font: xft:Bitstream Vera Sans Mono" | xrdb -merge
[nix-shell:~]$ wish
% button .a
expected integer but got "Vera"

If you configure a font name without spaces, the bug does not surface.