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

Don't wait for nix show-derivation when deciding whether to provide UI feedback #835

Merged
merged 11 commits into from
Dec 20, 2022

Conversation

ali-abrar
Copy link
Member

@ali-abrar ali-abrar commented Dec 31, 2020

Before this patch, we diffed the output of nix show-derivation to determine whether to attempt to rebuild the staticFiles derivation. Unfortunately, show-derivation often takes a significant amount of time and seems to do much of the same work involved in building the derivation. While we're waiting for the results of show-derivation to decide whether to embark upon and notify the user of an asset rebuild, the user gets no indication that we've noticed their change.

The tradeoff with this patch is that we'll be a little noisier: changes that don't actually impact the derivation but are within the project directory will cause no-op rebuilds for which the user will receive notifications. However, this is probably superior to a long, brooding silence while we determine whether to rebuild or not. To mitigate the problem, we ignore some common temp files that editors leave lying around, and limit our file-watching to the frontend, common, backend, and static folders.

I have:

  • Based work on latest develop branch
  • Followed the contribution guide
  • Looked for lint in my changes with hlint . (lint found code you did not write can be left alone)
  • Run the test suite: $(nix-build -A selftest --no-out-link)
  • Updated the changelog
  • (Optional) Run CI tests locally: nix-build release.nix -A build.x86_64-linux --no-out-link (or x86_64-darwin on macOS)

@ali-abrar
Copy link
Member Author

Currently experimenting with using hnix to parse and evaluate the static asset derivation, with the hope of only watching the files that the evaluation cares about. That'll get rid of all this ignoredFiles stuff.

@ali-abrar
Copy link
Member Author

ali-abrar commented Feb 3, 2021

Related: haskell-nix/hnix#804

Once that PR is done, we can try to use that functionality to implement a more nuanced nix watcher.

@ali-abrar ali-abrar changed the title Don't wait for nix show-derivation when deciding whether to provide UI feedback WIP: Don't wait for nix show-derivation when deciding whether to provide UI feedback Feb 3, 2021
@ali-abrar ali-abrar changed the title WIP: Don't wait for nix show-derivation when deciding whether to provide UI feedback Don't wait for nix show-derivation when deciding whether to provide UI feedback Dec 20, 2022
@ali-abrar
Copy link
Member Author

Related: haskell-nix/hnix#804

Once that PR is done, we can try to use that functionality to implement a more nuanced nix watcher.

Not doing this.

@cgibbard cgibbard merged commit 915e696 into develop Dec 20, 2022
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

Successfully merging this pull request may close these issues.

2 participants