Page MenuHomePhabricator

Update nix dev shell
ClosedPublic

Authored by jon on Apr 28 2022, 9:26 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 11:44 AM
Unknown Object (File)
Sat, Dec 14, 3:18 PM
Unknown Object (File)
Sat, Dec 14, 2:26 AM
Unknown Object (File)
Tue, Dec 10, 7:07 PM
Unknown Object (File)
Fri, Dec 6, 9:58 AM
Unknown Object (File)
Fri, Dec 6, 5:15 AM
Unknown Object (File)
Thu, Nov 28, 6:21 AM
Unknown Object (File)
Wed, Nov 27, 10:16 AM

Details

Summary

A lot has happened since the first initial yarn dev diff
This is to update the dependencies as they have evolved since
then

Depends on D3865

Test Plan

Run nix develop to create shell.
Run yarn cleaninstall to build all yarn projects

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

jon retitled this revision from Update dev shell to Update nix dev shell.Apr 28 2022, 9:26 PM
ashoat requested changes to this revision.Apr 29 2022, 2:54 PM

Thank you for adding all of these!!

nix/dev-shell.nix
8 ↗(On Diff #12094)

I don't think we want to pull Flow from Nix. It's handled by yarn, and it's important the version matches what is in the various package.jsons.

Instead of these, maybe can we set up a shell alias from flow to yarn flow?

12–13 ↗(On Diff #12094)

What are each of these for?

14 ↗(On Diff #12094)

I assume something needs to compile against this? What is it?

24 ↗(On Diff #12094)

I might be looking in the wrong place, but it seems like Nix's version of Arcanist is a little old. Is there a way to update it?

This revision now requires changes to proceed.Apr 29 2022, 2:54 PM
nix/dev-shell.nix
8 ↗(On Diff #12094)

I can remove it from nix. If it's part of a development flow, and people are expected to run yarn install, then the utility of having a pre-packaged version is much less important.

12–13 ↗(On Diff #12094)

python2 was added, because it's mentioned now in the dev docs

python3 was added because one of the yarn builds requires it.

14 ↗(On Diff #12094)
24 ↗(On Diff #12094)

I can update it upstream a bump.

It's now only 5 days old https://github.com/NixOS/nixpkgs/pull/171040

Remove explicit sqlite usage

nix/dev-shell.nix
8 ↗(On Diff #12094)

Agree, let's remove it

12–13 ↗(On Diff #12094)

I'm pretty sure that (quite unfortunately) the script that needs Python 2 actually needs python to default to Python 2.... :(

cc @atul

14 ↗(On Diff #12094)

Does this make it so that the buildscript from that sqlite3 npm package no longer needs to run?

I don't think the sqlite3 npm package expects sqlite3 sources / binary anywhere, so unless this has some utility for us (eg. lets us avoid the annoying Python2-requiring buildscript) then we should probably leave it out for now.

(Note that in our actual application we actually use a fork of sqlite3 called SQLCipher that supports encryption-at-rest – we only need sqlite3 as a transitive dependency for some dev tool)

24 ↗(On Diff #12094)

Thank you!!

ashoat requested changes to this revision.May 2 2022, 12:56 PM

Back to you for more follow-ups – not all of my initial comments have been addressed (eg. Flow is still there)

This revision now requires changes to proceed.May 2 2022, 12:56 PM
jon marked 5 inline comments as done.

Remove flow

nix/dev-shell.nix
12–13 ↗(On Diff #12094)

That should be current behavior

(nix-shell) [01:22:21] jon@jon-desktop /home/jon/comm/comm (joringer/add-nix-clean)
$ python --version
Python 2.7.18
(nix-shell) [01:23:40] jon@jon-desktop /home/jon/comm/comm (joringer/add-nix-clean)
$ python3 --version
Python 3.9.12
14 ↗(On Diff #12094)

I believe I still needed it on m1. Linux I did not.

But I would prefer not to do as much conditional logic, so linux can have a python2 interpreter :)

ashoat requested changes to this revision.May 6 2022, 8:30 AM
ashoat added inline comments.
nix/dev-shell.nix
27 ↗(On Diff #12320)

Confused why we still have this, see my previous feedback

This revision now requires changes to proceed.May 6 2022, 8:30 AM

Remove sqlite from dev env

jon added inline comments.
nix/dev-shell.nix
27 ↗(On Diff #12320)

Yep, my bad.

ashoat added 1 blocking reviewer(s): varun.

Woohoo, we have a bunch more stuff in there now. @varun – can you take a look and see if we need another else for the Rust environment to work with nix develop?

varun requested changes to this revision.May 11 2022, 10:57 AM

I think we need rustup so we can use other Rust tools besides cargo. It seems like this is a common way that people add Rust to their devShell. Thoughts?

This revision now requires changes to proceed.May 11 2022, 10:57 AM

rustup allows you to switch between rust channels easily, and I can reflect the rust version needed with nix. I just used the latest stable, as that's generally enough unless you need a nightly toolchain.

varun requested changes to this revision.May 11 2022, 12:12 PM

just synced with jon. one small todo: add rustfmt

This revision now requires changes to proceed.May 11 2022, 12:12 PM

Add dependencies for identity service and tunnelbroker

quick question inline, but lgtm!

nix/dev-shell.nix
36–37 ↗(On Diff #12566)

are these comments placeholders?

This revision is now accepted and ready to land.May 11 2022, 12:23 PM
jon added inline comments.
nix/dev-shell.nix
36–37 ↗(On Diff #12566)

it's more or less to avoid people thinking that clang or gcc need to be explicitly mentioned

This revision was automatically updated to reflect the committed changes.
jon marked an inline comment as done.