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

🐛 Delta panicking on Ubuntu WSL with bat cache #1942

Open
ethanrutt opened this issue Jan 16, 2025 · 3 comments
Open

🐛 Delta panicking on Ubuntu WSL with bat cache #1942

ethanrutt opened this issue Jan 16, 2025 · 3 comments

Comments

@ethanrutt
Copy link

  • Hey, just wanted to say I'm a huge fan of delta and it works great and this problem does not occur when I've used it in an Ubuntu VM, Arch Linux on bare metal, and Arch Linux in WSL. I am having problems with it in Ubuntu WSL though.
  • Note (just in case): WSL = Windows Subsystem for Linux.

TLDR

  • When there is an existing bat cache, the delta main thread panics and crashes.

System

  • Output of uname -a.
Linux DESKTOP-XXXXXX 5.15.167.4-microsoft-standard-WSL2 #1 SMP Tue Nov 5 00:21:55 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
  • Output of lsb_release -a.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy
  • Method of installation (this worked perfectly in an Ubuntu VM).
wget https://github.com/dandavison/delta/releases/download/0.18.2/git-delta_0.18.2_amd64.deb && sudo dpkg -i git-delta_0.18.2_amd64.deb
  • Output of delta --version.
delta 0.18.2
  • Relevant .gitconfig options.
[core]
	editor = nvim
	pager = delta
[interactive]
	diffFilter = delta --color-only
[delta]
	navigate = true
	side-by-side = true
	line-numbers = true
[merge]
	conflictStyle = zdiff3
	tool = nvimdiff
  • Note: I also have symlinked git-delta to delta so that I can just run delta with delta.

The Issue

  • Originally, I had a bat theme set up (Catppuccin Mocha, but this is not important) and when running delta or trying git diff, I received the following.
[bat warning]: Unknown theme 'Catppuccin-Mocha', using default.
thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bat-0.24.0/src/assets.rs:252:22:
something is very wrong if the default theme is missing
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  • I figured that this was user error, so I messed around a bit and disabled the Catppuccin Mocha theme. I then received
[bat warning]: Unknown theme 'Monokai Extended', using default.
thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bat-0.24.0/src/assets.rs:252:22:
something is very wrong if the default theme is missing
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
  • I then tried some older versions of delta to no avail.
  • Finally, I ran bat cache --clear and delta worked as normal.
  • However, this means I can't use any themes with bat or delta. Running bat cache --build and then trying to use delta again shows the same errors as above, no matter what theme I have set.
  • Something to maybe help debug, running bat cache --build to setup environment for "broken" delta then running delta with full backtrace with the command RUST_BACKTRACE=full delta yields the output
[bat warning]: Unknown theme 'Monokai Extended', using default.
thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bat-0.24.0/src/assets.rs:252:22:
something is very wrong if the default theme is missing
stack backtrace:
   0:     0x562eaaee8cf5 - <unknown>
   1:     0x562eaaf0fdeb - <unknown>
   2:     0x562eaaee5d6f - <unknown>
   3:     0x562eaaee9fe1 - <unknown>
   4:     0x562eaaee9cbc - <unknown>
   5:     0x562eaaeea641 - <unknown>
   6:     0x562eaaeea4a7 - <unknown>
   7:     0x562eaaee91b9 - <unknown>
   8:     0x562eaaeea134 - <unknown>
   9:     0x562eaab80523 - <unknown>
  10:     0x562eaab804eb - <unknown>
  11:     0x562eaad93ed9 - <unknown>
  12:     0x562eaac1c320 - <unknown>
  13:     0x562eaac5d759 - <unknown>
  14:     0x562eaabc2d0f - <unknown>
  15:     0x562eaabc13a3 - <unknown>
  16:     0x562eaac77a59 - <unknown>
  17:     0x562eaac6a603 - <unknown>
  18:     0x562eaac38b2d - <unknown>
  19:     0x562eaaede130 - <unknown>
  20:     0x562eaac785f5 - <unknown>
  21:     0x7f47e5dd8d90 - <unknown>
  22:     0x7f47e5dd8e40 - __libc_start_main
  23:     0x562eaab80cde - <unknown>
  24:                0x0 - <unknown>
@th1000s
Copy link
Collaborator

th1000s commented Jan 20, 2025

What are the used bat version in the various configurations (I doubt WSL is the culprit anywhere)? Also see #1712 (comment) where @ernstki compiled a list of compatible versions.

@ethanrutt
Copy link
Author

Ah that's a good observation.
On WSL I have bat --version

bat 0.19.0

Whereas on my VM I have bat --version

bat 0.24.0

I checked the list of compatible versions and 0.19.0 is on there, yet I'm still seeing this bug.
I have a feeling it is linked to #1712 though, since running the commands that previously errored would work fine even with the bat cache being built if I run them as root through sudo
Let me install a newer version and get back to you.

@ethanrutt
Copy link
Author

After installing the latest version of bat from the releases page from here (at the time of writing this, that is bat 0.25.0 (25f4f96)) and running bat cache --build, delta no longer crashes with any theme that i've tried.

Thank you!

Should I marked this as closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants