News for hackers. Stuff that matters.
Re:Show HN: Cross-platform dependency manager using bash and... by TickleSteve on Wednesday September 14, 2016 @07:21AM (#12495737)
This feels like its solving the wrong problem, package-management is effectively a version-control problem.

We already have our source in version-control.... we just need a way of updating and maintaining a repository with external dependencies.

Do any such tools exist?

Re:Show HN: Cross-platform dependency manager using bash and... by chriswarbo on Wednesday September 14, 2016 @08:58AM (#12496357)
I think Nix does/comes close to what you're after.

Nix 'packages' are just text files describing the build/install process, so they can be version controlled (e.g. there's a big repo at https://github.com/nixos/nixpkgs ).

Dependencies, build environments, etc. are fully specified by the package and isolated from each other, and there is an emphasis on reproducibility, so building/installing a particular package should always give the same results. (This isn't enforced, but a non-reproducible package is considered buggy, and there are tools to check if a package can be reproduced)

Nix packages themselves can reference external dependencies, like git repos and URLs, and usually provide a fixed checksum to compare the output against; if it doesn't match, the build is aborted. Wrappers/translators are also available to integrate with other package manager ecosystems, e.g. cabal/hackage for Haskell packages.

Results are cached locally (packages are only built once, until they get garbage collected) and remotely (if a build server has already built a package, you can fetch it from there instead).

For development environments, you can write a Nix package for your project then run the 'nix-shell' command to enter its build environment (i.e. all dependencies available, environment variables set, etc.)

Re:Show HN: Cross-platform dependency manager using bash and... by TickleSteve on Wednesday September 14, 2016 @09:02AM (#12496390)
...similar to spack...

Isn't this effectively equivalent to version-controlling a shell script that contains a set of 'curls' or 'clones'?

What I had in mind would be more invisible and self-contained within the VCS.

It would effectively be a meta-VCS.

Re:Show HN: Cross-platform dependency manager using bash and... by mulle_nat on Wednesday September 14, 2016 @10:54AM (#12497487)
You want something which grabs source off other repositories and puts it inside your source tree and you want to version control all of it ?

I would not do that. I would fork the repositories I wanted and tag them along with your version. (mulle-bootstrap tag comes to mind :))

The embedding could be done with .bootstrap/embedded_repositories, which may or may not fit the bill.

Re:Show HN: Cross-platform dependency manager using bash and... by TickleSteve on Wednesday September 14, 2016 @11:19AM (#12497815)
The more I think about it, an explicitly-versioned-git-subtree is what I want, that would seem to solve all package-management issues.
Re:Show HN: Cross-platform dependency manager using bash and... by mulle_nat on Wednesday September 14, 2016 @03:21PM (#12500372)
I think mulle-bootstrap can do this for you using ".bootstrap/embedded_repositories".I would try it out, and if it doesn't work out and you think it's almost there but just needs a little fix, then let me know,
Re:Show HN: Cross-platform dependency manager using bash and... by kozikow on Wednesday September 14, 2016 @09:10AM (#12496466)
It works ok for me with docker images. It only works for languages storing dependencies in the environment (e.g. python), so it won't work as well for C++.

I can download any docker image. Docker image contains all external dependencies and I can inspect those dependencies.

I assign a version to each Dockerfile. Docker image version is in the source control. Image with each version is stored in docker image registry. Version bump triggers update of all packages (either system level or language packages). This lets me revert external dependencies to state from any point in time. Or check out any commit from source control and run it in the same state as it was running in prod at that time.

Re:Show HN: Cross-platform dependency manager using bash and... by radarsat1 on Wednesday September 14, 2016 @09:13AM (#12496494)
I think you're describing Homebrew. Actually whenever I'm building and installing something in ~/.local (which I do fairly frequently if I don't install it via apt-get, I'm not a /usr/local fan), I wish I were using something like Homebrew. Just something to manage whats in ~/.local, so I can remove things one package at a time. It'd be nice to have a lightweight version of checkinstall for non-root usage, for example.
Re:Show HN: Cross-platform dependency manager using bash and... by TickleSteve on Wednesday September 14, 2016 @10:59AM (#12497562)
...but homebrew isn't a VCS... its just another package on top of the VCS.

My point is that this function should effectively be part of the VCS.

Re:Show HN: Cross-platform dependency manager using bash and... by sirn on Wednesday September 14, 2016 @09:26AM (#12496606)
Re:Show HN: Cross-platform dependency manager using bash and... by TickleSteve on Wednesday September 14, 2016 @10:54AM (#12497497)
I had thought of that, but (correct me if I'm wrong) a submodule is effectively a link to an external repository.

What I'm thinking of is a link to a version of an external repository.

(It may be working like that, but I've never used it like that if so).

Actually, yes... what I would like is an explicitly versioned "submodule" or "subtree" command where I can manage the exact versions within the VCS.

Re:Show HN: Cross-platform dependency manager using bash and... by qznc on Wednesday September 14, 2016 @11:50AM (#12498175)
Submodule does link to specific commit of an external repository.

Subtree works a little bit different. It is essentially a copy of an external repository instead of a link.

Re:Show HN: Cross-platform dependency manager using bash and... by octo_t on Wednesday September 14, 2016 @07:43AM (#12495867)
package management is not version control. it is release control and the two concepts are different in their semantics.
Re:Show HN: Cross-platform dependency manager using bash and... by TickleSteve on Wednesday September 14, 2016 @08:50AM (#12496299)
I disagree, I think fundamentally, package management (w.r.t source) is about controlling what versions of which packages are built into your binary.

Ultimately its basically a set of external dependencies that you want to version-control and occasionally update.

I see no fundamental difference to what version-control is, its just not a feature built into most/any.

Re:Show HN: Cross-platform dependency manager using bash and... by grive on Wednesday September 14, 2016 @07:43AM (#12495863)
It can be used for that. You can configure the tag you want to fetch and build if the repository is version-controlled, effectively allowing you to follow an external project: update your local settings when bumping your requirements, and it should follow along.
Re:Show HN: Cross-platform dependency manager using bash and... by frumiousirc on Wednesday September 14, 2016 @07:58AM (#12495963)
> Do any such tools exist?

One such tool:

https://github.com/LLNL/spack

Re:Show HN: Cross-platform dependency manager using bash and... by TickleSteve on Wednesday September 14, 2016 @09:00AM (#12496372)
hmmm.... maybe....

That seems basically like you create a specification for what versions of which repos you want and it will create it.

Is that any different to just having a shell-script curl the repos and versioning that script?

What I had in mind would be effectively external dependencies that would appear within the source tree when cloned/manifested/whatever which would themselves be version-controlled. It would effectively be a 'curl' or 'clone' of an external version of a child repo maintained by the VCS.

Does that make sense?