From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id DEFFC7FACD for ; Fri, 19 Sep 2014 09:31:21 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.218.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.218.54 as permitted sender) identity=mailfrom; client-ip=209.85.218.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-oi0-f54.google.com) identity=helo; client-ip=209.85.218.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-oi0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ag4EANDaG1TRVdo2m2dsb2JhbABggkeBGVcEgn3EaIFtgzCEGwGBAggWAREBAQEBAQYLCwkUKoQEAQEDARIRHQEbGAUBAwELBgULNwICIgERAQUBHAYTIogHAQMJCA2fZ2uLMIFygxCJNwoZJw1mhkgBEQEFDo9pB4J4gVMFklGDNIcHgWCRdhgphRE7LwEBgkgBAQE X-IPAS-Result: Ag4EANDaG1TRVdo2m2dsb2JhbABggkeBGVcEgn3EaIFtgzCEGwGBAggWAREBAQEBAQYLCwkUKoQEAQEDARIRHQEbGAUBAwELBgULNwICIgERAQUBHAYTIogHAQMJCA2fZ2uLMIFygxCJNwoZJw1mhkgBEQEFDo9pB4J4gVMFklGDNIcHgWCRdhgphRE7LwEBgkgBAQE X-IronPort-AV: E=Sophos;i="5.04,553,1406584800"; d="scan'208";a="80014470" Received: from mail-oi0-f54.google.com ([209.85.218.54]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 19 Sep 2014 09:31:20 +0200 Received: by mail-oi0-f54.google.com with SMTP id a3so1378424oib.27 for ; Fri, 19 Sep 2014 00:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=c3Drn3/sTXXvo0EFKM7h4yEEnV72WpRyBF5olNzGZHw=; b=Crc34T7uN//YOM9o2Ok+AMFk2I3ytxaanNUeFJkx+TkBCYYc5T6haNi4KNI5nxwC0c wJpLAlXxMnmMwZtPliKcnAjGvKA50jJziGDTJxsU3/JnHC56YMhDS9EcIehllRMu6RKA GFng2i3ohU0h0nq+XSafUpmBgB0nYYsjckUSA/HryLO61kpL96DV/uRJ8OsBgUjqwMgW U+X1njGquQcv8kys0B5Pi3y+DnaskSAxHm+LaSD55Rjg4PdioVmsHX/5K7D69EdF8RUQ 4yBF2ym6p2a8soY69OHegGxeDvIFzHacR+F73/qaP8LvXx+f1GkIYjPBs07SDdBF3TvN o1hA== X-Received: by 10.182.38.138 with SMTP id g10mr6584497obk.21.1411111879427; Fri, 19 Sep 2014 00:31:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.76.141.165 with HTTP; Fri, 19 Sep 2014 00:30:39 -0700 (PDT) In-Reply-To: <6787924.naamY3Ii46@agaric> References: <6787924.naamY3Ii46@agaric> From: Gabriel Scherer Date: Fri, 19 Sep 2014 09:30:39 +0200 Message-ID: To: Louis Gesbert Cc: caml users , Yotam Barnoy Content-Type: multipart/alternative; boundary=001a11c2ec5a4fd24605036616a4 Subject: Re: [Caml-list] opam local switch --001a11c2ec5a4fd24605036616a4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Note that you can also use opam config exec --switch=3D -- to execute a command with a local switch choice. This is very helpful in contexts where you don't exactly remember how to setup the environment (eg. when prompted for an in-Emacs compilation command), or you want to play with several versions alternatively in a single terminal (testing a regression in new OCaml versions). On Fri, Sep 19, 2014 at 9:21 AM, Louis Gesbert wrote: > Le jeudi 18 septembre 2014, 17:20:37 Yotam Barnoy a =C3=A9crit : > > > I have a question about opam. I would like to play with certain compiler > > > versions, but I don't want the switch to happen globally, because I sti= ll > > > need to compile regular code. Is it possible to switch to another > compiler > > > locally (within a particular shell session) via environment variables, > > > while using my regular compiler in another shell session? > > > > > > If this is the way things work already, I apologize in advance -- it > > > appeared to me that running opam switch modifies some global state that > > > directly affects other pre-existing shell sessions. > > > > > > -Yotam > > > > > > > > > > This is already in our new FAQ [1] :) > > We're just waiting for 1.2 to be out before we post the new doc pages, > because some of it doesn't apply to the current 1.1 stable release. OPAM > 1.2 is still in RC stage. > > > > > > [1] > > > http://opam.ocaml.org/doc/1.2/FAQ.html#CanIworkondifferentswitchesatthesa= metimeindifferentshells > --001a11c2ec5a4fd24605036616a4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Note that you can also use

=C2=A0 o= pam config exec --switch=3D<SWITCH> -- <COMMAND>

t= o execute a command with a local switch choice. This is very helpful in con= texts where you don't exactly remember how to setup the environment (eg= . when prompted for an in-Emacs compilation command), or you want to play w= ith several versions alternatively in a single terminal (testing a regressi= on in new OCaml versions).

On Fri, Sep 19, 2014 at 9:21 AM, Louis Gesbert <louis.gesbert@ocamlpro.com> wrote:

Le jeudi 18 septembre 2014, 17:20:37 Yotam Barnoy a =C3= =A9crit=C2=A0:

> I have a question about opam. I would like to play= with certain compiler

> versions, but I don't want the switch to happe= n globally, because I still

> need to compile regular code. Is it possible to sw= itch to another compiler

> locally (within a particular shell session) via en= vironment variables,

> while using my regular compiler in another shell s= ession?

>

> If this is the way things work already, I apologiz= e in advance -- it

> appeared to me that running opam switch modifies s= ome global state that

> directly affects other pre-existing shell sessions= .

>

> -Yotam

>

>

=C2=A0

This is already in our new FAQ [1] :)

We're just waiting for 1.2 to be out before we post= the new doc pages, because some of it doesn't apply to the current 1.1= stable release. OPAM 1.2 is still in RC stage.

=C2=A0

=C2=A0

[1]

htt= p://opam.ocaml.org/doc/1.2/FAQ.html#CanIworkondifferentswitchesatthesametim= eindifferentshells


--001a11c2ec5a4fd24605036616a4--