Skip to content
Proyectos

Acerca de

choosenim for choosey nimions

Herramientas de desarrollo

Cómo se miden estas cifras

Crecimiento de estrellas medido

in 24h
0
in 7 days
Recopilando historial
in 15 days
Recopilando historial
in 1 month
Recopilando historial

Cambios netos en períodos que se solapan, no totales diarios. Los datos no disponibles se dejan en blanco. Las estrellas indican interés, no calidad.

README.md

Original

gitnim

tests

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
  • git 2.31 or later
  • curl
  • tar with xz support
  • sha256sum or shasum

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:

  1. It downloads the compiler binaries for your platform and checks their sha256 digests.
  2. It builds the git nim program from the gitnim/ directory with that compiler.
  3. It installs a post-checkout hook in the clone.

Use

List the releases

$ git nim

This command does these steps:

  1. It fetches all branches and tags, including tags that moved.
  2. It updates the community distribution to the tip of its branch.
  3. 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-nim is a shell script. It puts the binaries for your platform into bin/, then it runs the program that it built from gitnim/.
  • 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-checkout hook updates bin/ after a plain git 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

Explorar proyectos relacionados

Cargando…