schovi / baked_file_system

Virtual File System for Crystal language. Embedding your assets into final binary.
MIT License
177 stars 18 forks source link

Missing `shard.lock` #45

Closed auroraanna closed 1 year ago

auroraanna commented 2 years ago

The shard.lock file is missing in this crystal project. For example this I'm working on PR fails because of it. Please release 0.10.1 to fix this.

straight-shoota commented 2 years ago

There's no technical need for a lockfile here. Library shards like this one are not intended to be installed on their own, but as part of the dependency tree of dependent shards. And those would have a lockfile which includes all their dependencies. Thus it's common practice in the Crystal community to only check in lockfiles for application-type shards (this is particularly enforced by crystal init which behaves differently for app and lib projects).

Further, baked_file_system has no dependencies at all. So a lockfile would really just be empty.

That said, I wouldn't mind adding a lockfile for library shards. It would not do any harm and actually could be helpful for security and compatibility considerations: When a library is added as a dependency, its dependencies could be implicitly pinned to the locked versions to avoid forward resolving to untested dependency versions. I've been preparing to discuss this in an RFC, so your use case might show another useful angle to this.

However, I'm not super familiar with nix, but I'm not sure if it works well to combine shards with nix source packages. A better approach might be to install dependencies directly via nix. You just have to make them available in the lib folder. That's all that shards does. Checking out the appropriate sources of dependencies is probably much easier to handle within nix.

auroraanna commented 2 years ago

A better approach might be to install dependencies directly via nix.

The dependencies of the program I'm trying to package with Nix are not included in Nixpkgs. I'm still for including a lock file.

auroraanna commented 1 year ago

I'm not getting the error anymore :P