NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.11k stars 14.15k forks source link

Package request: bruno-cli #335270

Closed jtara1 closed 1 day ago

jtara1 commented 2 months ago

Project description cli for bruno

cli alternative to bruno, the IDE for testing APIs

Metadata


Add a :+1: reaction to issues you find important.

greg-hellings commented 1 week ago

The existing bruno package includes only the graphical application. There is also a CLI interface that is available from the same source.

The current build process does create the bru executable at node_packages/.bin/bru, but it only includes a reference to the source folder calling its run command. I tried to create a PR to package the CLI executable in a separate output, but I could not figure out how to get an executable version that wasn't just a symlink back to the original file.

gepbird commented 6 days ago

I'll try to do this in a few hours/days, thanks for bumping this!

Even if they are built from the same source, I think we should create a different derivation for it. I'm looking at the output of bruno and I all the files look related to the GUI application, so sharing those files with bruno-cli wouldn't help with disk space. Maybe with build time it would be more efficient, but I (and presumably most end users and some maintainers) am not familiar with making a package produce multiple outputs where the user can choose which outputs he wants. And merging bruno and bruno-cli into one package would cause other bruno users to download extra files which they'll probably never use.

I'd love to hear other maintainers' opinions on how we should split the GUI and the CLI app. cc @mattpolzin @lucasew @kashw2 @water-sucks @redyf

greg-hellings commented 6 days ago

I'll try to do this in a few hours/days, thanks for bumping this!

Even if they are built from the same source, I think we should create a different derivation for it. I'm looking at the output of bruno and I all the files look related to the GUI application, so sharing those files with bruno-cli wouldn't help with disk space. Maybe with build time it would be more efficient, but I (and presumably most end users and some maintainers) am not familiar with making a package produce multiple outputs where the user can choose which outputs he wants. And merging bruno and bruno-cli into one package would cause other bruno users to download extra files which they'll probably never use.

So creating multiple outputs from the same derivation isn't too tough. You just set outputs = [ "out" "cli" ]; in the derivation arguments. out is the default derivation and is referenced in the installPhase as $out already. Anything that belongs in the CLI package would be installed to $cli in the installPhase. When people reference the bruno package they'll get whatever is in $out but they can reference bruno.cli if they want the CLI package.

But from what I understand, those types of packages are intended to depend on the out package - it's usually reserved for things like foo.dev and foo.doc. And that's definitely not what we would want here. There probably is the chance to share some of the deps or source packages, for sure. But you might be right that this deserves its own separate package.