nim-works/gitnim
À propos
choosenim for choosey nimions
Outils de développementProgression mesurée des étoiles
- in 24h
- 0
- in 7 days
- Historique en cours
- in 15 days
- Historique en cours
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
Originalgitnim
gitnim installs Nim and switches between Nim versions with git.
This repository has one branch for each Nim release, such as 2.4.3. A
branch holds the files of the upstream Nim nightly build for that release.
Tags such as stable and version-2-4 point at release branches, and they
move when new builds arrive. The devel tag does not move for now: upstream
devel builds report the same version as version-2-4, and release branches
are named by version. The master branch holds only the
gitnim tools.
The git nim command lists the releases and switches between them.
Requirements
- Linux or macOS
- a POSIX shell
git2.31 or latercurltarwith xz supportsha256sumorshasum
Install
Clone a release. Use --filter=blob:none, because the history is large:
$ git clone --filter=blob:none --branch version-2-4 https://github.com/nim-works/gitnim ~/nims
Put its bin/ directory on your PATH:
$ export PATH=~/nims/bin:$PATH
Run git nim:
$ git nim
Before it lists the releases, the first run does these steps:
- It downloads the compiler binaries for your platform and checks their sha256 digests.
- It builds the
git nimprogram from thegitnim/directory with that compiler. - It installs a
post-checkouthook in the clone.
Use
List the releases
$ git nim
This command does these steps:
- It fetches all branches and tags, including tags that moved.
- It updates the community distribution to the tip of its branch.
- It lists the branches and tags.
Switch to a release
$ git nim 2.4.3
$ git nim devel
The argument is a branch, a tag, or a commit. A branch of a remote also works,
such as jeff/2.4.3.
A switch uses the network only to get binaries, modules and commits that are not on your computer yet.
Use the community distribution
The community/ directory is a submodule of
nim-works/dist. That repository collects
Nim packages, with one branch for each Nim version. Each release branch pins
one commit of it.
To use it in a project, add it to the search path:
$ echo '--path:"$nim/community"' >> nim.cfg
git nim moves the modules that the current commit does not list to
community/.attic/. It moves them back when a later commit lists them again.
The dist/ directory is a different thing. It belongs to Nim, and it holds
packages that the compiler needs, such as checksums.
How the binaries work
Release branches do not contain compiler binaries. Each one has a
gitnim.lock file, which names the upstream build. For each platform, the file
gives a download URL and a sha256 digest.
bin/git-nimis a shell script. It puts the binaries for your platform intobin/, then it runs the program that it built fromgitnim/.- Downloaded binaries are kept under
.git/gitnim/builds/, so a switch back to an earlier build needs no network. To free the space, delete that directory. - The
post-checkouthook updatesbin/after a plaingit checkout, too.
Branches up to 2.2.2 are older. They contain linux_x64 binaries in bin/,
and their community distribution is at dist/. git nim can switch to them
and back.
Your own releases and tags
Release branches and tags are ordinary git refs, so you can make and share your own:
$ git checkout -b my-nim
$ git tag -a works-for-me -m "the one that builds my project"
$ git push origin my-nim works-for-me
$ git nim works-for-me
Maintainers
docs/maintaining.md describes how the release branches
are made, and how the gitnim-admin program and CI make them.
License
MIT
Explorer des projets similaires
Chargement…