user15487: I am developing for several different target microcontrollers (on OS X 10.11), which requires some unique combinations of (Arduino) IDE version, library versions, USB drivers, support software, etc.
What are the pros and cons of using separate logged-in users for each environment as opposed to using Virtual Machines? Are there other methods commonly in use to separate environments, and also keep the environments archived for any legacy needs?
Update: I also have a desire to keep these environments as standard as possible: installing released components (e.g., IDE, drivers) and customizing IDE app settings, but trying to avoid source-level forks. This is for my own sanity, and to give best chance of replicating the environment in the future.

user612: I'm yet to see evidence that there is a sound or comprehensive way to do this, so would be pleased to read better suggestions.  As for why you would want to, there are a number of board support plugins/extensions that are moderately functional on some recent Arduino versions, but partially or entirely incompatible with others.
You can achieve a very limited partial version segregation by creating a new sketchbook folder for each version, which would host your libraries and hardware folders.
To get the IDE to pick this up, you could have a custom preferences file (rather than preferences.txt) with that sketchbook location set.  You can specify the file to use on the command line, for example:
/opt/arduino-1.6.8/arduino --preferences-file ~/.arduino15/alternate.txt

However, there is still quite a bit related to extra board support and similar stored in the settings folder, and at present that is hard coded to the same "Arduino15" or ".arduino15" path for all recent versions.  
This hard-coding of the settings folder is implemented in the version of Platform.java applicable to the operating system you are running under, so it is not clear how you could change this except at the source level, by modifying the jar, or by playing file-system level tricks with the operating system (process-unique mounts, etc).

user30251: I ended up running arduino-buider, available in Arduino IDE 1.6.6 and newer.
When laying out your project, put a libraries/ and hardware/ folder along side your sketch directory, like so:
YourHipProject/
    Makefile
    hardware/
        Vendor/arch/{boards.txt,platform.txt}
    libraries/
        SomethingUseful/
        NoIdeaHowThisWorks/
    ProjectSketch/
        ProjectSketch.ino
        othersource.cpp

The hardware/ directory is only needed if you need support for 3rd party boards. Then, in the Makefile:
ARDUINO_DIR ?= /opt/arduino-1.6.13 # need to set this for your environment

.PHONY: ProjectSketch

ProjectSketch:
    arduino-builder -compile -verbose \
        -hardware $(ARDUINO_DIR)/hardware \
        -tools $(ARDUINO_DIR)/tools-builder \
        -tools $(ARDUINO_DIR)/hardware/tools/avr \
        -built-in-libraries $(ARDUINO_DIR)/libraries \
        -hardware ./hardware \
        -libraries ./libraries \
        -fqbn=Vendor:arch:board \
        ./ProjectSketch/ProjectSketch.ino

ARDUINO_DIR needs to point to where your Arduino is installed, be sure to set -fqbn= correctly too.
Running make should compile the firmware from ProjectSketch/ with the accompanying libraries and hardware definitions. Also, with verbose compile output enabled, the Arduino IDE will show you how it runs arduino-builder.

15487: <p>I am developing for several different target microcontrollers (on OS X 10.11), which requires some unique combinations of (Arduino) IDE version, library versions, USB drivers, support software, etc.</p>

<p>What are the pros and cons of using separate logged-in users for each environment as opposed to using Virtual Machines? Are there other methods commonly in use to separate environments, and also keep the environments archived for any legacy needs?</p>

<p>Update: I also have a desire to keep these environments as standard as possible: installing released components (e.g., IDE, drivers) and customizing IDE app settings, but trying to avoid source-level forks. This is for my own sanity, and to give best chance of replicating the environment in the future.</p>
 612: <p>I'm yet to see evidence that there is a sound or comprehensive way to do this, so would be pleased to read better suggestions.  As for why you would want to, there are a number of board support plugins/extensions that are moderately functional on some recent Arduino versions, but partially or entirely incompatible with others.</p>

<p>You can achieve a very limited partial version segregation by creating a new sketchbook folder for each version, which would host your libraries and hardware folders.</p>

<p>To get the IDE to pick this up, you could have a custom preferences file (rather than <code>preferences.txt</code>) with that sketchbook location set.  You can specify the file to use on the command line, for example:</p>

<pre><code>/opt/arduino-1.6.8/arduino --preferences-file ~/.arduino15/alternate.txt
</code></pre>

<p>However, there is still quite a bit related to extra board support and similar stored in the settings folder, and at present that is hard coded to the same "Arduino15" or ".arduino15" path for all recent versions.  </p>

<p>This hard-coding of the settings folder is implemented in the version of <code>Platform.java</code> applicable to the operating system you are running under, so it is not clear how you could change this except at the source level, by modifying the jar, or by playing file-system level tricks with the operating system (process-unique mounts, etc).</p>
 30251: <p>I ended up running <code>arduino-buider</code>, available in Arduino IDE 1.6.6 and newer.</p>

<p>When laying out your project, put a <code>libraries/</code> and <code>hardware/</code> folder along side your sketch directory, like so:</p>

<pre><code>YourHipProject/
    Makefile
    hardware/
        Vendor/arch/{boards.txt,platform.txt}
    libraries/
        SomethingUseful/
        NoIdeaHowThisWorks/
    ProjectSketch/
        ProjectSketch.ino
        othersource.cpp
</code></pre>

<p>The <code>hardware/</code> directory is only needed if you need support for 3rd party boards. Then, in the <code>Makefile</code>:</p>

<pre><code>ARDUINO_DIR ?= /opt/arduino-1.6.13 # need to set this for your environment

.PHONY: ProjectSketch

ProjectSketch:
    arduino-builder -compile -verbose \
        -hardware $(ARDUINO_DIR)/hardware \
        -tools $(ARDUINO_DIR)/tools-builder \
        -tools $(ARDUINO_DIR)/hardware/tools/avr \
        -built-in-libraries $(ARDUINO_DIR)/libraries \
        -hardware ./hardware \
        -libraries ./libraries \
        -fqbn=Vendor:arch:board \
        ./ProjectSketch/ProjectSketch.ino
</code></pre>

<p><code>ARDUINO_DIR</code> needs to point to where your Arduino is installed, be sure to set <code>-fqbn=</code> correctly too.</p>

<p>Running <code>make</code> should compile the firmware from <code>ProjectSketch/</code> with the accompanying libraries and hardware definitions. Also, with verbose compile output enabled, the Arduino IDE will show you how it runs <code>arduino-builder</code>.</p>
