News for hackers. Stuff that matters.
Re:So you want to write a package manager (2016) by dang on Friday September 06, 2019 @01:48PM (#20897880)
Re:So you want to write a package manager (2016) by throwaway5752 on Saturday September 07, 2019 @11:24AM (#20904329)
The article may say that an SPM is "not why we are here today" but writing any package manager is 1) phenomenally difficult and 2) has incredible risk to system integrity and security. You could do worse that starting out with reading and understanding RPM (https://github.com/rpm-software-management/rpm) or dpkg (https://git.dpkg.org/cgit/dpkg/dpkg.git).
Re:So you want to write a package manager (2016) by pg_bot on Saturday September 07, 2019 @09:00AM (#20903498)
I wonder if language designers will take package management into more consideration in the future. For example, what if every library's version was included in the module name during compilation. So you automatically go from MyLibrary.my_function() to MyLibrary::V1.0.0.my_function() after compiling the code. This way you could easily run different versions of the same library in dependencies without dealing with the headaches that normally causes. The only additional restriction I would add is that you have to use an exact version of a library instead of giving the package manager discretion.

Has anyone tried to implement something like that in a language?

Re:So you want to write a package manager (2016) by throwaway8941 on Saturday September 07, 2019 @09:37AM (#20903684)
If I understand you correctly, this is what Rust/Cargo currently do. You can have multiple versions of the same library in transitive dependencies, and it will link them all into the same binary using a name mangling scheme similar to what you describe.

https://stackoverflow.com/questions/51714866/

Re:So you want to write a package manager (2016) by aasasd on Saturday September 07, 2019 @12:31PM (#20904795)
Java apparently has a solution, named ‘shaded dependency’: https://softwareengineering.stackexchange.com/questions/2972... The name seemingly stems from the Maven plugin: https://maven.apache.org/plugins/maven-shade-plugin/

JS sidesteps the issue by having imported modules as local variables, and thus modules may have different versions of dependencies by simply dropping different files in the hierarchy. In theory this should also be possible in Python, but PyPI modules are usually installed as shared dependencies there.

Re:So you want to write a package manager (2016) by goto11 on Saturday September 07, 2019 @09:17AM (#20903578)
I believe .net works like that, more or less, although the libraries ("assemblies") are not statically linked. Assemblies declares a dependencies on a particular version of an assembly. It is possible to override this in a configuration file, so you "redirect" to a newer version.
Re:So you want to write a package manager (2016) by Ididntdothis on Saturday September 07, 2019 @12:27PM (#20904770)
There is a lot there but it’s pretty hard to maintain. Visual Studio has a tendency to sometimes upgrade references automatically. I have seen it now several times that a project has been set up with the correct references, then somebody else opens the project, saves, and now everything is changed. Makes me sometimes get nostalgic about make files. It took a while to build them up manually but then they were stable. With Visual Studio there is too much “intelligence” and wizardry going on behind the scenes.
Re:So you want to write a package manager (2016) by Vogtinator on Saturday September 07, 2019 @10:07AM (#20903830)
On platforms with ELF binaries that works with any language and symbol versioning already.
Re:So you want to write a package manager (2016) by Squithrilve on Saturday September 07, 2019 @12:10PM (#20904669)
Re:So you want to write a package manager (2016) by sagichmal on Saturday September 07, 2019 @01:16PM (#20905123)
That... is not a counterpoint?
Re:So you want to write a package manager (2016) by eeZah7Ux on Saturday September 07, 2019 @09:30PM (#20907966)
In summary: use system package managers and not language package managers. Rely on a stable and trusted distribution.
Re:So you want to write a package manager (2016) by jakeogh on Saturday September 07, 2019 @02:59PM (#20905788)