sbt-derivation icon indicating copy to clipboard operation
sbt-derivation copied to clipboard

Upstreaming to nixpkgs

Open wizeman opened this issue 3 years ago • 2 comments

Have you thought about upstreaming sbt-derivation to nixpkgs?

I am trying to package a project that uses sbt but having sbt-derivation outside nixpkgs complicates my efforts and prevents me from submitting the package to nixpkgs.

I can also see that someone else ran into the same issue: https://github.com/NixOS/nixpkgs/issues/66281

I could probably review your PR and guide you if anything is needed (except for adding documentation as I know nothing about that).

wizeman avatar Mar 15 '21 19:03 wizeman

Hi @wizeman and thanks for bringing this up. It is definitely not an issue to contribute it upstream, I might give it a try over the next few days, whenever I find some free time.

The docs part is what I also miss, I know there are plans to move to markdown, but I don't know how far they are.

Do you think a separate discussion forum would be helpful? Is my sbt-derivation the accepted go-to solution for packaging Scala apps in nixpkgs? What about the others? Just open questions, not really directed to you ;)

zaninime avatar Mar 18 '21 17:03 zaninime

The docs part is what I also miss, I know there are plans to move to markdown, but I don't know how far they are.

It seems like the language-specific build instructions have already been converted to markdown in the master branch, which makes writing documentation much easier, I think: https://github.com/NixOS/nixpkgs/tree/master/doc/languages-frameworks

Do you think a separate discussion forum would be helpful?

My suggestion would be to directly submit a PR (maybe as a draft if you're not too sure) and let the reviews/comments guide you. I always find having something that works even though is not perfect is better than not having anything at all, so I'm guessing it's way more likely for this solution to be accepted (perhaps with some minor changes) than for it to be rejected, unless someone finds a different solution that is clearly better, which seems unlikely.

Is my sbt-derivation the accepted go-to solution for packaging Scala apps in nixpkgs? What about the others?

To be honest, I know nothing about Scala or sbt. But I did want to package an program that uses sbt and sbt-derivation is the only working solution that I could find.

I can also tell you that I worked on implementing and integrating the Rust/cargo-based dependency downloader that is currently used in nixpkgs and the approach that you're using in sbt-derivation is almost exactly the same as the one I used for Rust/cargo, except that in your case you can't avoid building the project as part of downloading dependencies, due to limitations in sbt. I also believe that there are build systems for other programming languages which are used in nixpkgs in a similar way.

Perhaps sometime in the future, someone can file an issue upstream (in sbt I mean) to request a command to download dependencies as they are needed for compilation, without doing the actual compilation. But even if this is not available today, I still think it's better to have something working than not having anything at all...

wizeman avatar Mar 19 '21 10:03 wizeman