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

kitty: darwin-fix #338033

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkgs/applications/terminal-emulators/kitty/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ buildPythonApplication rec {
sphinx-inline-tabs
go
fontconfig
(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})
] ++ lib.optionals stdenv.isDarwin [
imagemagick
libicns # For the png2icns tool.
Expand Down Expand Up @@ -132,6 +131,11 @@ buildPythonApplication rec {
'';
in ''
runHook preBuild

# Add the font by hand because fontconfig does not finds it in darwin
mkdir ./fonts/
cp "${(nerdfonts.override {fonts = ["NerdFontsSymbolsOnly"];})}/share/fonts/truetype/NerdFonts/SymbolsNerdFontMono-Regular.ttf" ./fonts/
Copy link
Member

Choose a reason for hiding this comment

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

I'm using kitty from nixpkgs-24.05-darwin branch and I have not encountered any issues in this regard with the existing derivation.
How could I reproduce the issue being fixed here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not using macos, but someone is complaining about it here:
#337987

Copy link
Member

Choose a reason for hiding this comment

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

I was able to reproduce this error on a Mac and fix it using this PR, however, the build still failed due to a failing test:

kitty> test_utf_8_strndup (kitty_tests.glfw.TestGLFW.test_utf_8_strndup) ... skipped 'Skipping test on macOS because glfw-cocoa.so is not built with backend_utils'
kitty> ======================================================================
kitty> ERROR: test_zsh_integration (kitty_tests.shell_integration.ShellIntegration.test_zsh_integration)
kitty> ----------------------------------------------------------------------
kitty> Traceback (most recent call last):
kitty>   File "/private/tmp/nix-build-kitty-0.36.1.drv-0/source/kitty/launcher/kitty.app/Contents/MacOS/../../../../../kitty_tests/shell_integration.py", line 120, in test_zsh_integration
kitty>     pty.wait_till(lambda: pty.screen_contents() == q)
kitty>     ps1 = 'left>'
kitty>     pty = <kitty_tests.PTY object at 0x1067eeb40>
kitty>     q = 'left>                                                                     <right'
kitty>     rps1 = '<right'
kitty>     self = <kitty_tests.shell_integration.ShellIntegration testMethod=test_zsh_integration>
kitty>   File "/private/tmp/nix-build-kitty-0.36.1.drv-0/source/kitty/launcher/kitty.app/Contents/MacOS/../../../../../kitty_tests/__init__.py", line 397, in wait_till
kitty>     raise TimeoutError(f'Timed out: {msg}. Screen contents: \n {repr(self.screen_contents())}')
kitty>     end_time = 74605.662821416
kitty>     msg = 'The condition was not met'
kitty>     q = <function ShellIntegration.test_zsh_integration.<locals>.<lambda> at 0x10a200fe0>
kitty>     self = <kitty_tests.PTY object at 0x1067eeb40>
kitty>     timeout = 10
kitty>     timeout_msg = None
kitty> TimeoutError: Timed out: The condition was not met. Screen contents:
kitty>  "gpg-connect-agent: failed to create temporary file '/private/tmp/nix-build-kitty\n-0.36.1.drv-0/tmpls334ag9/.gnupg/.#lk0x0000600003200380.iridium.83077': No such \nfile or directory\ngpg-connect-agent: can't connect to the gpg-agent: No such file or directory\ngpg-connect-agent: error sending standard options: No agent running\nleft>                                                                     <right"
kitty> ======================================================================
kitty> ERROR: test_zsh_integration (kitty_tests.shell_integration.ShellIntegrationWithKitten.test_zsh_integration)
kitty> ----------------------------------------------------------------------
kitty> Traceback (most recent call last):
kitty>   File "/private/tmp/nix-build-kitty-0.36.1.drv-0/source/kitty/launcher/kitty.app/Contents/MacOS/../../../../../kitty_tests/shell_integration.py", line 120, in test_zsh_integration
kitty>     pty.wait_till(lambda: pty.screen_contents() == q)
kitty>     ps1 = 'left>'
kitty>     pty = <kitty_tests.PTY object at 0x10a507470>
kitty>     q = 'left>                                                                     <right'
kitty>     rps1 = '<right'
kitty>     self = <kitty_tests.shell_integration.ShellIntegrationWithKitten testMethod=test_zsh_integration>
kitty>   File "/private/tmp/nix-build-kitty-0.36.1.drv-0/source/kitty/launcher/kitty.app/Contents/MacOS/../../../../../kitty_tests/__init__.py", line 397, in wait_till
kitty>     raise TimeoutError(f'Timed out: {msg}. Screen contents: \n {repr(self.screen_contents())}')
kitty>     end_time = 74615.868298291
kitty>     msg = 'The condition was not met'
kitty>     q = <function ShellIntegration.test_zsh_integration.<locals>.<lambda> at 0x10a202e80>
kitty>     self = <kitty_tests.PTY object at 0x10a507470>
kitty>     timeout = 10
kitty>     timeout_msg = None
kitty> TimeoutError: Timed out: The condition was not met. Screen contents:
kitty>  "gpg-connect-agent: failed to create temporary file '/private/tmp/nix-build-kitty\n-0.36.1.drv-0/tmptzg42dt4/.gnupg/.#lk0x0000600003e204c0.iridium.83092': No such \nfile or directory\ngpg-connect-agent: can't connect to the gpg-agent: No such file or directory\ngpg-connect-agent: error sending standard options: No agent running\nleft>                                                                     <right"
kitty> ======================================================================
kitty> FAIL: test_ssh_leading_data (kitty_tests.ssh.SSHKitten.test_ssh_leading_data) (sh='zsh')
kitty> ----------------------------------------------------------------------
kitty> Traceback (most recent call last):
kitty>   File "/private/tmp/nix-build-kitty-0.36.1.drv-0/source/kitty/launcher/kitty.app/Contents/MacOS/../../../../../kitty_tests/ssh.py", line 167, in test_ssh_leading_data
kitty>     self.ae(pty.screen_contents(), 'UNTAR_DONE\nld:before_tarfile')
kitty>     pty = <kitty_tests.PTY object at 0x10a4a39e0>
kitty>     script = 'echo "ld:$leading_data"; exit 0'
kitty>     self = <kitty_tests.ssh.SSHKitten testMethod=test_ssh_leading_data>
kitty>     sh = 'zsh'
kitty>     tdir = '/private/tmp/nix-build-kitty-0.36.1.drv-0/tmprdnml_s6'
kitty> AssertionError: "gpg-connect-agent: failed to create temp[315 chars]file" != 'UNTAR_DONE\nld:before_tarfile'
kitty> - gpg-connect-agent: failed to create temporary file '/private/tmp/nix-build-kitty
kitty> - -0.36.1.drv-0/tmprdnml_s6/.gnupg/.#lk0x0000600002e1c500.iridium.81739': No such
kitty> - file or directory
kitty> - gpg-connect-agent: can't connect to the gpg-agent: No such file or directory
kitty> - gpg-connect-agent: error sending standard options: No agent running
kitty>   UNTAR_DONE
kitty>   ld:before_tarfile
kitty> ----------------------------------------------------------------------
kitty> Ran 131 tests in 35.226s
kitty> FAILED (failures=1, errors=2, skipped=3)


${ lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) "export MACOSX_DEPLOYMENT_TARGET=11" }
${if stdenv.isDarwin then ''
${python.pythonOnBuildForHost.interpreter} setup.py build ${darwinOptions}
Expand Down