Page MenuHomePhabricator

[Nix] Cache PATH between nix develop invocations
ClosedPublic

Authored by jon on Oct 7 2022, 3:09 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 14, 5:43 PM
Unknown Object (File)
Fri, Dec 6, 12:22 PM
Unknown Object (File)
Thu, Nov 28, 11:30 PM
Unknown Object (File)
Thu, Nov 28, 11:30 PM
Unknown Object (File)
Tue, Nov 26, 5:07 PM
Unknown Object (File)
Sun, Nov 24, 2:46 PM
Unknown Object (File)
Nov 18 2024, 7:39 AM
Unknown Object (File)
Nov 18 2024, 2:55 AM
Subscribers

Details

Reviewers
atul
varun
abosh
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rCOMM6f8a14fa59f2: [Nix] Cache PATH between nix develop invocations
Summary

For certain environments such as XCode, it would be nice to be able
to pull in the correct version of tools needed for building native
dependencies.

Have nix write the PATH to a file, so we can source it later.

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

Test Plan
# trigger `nix develop`
nix develop --command true

cat ~/.cache/comm/path
# should show `export PATH=...`

source ~/.cache/comm/path
protoc --version # should be 3.15.8

Diff Detail

Repository
rCOMM Comm
Branch
jonringer/save-path
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Owners added a reviewer: Restricted Owners Package.Oct 7 2022, 3:09 PM
atul@atuls-MacBook-Pro comm % nix develop --command true
warning: Using saved setting for 'extra-trusted-public-keys = comm.cachix.org-1:70RF31rkmCEhQ9HrXA2uXcpqQKGcUK3TxLJdgcUCaA4=' from ~/.local/share/nix/trusted-settings.json.
warning: Using saved setting for 'extra-trusted-substituters = https://comm.cachix.org' from ~/.local/share/nix/trusted-settings.json.
Existing MariaDB instance found outside of nix environment
Please stop existing services and attempt 'nix develop' again
Existing Redis instance found outside of nix environment
Please stop existing services and attempt 'nix develop' again
Welcome to Comm dev environment! :)
atul@atuls-MacBook-Pro comm % cat ~/.cache/comm/path
export PATH=/nix/store/nqjp3mb32sv58ll03fga4zshla2zp3jw-arcanist-20220517/bin:/nix/store/s8044n9xa18dbxxpd5mxhyn76424mqqy-shellcheck-0.8.0-bin/bin:/nix/store/f2gynqqhnkvjb6hhgps2bnxjz1agiyb6-mariadb-server-10.8.3/bin:/nix/store/asnyhrv2d20112nfdf3q8jdknd388irc-nodejs-16.13.0/bin:/nix/store/rl1mnd64z1fn81961xz4vy0kk482vah2-yarn-1.22.19/bin:/nix/store/1pzi3kdwj2nq4a2zabnp5241qji66ky7-watchman-4.9.0/bin:/nix/store/qdlin9dzc39gxs2w2qmpi5qjv5862mil-python3-3.10.5/bin:/nix/store/lq4yyhcd6y78sivcablj2qn4km33wa1r-redis-7.0.4/bin:/nix/store/yydd64k1lqpi8f9j8paf4x6zckw4sglz-cargo-1.62.0/bin:/nix/store/8jkgnhzc6v86bzwqi0wsl0an3c8k7i8s-rustc-1.62.0/bin:/nix/store/24z0azfif6sisdfgsxnx8rfyisykgvjh-rustfmt-1.62.0/bin:/nix/store/1axpb3xdsicc3fcchak26mkblcbsigvg-c-ares-1.18.1/bin:/nix/store/cg3f9hs6zdag48yi8zdpg3kwq9ffcpbj-cmake-3.23.2/bin:/nix/store/j20vbcn01ry38avz9di4flswy2qr0iw1-ps-adv_cmds-119/bin:/nix/store/q0fska5z5y73rdwkwds369hbcs07r6ny-cmake-format-0.6.13/bin:/nix/store/9fx94ap6211kxqhadiyqglyz2d5sa8py-python3.10-autopep8-1.6.0/bin:/nix/store/w8a5wvi68wv5jdy72rmmybz7f3dh06di-python3.10-pycodestyle-2.8.0/bin:/nix/store/j84a0da0pv19n51a5sx46gkzkhd89z5r-python3.10-flake8-4.0.1/bin:/nix/store/icpi7117ar5dlz6y281y2j528yva60qy-python3.10-pyflakes-2.4.0/bin:/nix/store/asj5q9wsyi9nsb0m7k1fqrma9f799m18-python3.10-babel-2.10.3/bin:/nix/store/fldy6nd1yjzr1rkzgdlcxll5m6hs8pb3-python3.10-pylint-2.14.1/bin:/nix/store/jyxvwvhndnls805j3lq9v7lchzwxpm74-python3.10-dill-0.3.4/bin:/nix/store/ghxyfgxnw0l1daa0kdp3nbyil37yabvg-python3.10-isort-5.10.1/bin:/nix/store/wf9rhgv9fl49s7cmck0x3gly318f0awz-pkg-config-wrapper-0.29.2/bin:/nix/store/r5nv2l4hiraggzawpjhxhbqgnc93p0a9-protobuf-3.15.8/bin:/nix/store/hc352fql4h9nga53mxhgr5s7mlxj47w7-grpc-1.47.0/bin:/nix/store/gyli5g6i4j7zcg71yxmswa2l4nf52zfj-cocoapods-1.11.3/bin:/nix/store/84bdn74mjlh7cx3yypi71zapb75lfbmx-clang-wrapper-11.1.0/bin:/nix/store/hmdvis82jllzhbmhnhpvladxpn18zzp3-clang-11.1.0/bin:/nix/store/dxlf8j5g57wlbdfqnafnx89q5hy27fvy-coreutils-9.1/bin:/nix/store/1drcmlzv0bnxlx0r5glnznaiwymn6zsm-cctools-binutils-darwin-wrapper-949.0.1/bin:/nix/store/cqld0cli2q9ghdq14y2j3i360a40c60d-cctools-binutils-darwin-949.0.1/bin:/nix/store/5nwgpil93v5pma7jpbjbap2xm5lfqg4p-openssl-1.1.1q-bin/bin:/nix/store/mvb4sp6fpyjnfp392mh7906xgla0pgkv-gflags-2.2.2/bin:/nix/store/y66rz9lw8dhkxqfqcynhxj0mwx1q2y5d-sqlite-3.39.0-bin/bin:/nix/store/gj18d8wwyl0jrn5h2wy2p8q23jc79300-libiconv-50/bin:/nix/store/dxlf8j5g57wlbdfqnafnx89q5hy27fvy-coreutils-9.1/bin:/nix/store/xn7jclafz9h92qk7f68b98bhzmx6x21n-findutils-4.9.0/bin:/nix/store/ss8lcq5h2gsmhrzmd6yri3kmlc8ibyjw-diffutils-3.8/bin:/nix/store/640bjlwx0q0dkcvj885n6pd4k87bjiyf-gnused-4.8/bin:/nix/store/7d2m3ddjrrp5phafpifkmad20m3a6813-gnugrep-3.7/bin:/nix/store/rl8c80l5diilvhv0mb0640nfzcsrsly7-gawk-5.1.1/bin:/nix/store/183p83zlrkgqa71vffipyv6dr4d3933r-gnutar-1.34/bin:/nix/store/kzampc2mvdvz8rkz7ig0f243z3bk39i3-gzip-1.12/bin:/nix/store/7hs3frn6y85qdlsyc20645yghpj3hz0h-bzip2-1.0.6.0.2-bin/bin:/nix/store/q7mw4564hniwhd5qff46wcfxywcp5gb1-gnumake-4.3/bin:/nix/store/b5wy2gwvqpgc9iwqhnbrw6xmm7i1zz4q-bash-5.1-p16/bin:/nix/store/rg7fxz4l7a24avsg2vkaanaw1z90809w-patch-2.7.6/bin:/nix/store/mcfi76ykmhs69651ka2mr8izvrn88i4m-xz-5.2.5-bin/bin:/nix/store/zlrn3c44nf4vdlyrkr2rl23yz7w7pp1y-file-5.42/bin:/opt/homebrew/opt/openssl@3/bin:/opt/homebrew/opt/openssl@3/bin:/opt/homebrew/opt/node@16/bin:/Users/atul/.nvm/versions/node/v16.9.0/bin:/opt/homebrew/opt/php@7.4/sbin:/opt/homebrew/opt/php@7.4/bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/opt/php@7.4/sbin:/opt/homebrew/opt/php@7.4/bin:/Users/atul/.local/bin:/Users/atul/.sdkman/candidates/java/current/bin:/Users/atul/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Library/Apple/usr/bin:/Users/atul/.cargo/bin:/Users/atul/Library/Android/sdk/emulator:/Users/atul/Library/Android/sdk/tools:/Users/atul/Library/Android/sdk/tools/bin:/Users/atul/Library/Android/sdk/platform-tools:/Users/atul/arcanist/bin:./node_modules/.bin:/Users/atul/Library/Android/sdk/emulator:/Users/atul/Library/Android/sdk/tools:/Users/atul/Library/Android/sdk/tools/bin:/Users/atul/Library/Android/sdk/platform-tools${PATH:+:}"$PATH"
atul@atuls-MacBook-Pro comm % source ~/.cache/comm/path
atul@atuls-MacBook-Pro comm % protoc --version
libprotoc 3.15.8
This revision is now accepted and ready to land.Oct 10 2022, 11:02 AM