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

ob commands don't cache #1103

Open
vaibhavsagar opened this issue Nov 22, 2024 · 5 comments
Open

ob commands don't cache #1103

vaibhavsagar opened this issue Nov 22, 2024 · 5 comments

Comments

@vaibhavsagar
Copy link
Collaborator

Running e.g. ob shell results in a rebuild each time when I would expect it to be cached after the first time, e.g.

vaibhavsagar@nixos-l14g3:~/repos/uptrust$ ob shell
./.obelisk/impl: command not cached, building ...
✔ Built on ./.obelisk/impl [command]
Hint: use '--no-interpret path/to/dependency' to force building an unpacked dependency and include it in this shell.

[nix-shell:~/repos/uptrust]$ exit
vaibhavsagar@nixos-l14g3:~/repos/uptrust$ ob shell
./.obelisk/impl: command not cached, building ...
✔ Built on ./.obelisk/impl [command]
Hint: use '--no-interpret path/to/dependency' to force building an unpacked dependency and include it in this shell.

How do I figure out why this is failing to cache?

@ryantrinkle
Copy link
Member

@madeline-os Do you know anything about this?

@tdimiduk
Copy link
Contributor

tdimiduk commented Mar 1, 2025

@ryantrinkle @madeline-os This was bugging me so I did some digging. It looks like the issue is the old version of nix thunk where caching is broken.

I've got a branch that gets caching working by updating nix-thunk to v0.7.0.1

https://github.com/tdimiduk/obelisk/tree/td/fix-nix-cache

However ReadThunkError lost it's show instance in this commit
obsidiansystems/nix-thunk@06f3a5e

So I had to comment out one bit of code to get it to compile.

I'd be happy to work on a PR to get caching working again, but there's some thornyness I'd need advice from Obsidian folks on how you'd like navigated. Obelisk would need larger changes to compile with all the way recent versions nix-thunk.

I see two main categories of solutions

Quick Hack (I could do this myself pretty easily)

Proper Solution (I'd probably need some help)

  • Add the show instance (or some pretty printer) to nix-thunk for ReadThunkError
  • Do the work to get obelisk working with nix-thunk latest. There are some larger API changes in nix-thunk that obelisk would need to catch up with.

@alexfmpe
Copy link
Collaborator

alexfmpe commented Mar 2, 2025

@tdimiduk see d799ab9 which bumps nix-thunk to 0.7.1 but the PR containing it (#1093) is blocked on the nix CI being down

@alexfmpe
Copy link
Collaborator

alexfmpe commented Mar 2, 2025

Ah actually, the migration to nix-thunk 0.7.0.1 happened earlier in the same PR. Here's the fix to the missing Read instance: 961f157#diff-0eb97b72c7ccff8bca8f6a20f18a4d718cc43abb335c9cf1512b82f0ed52a75dL181

@tdimiduk
Copy link
Contributor

tdimiduk commented Mar 2, 2025

Thanks for the context. Anything an interested outsider can do to help Obelisk PRs with merging faster? I see a lot of good work sitting in review that it seem like must be a bit of a hassle to keep track of.

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

4 participants