Skip to content
This repository has been archived by the owner on Oct 15, 2022. It is now read-only.

Install command #123

Closed
wants to merge 1 commit into from
Closed

Conversation

justinwoo
Copy link
Contributor

Adds a simple install command, so that users don't need to run lorri daemon or lorri watch just to have the shell root built. This makes lorri conform to most people's expectations of how tools like this work, where you have an init phase that initializes config, and an install phase that will do the setup based on the current configuration.

This really only does the same thing as watch but using the once mode of the build loop.

Based off #122, preventing merge conflicts. Can be rebased when needed.

@justinwoo
Copy link
Contributor Author

Rebased this now, so it's just one small commit.

@Profpatsch
Copy link
Collaborator

Not to bring up unnecessary bikeshedding, but what about lorri build?

@justinwoo
Copy link
Contributor Author

Sounds a little bit evil based off of the description of the "build" command in previous versions. I still think install avoids this collision and works according to how people expect install to install dependencies

@Profpatsch
Copy link
Collaborator

Profpatsch commented Aug 7, 2019

After some deliberation, we decided we’d ideally call it lorri run, but lorri watch --once would be the best solution for now, see commit message.

@Profpatsch Profpatsch requested a review from grahamc August 7, 2019 17:30
@justinwoo
Copy link
Contributor Author

You could call it "run", but having it be under a flag for watch is probably the worst one for usability. There's no way a new user will find this readily, and there's also no other tools I use where I say "watch my files to build but do it just once".

@Profpatsch
Copy link
Collaborator

Profpatsch commented Aug 7, 2019

True, @grahamc should we just add the new command now?

@justinwoo
Copy link
Contributor Author

I'm going to change this back in my branch because 1) I already use this 2) I have some other people also using this 3) there should be a separate command for this action. It really makes no sense to make the UI of this tool so confusing as to introduce a bunch of its own terminology.

@grahamc
Copy link
Contributor

grahamc commented Aug 13, 2019

Overall the code in this PR looks fine and I have no objections to the code itself. However this is not the direction that we want to go with lorri right now. lorri is intended to be used with the watcher going continuously and if this causes any problems then we should try to tackle the actual problems and not try to come up with workarounds.

Having an option to watch to run just once makes sense as part of a debugging interface but making it its own top-level command implicitly makes it part of the intended workflow.

Could you maybe elaborate a bit again on your usecase scenario that made you want this command? Is adding lorri watch --once going to solve your problem?

@justinwoo
Copy link
Contributor Author

I don't change my shell.nix constantly, so I don't want to run a watcher or daemon to try to constantly listen for changes, ever. When introducing me to lorri, Profpatsch had me run lorri watch once and ctrl-C break it.

What I want to have is what lorri does currently, but with the install command. I don't ever want to run the daemon. When I check out or make a new project, I expect to have some static shell.nix that I will not edit for a while. When I DO start editing this shell.nix, OR it is that whatever project I'm working frequently has changes to shell.nix or related sources, I might choose to then use lorri watch or lorri daemon to actually listen to changes as I make them.

I don't see what "watch once" does other than just obfuscate using this command. I understood that lorri is supposed to be about installing dependencies for my development environment, which is why I explicitly want to "install" these once given that I am not changing them at the given moment I run this install command.

@Profpatsch
Copy link
Collaborator

What I want to have is what lorri does currently, but with the install command. I don't ever want to run the daemon.

The daemon is designed to be near-zero overhead (once we get a good grip on how many files are watched), but I can understand that people don’t want to run anything permanently that they don’t regularly use/need.

Graham is the main author of this project, so he has the final word on what he wants to be the focus and what not. I assume it’s fine with you @justinwoo if such an operation exists at all, regardless of how discoverable it is.

@justinwoo
Copy link
Contributor Author

The overhead is not an issue with me as much as knowing when and why something will change.

I am not actually fine with such a command existing "regardless of how discoverable", which is why I'm talking about this so much in here. I would really like to avoid being asked for support about something we can make readily usable now rather than later.

@symbiont-joseph-kachmar
Copy link

symbiont-joseph-kachmar commented Aug 13, 2019

Heyo, not an active user yet (but I’ve been looking at lorri as I start to explore using Nix for development a bit more).

Just wanted to say that, from a conceptual perspective, watch once really doesn’t make very much sense to me.

It feels as if it embraces the notion of tying some incidental behavior (installing the dependencies in a given shell.nix) to an almost unrelated invocation (watching the project for changes).

It makes sense that watch will install dependencies if nothing is installed, since the command would be useless without it, but its raison d'être feels like it should be “Monitor the project and act on a detected change.”

Does that make sense?

@Profpatsch
Copy link
Collaborator

We decided to add lorri watch --once for now. See #161

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants