You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Background

Julia's package manager

There are a module from stdlib named Pkg, served as the package manager in Julia, like Python's `pip`.

The package registry and package source

The package manager will download the desired packages from a default registry.
In Python, pip will conduct two actions before installing packags:
       (1) Search the metadata (like pkg name, version, ...etc)
           from the CheeseShop (a.k.a PyPI) for users.
       (2) Fetch them from the CheeseShop if matched.

In Julia, there is a default registry to hold the packages metadata,  hosted on GitHub: https://github.com/JuliaRegistries/General


And where to fetch the package? The aren't a center for download packages.
It's unlike Python's idea, we don't upload package to a center server in case of Julia.
The package manager will fetch stuffs from the URL listed in the metadata.
It should be a valid git URL for git-clone . e.g. For the package Distributions :

https://github.com/JuliaRegistries/General/tree/master/D/Distributions.

Most of the packages use GitHub for hosting code.

A valid package directory structure

In the process of package installation,
Python's pip will run `./setup.py` from unpacked package dir.
this is kind of protocol between package developer and package manager.

In Julia, the package manager run `./deps/build.jl` from the git-cloned dir.

Here comes an issue of mxnet's main repo.
The Julia package is collected under the subdir `./julia/`, so the setup script
in our case is `./julia/deps/build.jl`.
This breaks the protocol.

Also, in runtime, there is another protocol for phase of module loading.
The entry point of a module must be `./src/PackageName.jl`.
 In our repo, it's `./julia/src/MXNet.jl`.
 So, the directory structure of mxnet main repo is invalid for Julia package manager.
 Putting the url of main repo as package metadata will not work.


  • No labels