From-source nix-built artifacts without the "nix" Extra Attribute#31
From-source nix-built artifacts without the "nix" Extra Attribute#31
Conversation
raboof
left a comment
There was a problem hiding this comment.
one small thing to fix on the README, otherwise LGTM, great improvements
README.md
Outdated
|
|
||
| #### `nix` Extra Attribute | ||
|
|
||
| Source dependencies do not need locking. Originally this was implemented by completely ignoring dependencies with `nix` [extra attribute](https://www.scala-sbt.org/1.x/docs/Library-Management.html#Extra+Attributes), but this is not necessary anymore. |
There was a problem hiding this comment.
It might be confusing to document how it 'originally' worked, maybe just leave that out?
There was a problem hiding this comment.
It does still exist, which is what I wanted to document.
I've reduced it to more of a statement of fact.
Maybe my approach is too conservative and we should rip it out?
nix Extra Attribute
By adding the nix extra attribute, sbtix will ignore the dependency for the purpose of locking.
This used to be the only mechanism for handling local dependencies, but is now a legacy solution and/or escape hatch.
There was a problem hiding this comment.
ah right. I guess a reason to keep it would be so you could disambiguate between a nix-built dependency and the same version from a repo somewhere? I don't feel strongly either way.
| # This is unfortunate, because it will create duplication in the store during builds and development, | ||
| # but at least these can be GC-ed and allow the end result to only reference the single JARs that | ||
| # result from this copying operation. | ||
| copyFile (baseNameOf urlAttrs.path) (localBuildsRepo + "/" + urlAttrs.path) |
There was a problem hiding this comment.
Hmm, I see how this is an improvement in some cases, though indeed not in others. I'm OK with leaving it like this for now and perhaps fine-tuning further in the future.
(cherry picked from commit 3c43b5e)
Focus less on what was. This section should be moved into reference docs that aren't the README. It is not at all essential.
It wasn't used by the Nix code.
3aad7bd to
b8bb800
Compare
raboof
left a comment
There was a problem hiding this comment.
(the repo is available on the sbt side under two names, to support both maven and ivy style)
Co-authored-by: Arnout Engelen <arnout@bzzt.net>
| hashBash = | ||
| if urlAttrs.type or null == "built" | ||
| then ''$(sha256sum "${artifact}" | cut -c -64)'' | ||
| else ''$(echo ${toLower urlAttrs.sha256} | tr / _)''; |
There was a problem hiding this comment.
@raboof We could use sha256sum as an alternative here too, until the hash conversion functions are standardized. Does have a performance cost though.
Refs #20 (comment)
There was a problem hiding this comment.
Possible hash format conversion primops
There was a problem hiding this comment.
using the urlAttrs.sha256 seems OK to me
No description provided.