Page MenuHomePhabricator

[Nix] Install watchman through homebrew
ClosedPublic

Authored by jon on Jan 23 2023, 11:35 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 1:56 PM
Unknown Object (File)
Tue, Oct 29, 7:52 AM
Unknown Object (File)
Tue, Oct 29, 7:52 AM
Unknown Object (File)
Tue, Oct 29, 7:52 AM
Unknown Object (File)
Tue, Oct 29, 7:52 AM
Unknown Object (File)
Tue, Oct 29, 7:49 AM
Unknown Object (File)
Oct 6 2024, 2:22 PM
Unknown Object (File)
Sep 29 2024, 10:48 PM
Subscribers

Details

Reviewers
atul
ashoat
varun
bartek
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rCOMM848ec3137982: [Nix] Install watchman through homebrew
Summary

'watchman' on nixpkgs is very old; until it has
been updated, use watchman from homebrew instead.

https://linear.app/comm/issue/ENG-2711

Test Plan
nix develop

# May take a while as brew install is quite long
which watchman # Comes from homebrew install path
watchman --version # Should be 2023.01.23.00

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Owners added a reviewer: Restricted Owners Package.Jan 23 2023, 11:35 AM
ashoat added inline comments.
scripts/install_homebrew_deps.sh
1 ↗(On Diff #21226)

Is there any risk that the first time this is run, it won't install because the Nix-sourced Homebrew will be there?

atul added inline comments.
scripts/install_homebrew_deps.sh
13 ↗(On Diff #21226)

Minor style thing, but should we put a space after >?

Looks like we have both in the repo eg:

0b6016.png (290×3 px, 80 KB)

jon added inline comments.
scripts/install_homebrew_deps.sh
1 ↗(On Diff #21226)

/bin/bash should still be there. And this script is compatible with bash 3.2. It's just the execution of direnv's .envrc which may require a more recent version.

13 ↗(On Diff #21226)

I most commonly see it used with the handle immediately after. But I don't have a strong preference.

This revision is now accepted and ready to land.Jan 24 2023, 12:57 PM
scripts/install_homebrew_deps.sh
1 ↗(On Diff #21226)

Sorry, I put this comment in the wrong place... should've put it on line 13. And also said "Homebrew" when I should've said "Watchman".

Basically asking if there's a risk that the old Nix-installed Watchman will still be here when this code runs, so install_if_missing will judge it's not missing and won't install it

jon added inline comments.
scripts/install_homebrew_deps.sh
1 ↗(On Diff #21226)

Basically asking if there's a risk that the old Nix-installed Watchman will still be here when this code runs, so install_if_missing will judge it's not missing and won't install it

On new usages of nix develop. No. There shouldn't be a watchman which is being introduced through nix.

jon added inline comments.
scripts/install_homebrew_deps.sh
1 ↗(On Diff #21226)

https://phab.comm.dev/D6392 should ensure that direnv users get changes to the dev shell.

ashoat requested changes to this revision.Jan 26 2023, 7:05 AM
ashoat added inline comments.
scripts/install_homebrew_deps.sh
1 ↗(On Diff #21226)

On new usages of nix develop. No. There shouldn't be a watchman which is being introduced through nix.

Not clear what you mean by "new usages of nix develop". Presumably the "old usages of nix develop" won't even be running this code, so I'm really confused what the distinction you're introducing here.

Is there a risk that the old Nix-installed Watchman will still be here when this code runs, so install_if_missing will judve it's not missing and won't install it?

This revision now requires changes to proceed.Jan 26 2023, 7:05 AM

Not clear what you mean by "new usages of nix develop". Presumably the "old usages of nix develop" won't even be running this code, so I'm really confused what the distinction you're introducing here.

All depends on when they first ran nix develop and depends if they exit that shell before running nix develop again.

For example:

  • Checks out current master
  • Runs nix develop
  • Runs git pull origin master, pulling in these changes
  • Runs nix develop

In this scenario, they will still have the old nixpkgs watchman, as the second invocation of nix develop inherited watchman from the first invocation.

"Proper workflow":

  • Checks out current master
  • Runs nix develop
  • Runs git pull origin master, pulling in these changes
  • Quits the current shell (e.g. exit or Ctrl+D)
  • Runs nix develop

In this scenario, they are good, the previous dev shell was renewed.

In direnv, this also isn't an issue after D6392 which landed.

Got it, thanks for explaining!! So the "nested nix develop" might not get this installed, but presumably when the user exits the top-level nix develop and reenters, THEN brew install watchman will get run

This revision is now accepted and ready to land.Jan 26 2023, 11:55 AM

So the "nested nix develop" might not get this installed, but presumably when the user exits the top-level nix develop and reenters, THEN brew install watchman will get run

Correct

This revision was automatically updated to reflect the committed changes.