Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save am11/157897417d1eef4d7116 to your computer and use it in GitHub Desktop.
Save am11/157897417d1eef4d7116 to your computer and use it in GitHub Desktop.
CLVM.EXE - A Version Manager for VisualC Compiler (Proposal)

CLVM.EXE - A Version Manager for VisualC Compiler (Proposal)

Introduction:

  • Version manager essentially sandboxes the compiler, libraries and related services and autonomously works without needing to change the global system installation of the same compiler (hint: environment variables).
  • The chief advantage is to
  • The trend is becoming popular by day in Node.js, Ruby and other nix-oriented communities.
  • I propose to build a clvm.exe
    • which will work independently
    • which can be placed in any drive (USB, local or network drive). For instance: %UserProfile%/.clvm (e.g. c:\users\name.clvm).
    • which will create folders with semantic versions when user wants to use the newer version of cl.exe.

Installation:

:: this is cmd
cl.exe --install clvm
:: will download clvm from the server in current directory
:: adds clvm to PATH (permanently)

:: or
cl.exe --install clvm  %UserProfile%\.clvm
:: will download clvm from the server in the directory of choice
:: adds clvm to PATH (permanently)

CLVM is self-updateable:

clvm --update
:: replaces self to latest version

To know which CLVM am I using:

clvm --which
:: prints path to clvm.exe, which is taking effect.
:: e.g. c:\users\name\.clvm\clvm.exe

Download the desired VC compiler version without dependencies:

I propose cl.exe start using semantic versioning (http://semver.org/).

clvm install v3.1.4
:: creates folder with name v3.1.4 in \path\to\clvm\versions
:: for example: c:\users\name\.clvm\versions\v3.1.4
:: download and extract the zip with cl.exe and all the related
:: stuff (libraries, services etc.) inside it.
::
:: Then set the environment variable to use this version of cl.exe
:: and prints:
now using VC Compiler v3.1.4
::
:: The user can install another version say: v3.1.5 or v4.0.0
::
:: Note that cl.exe at path\to\clvm\directory\versions\<version-number>\cl.exe
:: is also updateable as per the other proposal.

Download the desired VC compiler version with dependencies:

User may be want to tell Visual Studio to use this version of cl.exe and therefore wants to update the front-end compiler services as well:

clvm install v3.1.4 --with-dependencies

Change VC Compiler version:

clvm use v2.1.1
:: prints
now using VC Compiler v2.1.1
:: or
VC Compiler v2.1.1 not installed, try clvm install v2.1.1

List all installed versions of VC Compiler:

clvm list
:: or the alias: clvm ls
::
:: prints
The following versions of VC Compiler were found:
v2.1.1 -> c:\users\name\.clvm\versions\v2.1.1
v3.1.4 -> c:\users\name\.clvm\versions\v2.1.4

Uninstall VC Compiler:

clvm uninstall v2.1.1
:: prints
v2.1.1 is successfully uninstalled. Now using [system] version.
:: if there is no system version installed,
v2.1.1 is successfully uninstalled. Select the other version using `clvm use` command

Inspired by:

@am11
Copy link
Author

am11 commented Feb 28, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment