IRON: Eiffel package repository
- Package Repository vs Library Repository
- Application to .ecf files
- IRON client tool
- How to Use IRON
- Install wanted Eiffel packages
- Add reference to install package libraries
- External dependencies
- How to Get Information About IRON Packages
- Using IRON from the Command Line
- Quick Help from the Command Line
- Action Summary
- Advanced Usage
- Managing Multiple Repositories
- Building a package
- Using your own IRON packages locally
- Sharing Your Packages
- Origin of the Name IRON
- Planned Enhancements
IRON provides an easy-to-use facility for using and sharing packages of quality Eiffel components, automating many of the tasks involved.Most often a package is a library or a set of libraries, but it could also other resources such as tools.
Package Repository vs Library Repository
Certainly the IRON repository is a repository of Eiffel libraries. However, sometimes libraries are used together, or cross reference one another, and thus are appropriate to be delivered together as a unit. Such unit can also include other types of files, such as external .c files that may need to be compiled on the local platform to make .LIB or .OBJ files available to the linker (.a or .o on Unix and Linux systems), scripts or executable that need to be run as part of the installation process (e.g. to generate other files required by the library, install environment variables, generate source code from LEX files), or tool kits that are part of, or needed by, the library. Since the IRON repository permits programmers to install software components in "units"Â, and since sometimes those units can contain more than one library, as well as other types of files, a new term was required to convey this concept: package.
Application to .ecf files
Empowering Teams of Developers
To configure Eiffel projects, programmers uses "ECFs" (Eiffel Configuration Files -- Microsoft Visual Studio users can think of "solution files").
One application of ECFs is to reference libraries installed in different locations. Without IRON, the usual solution is to use relative or absolute path, and generally using environment variables such as ISE_LIBRARY or EIFFEL_LIBRARY, and a few package specific variables such as GOBO, ...
Typical library references without IRON in ECF:
<library name="base" location="$ISE_LIBRARY\library\base\base.ecf"/>
<library name="xml_parser" location="$EIFFEL_LIBRARY\library\text\parser\xml\parser\xml_parser.ecf"/>
<library name="dummy_foobar" location="$LIB_DUMMY\src\foo\bar.ecf"/>
As projects grow and multiply, the number of these variables adds up quickly. A dozen or more such environment variables per system is (prior to IRON) not uncommon. Coordinating their use and evolution among a team of programmers can become a challenge.
IRON has made it possible to simplify this scenario dramatically. For any commonly used library, it suffices to:
- Install the related package from an IRON repository.
- And for any project that uses the library, include an IRON uri in the related ECF.
- an IRON uri has the form:
- as you can see, no more environment variable, and only a relative path from the root of the package. This simplifies a lot the referencing, and package/library management. No need to know where are located the installed files on the local machine.
- an IRON uri has the form:
That's all! In the above example, the location of the libraries, in the project, then become something like:
<library name="base" location="iron:base:base.ecf" />
<library name="xml_parser" location="iron:xml:parser/xml_parser.ecf" />
<library name="foobar" location="iron:dummy:src/foo/bar.ecf" />
There is no more need for a set of environment variables.
IRON and EiffelStudio take care of the remaining details. And all developers on a project simply share the same ECF file with no further worry about where the libraries are.
However, to get information about IRON location, use the command:
iron path ...
Command Result Example
Base directory of IRON (~ IRON_PATH variable) C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron
iron path base
location of installed package
C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron\packages\base
iron path xml
location of installed package
C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron\packages\xml
- It is possible to override the default location of IRON installation directory, by setting the environment variable
- In the scope of the .ecf file, the IRON_PATH variable is always set: to default path or to the value of environment variable IRON_PATH.
- In addition to the IRON way to reference library, it is also possible to use the absolute URL in the repository, see advanced usage for more details.
But this implies putting the version in the url (i.e 14.05), or you could set ISE_LIBRARY to
IRON client tool
The iron client executable is a facility that permits Eiffel programmers to easily install, remove, update, list, examine, search and share Eiffel packages.Additionally, it permits easy maintenance of a local list of IRON repositories.
A default IRON server is provided and a default repository is added automatically by the iron executable, based on the version of EiffelStudio that installed the iron executable (example: https://iron.eiffel.com/14.05 ).
The IRON facility consists of three parts:
- A default repository at https://iron.eiffel.com/14.05 (provides the web API and web interface for the repositories that are stored there; you can add other IRON servers as they become available).
- The iron executable utility on the local machine (installed with EiffelStudio, the program that interacts with the repositories).
- Within EiffelStudio and the Eiffel compiler, is the ability to read and use IRON references from the Eiffel Configuration File (.ecf). The Project settings tool, and Add Library' dialog also provides support for IRON packages.
How to Use IRON
Install wanted Eiffel packages
Using the EiffelStudio command prompt (installed with EiffelStudio), execute the IRON command to install the packages you want to use:
iron install <package_name>
Note that the compilation of an Eiffel project that depends on uninstalled Eiffel package(s) will suggest and propose to the user to install the missing packages (this is currently supported with ec in command line mode, and graphical mode.
Add reference to install package libraries
Simply add the library with IRON uri
iron:package-name:relative-path-to-file.ecf, as you would have previously for local libraries. This can be done directly by editing the .ecf file, or using the EiffelStudio Project Settings tool from Eiffel Studio:
Project Settings -> <target_name> -> Groups -> Libraries
right-click Libraries and add a library. This will popup the Add Library dialog, that expects a name and a location, simply select the available library from the grid.Note that you have an easy way to install, remove IRON packages from the Iron tab of the "Add Library" dialog.
- The default and recommended location for a IRON package library is the IRON uri:
- It is also possible to use the absolute URL in the IRON repository such as:
- And an other solution, would be to use the
IRON_PATHenvironment variable to locate the install libraries, such as:
This latter method, while it works, is not recommended simply because it defeats some of the advantages of using the IRON repository in the first place.
If the package has some other way of linking it with your Eiffel projects, e.g. to an external .dll or .so , then instructions for this should be provided within the package.
If you do not define one of these environment variables, the location used is:By default the base directory for IRON is under
<Eiffel User Files>/<EiffelStudio_Version>/iron , but it is possible to overwrite this value by setting the environment variable
ISE_IRON_PATH). Note that if the physical location does not exists, the local iron executable will create it.
Setting IRON_PATH, can be a way to setup different development environments (with different registered repositories, ...)
How to Get Information About IRON Packages
At the website provided by a particular IRON server, you can get information about available packages in a number of ways. You can start by simply visiting the server's base address: https://iron.eiffel.com/ .
- This page lists the repository versions available.
- Select the version that matches the version of EiffelStudio you have installed.
Example: clicking on version 14.05 takes you to https://iron.eiffel.com/repository/14.05/ where you can list existing packages, or add a new package if you have an account on the server.
If you click the "Package list" or "All packages" link, it takes you to a list of packages available under that version.
To filter this list, you can use the search window. You can specify search criteria in this format
Criterion Meaning name string is contained in package name (wildcards are supported) title string is contained in title tag package contains search_string in its tags (i.e. keywords) downloads has at least N downloads, e.g. downloads:25
If a criterion is omitted, name is used by default.Operators available: or, and, not (example: name:er and not name:parser)
Finally, when you have found the package you want, click on its title, and the page displayed will contain detailed information about the package.
Part of the information is a portion of the URI which you can use to define the path to the package.For the base library (title: EiffelBase), these URIs look like this:
Given that the server's HTTP address is (in this example) https://iron.eiffel.com/, you can compose full paths from this, and use them in your Eiffel project. In this case, you can include the EiffelBase library in your project by specifying either:
Both will cause your project to compile with the same EiffelBase library provided by this IRON repository, provided you previously issued the following command on your system:
> iron install base
> iron install https://iron.eiffel.com/14.05/com.eiffel/library/base
IMPORTANT: those associated URIs may be deprecated soon with the use of IRON uri
Using IRON from the Command Line
The "iron" executable is used to perform various operations such as search, install, remove, update and share. This executable is installed with EiffelStudio in $ISE_EIFFEL/tools/spec/$ISE_PLATFORM/bin/.
Quick Help from the Command Line
lists the actions that are available.
iron <action> --help
displays detailed usage syntax for the action specified. Note that most of the actions have a -v (verbose) option that will display additional helpful information about the action performed, including (when relevant) the local path to the package.
Action Meaning update updates cached package information list displays a list of available packages, and whether they are installed search searches for a specified packages info displays information about a specified packages install installs specified packages remove removes specified packages repository manages repository list share share and manage your packages (an account on the IRON server is required)
Update cached iron repository information
Display information about package
For instance for the api_wrapper package:
iron info api_wrapper
If the package is installed, the installation path will also be displayed.
Search for a package by name, ID or URI
(package IDs and URIs are displayed by the "info" action) (future releases will enable searching by other criteria as well, such as by tags [i.e. keywords]):
iron search base
List available packages
List installed packages
iron list --installed
Install a package
iron install base(or iron install https://iron.eiffel.com/14.05/com.eiffel/library/base)
(This latter form is useful in resolving name conflicts when, for instance, you have multiple IRON repositories registered on your system, and two or more contain a packaged called "base"Â.)
Uninstall a package
iron remove base
Install all available packages
iron install --all
Uninstall all installed packages
iron remove --all
Managing Multiple Repositories
It is possible to have more than one IRON repository server registered. Examples:
iron repository --list
iron repository --add https://iron.eiffel.com/14.05
iron repository --add https://custom.example.com/14.05
iron repository --add C:\eiffel\my_repository
iron repository --remove https://custom.example.com/14.05
Multiple-Repository Name Conflict Resolution
If you have more than one IRON repository registered on your system, it is possible that the same package name may exist on more than one repository. If this is the case, and you attempt to perform operations using that name only, the repository that will be used will be the first repository in the list that contains a package with that name. If you need the package with that name from a different repository, then use the "id"Â or "uri"Â form of the identifying the package you want.
If the sequence of repositories is not to your liking, you can change it in three ways:
- use the iron executable to remove and add repositories to re-sequence them, or
- delete the repositories.conf file and use the iron executable to add them again in the sequence you want them.
- edit the file repositories.conf with a plain text editor in the directory indicated by your IRON_PATH (or ISE_IRON_PATH) environment variable (or
<Eiffel User Files>/<EiffelStudio_Version>/iron/if one of these environment variables are not defined on your system). (Note that this latter method, while possible, is not recommended, since the syntax of that file can change with new releases.)
Building a package
An IRON package has to provide, at its root, a file
package.iron. This file describes the package with name, description, and various other information.See for instance, the package.iron for Eiffel Base package:
base_safe = "base-safe.ecf"
base = "base.ecf"
base_testing = "testing/testing-safe.ecf"
base_testing = "testing/testing.ecf"
title: Eiffel Base
description: "Eiffel Base: kernel library classes, data structure, Input and Output"
license: Eiffel Forum License v2
copyright: 1984-2013 Eiffel Software and others
link[doc]: "Documentation" http://eiffelroom.com/
link[source]: "Subversion" https://svn.eiffel.com/eiffelstudio/trunk/Src/library/base
Note: The package iron file for the Eiffel Base package is available online at
- only the name of the package is required
- the section "project" list the various available .ecf projects
- the section "note" contains title, description, tags, ... informations. The formation is similar to Eiffel indexing note, and in addition it supports bracket in the name of note, such as in link[doc].
- The "link" declaration:
link[category]: "Optional Title" associated-url
- The "link" declaration:
- The following notes have semantic that are processed by Iron: title, description, tags, link[..], and maps, for now mostly on the Iron server.
- It is possible to use any note name. Currently they are simply stored and never displayed. In the future, Iron may support additional semantic for those notes.
A few packages may require post installation operations, such as compiling C code, or others. For that, use the section setup, and in particular the compile_library information.During installation, iron will launch the
compile_library tool delivered with EiffelStudio on the provided directory.
Example at https://svn.eiffel.com/eiffelstudio/trunk/Src/library/cURL/package.iron :
compile_library = Clib
compile_library tool relies on
finish_freezing -library and thus process the
Makefile-win.SH or Makefile.SH.
Using your own IRON packages locally
There are various ways to use your own Eiffel package libraries:
- Using local location as it was currently done before 14.05 (i.e relative or absolute path, and eventually using an environment variable...).
- Sharing the package on an IRON server, and then install it from that server:
- The default https://iron.eiffel.com/ is the recommended server
- But it is possible to host your own server easily. (server how-to documentation will be provided soon).
- And there is another solution: local repository.
Local repositories rely heavily on the
package.iron files. So if a folder is registered as iron repository, internally iron will search this folder recursively for package.iron files.
Example on Windows:
iron repository --add %ISE_LIBRARY%\library
It should find and list all the official ISE IRON packages.Now if you want to install the time package from it, just do
> iron install time
-> several packages for name [time]!
1) time (https://iron.eiffel.com/14.05) "EiffelTime"
2) time (file:///C:/EiffelDev/Src/library)
> Select a package  (q=cancel): 2
-> Install time (file:///C:/EiffelDev/Src/library)
Installing [time (file:///C:/EiffelDev/Src/library)] -> successfully installed.
To make development easier, you may want to edit/update the repositories.conf file, in order to put that file://... local repository on the top.
> iron path
C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron
and then edit "C:\Users\jfiat\Documents\Eiffel User Files\14.05\iron\repositories.conf"
- However, unless you are using the iron tool in batch mode (
--batchflag ), you will be asked to choose which package you want to install.
- You can also use the EiffelStudio "Add Library" dialog via the "Iron" tab, to install, uninstall the various packages.
- And last solution, you can use the full url as:
> iron install file:///C:/EiffelDev/Src/library/time
Of course, do not forget that local repository should be used only for code in progress, otherwise you should share that library and use it as a simple user. One of the goal of IRON is to encourage people sharing their libraries with other Eiffel users.
Sharing Your Packages
To build and share your own packages on an IRON server, you will need a user account on that IRON server which will host your packages.Please visit https://iron.eiffel.com/repository/account/?register to create a new account.
As usual, to see the available options, use:
iron share --help
To build the gps_nmea package from your library
iron share create --username <your_id> --password <your_password>
--package "c:\eiffel\library\gps_nmea\package.iron" --package-name "gps_nmea"
This command will:
- create a new package named gps_nmea on iron repository https://iron.eiffel.com/14.05,
- using the local package c:\eiffel\library\gps_nmea (i.e: you need to provide the package.iron file)
- the --package-name is for now required, even if the package.iron already provides such information.
- see the
iron share --helpfor advanced usage (such as --index, --package-archive-source, ...).
After adding such a package to the library, it is recommended that you go to the website, double check that the package was created they way you wanted it to be, and you can edit its information.Then, using the iron executable, install the package on your system, and go through the steps of using it in an Eiffel project, and correct any problems discovered, to verify that end users will be able to productively use your package.
It is also strongly encouraged to include (or provide a link to) documentation that orients the user to its use, and answers basic questions such as: What is the package? What motivated you to create it? What problem(s) does it address? Under what circumstances can the package be productively used? Under what circumstances should it not be used (if applicable)? And some basic examples of its use. If the package is complex, it can be very helpful to include a well-commented application that demonstrates intended reuse of the package in software.
Important note: having clear documentation that enables end users to easily learn how to use your package is a VITAL link in the ability to reuse software components as is so aptly described in Object‑Oriented Software Construction, 2nd Edition, in the Modular Understand-ability criterion:
"A method favors Modular Understand-ability if it helps produce software in which a human reader can understand each module without having to know the others, or, at worst, by having to examine only a few of the others."
and the Self-Documentation Principle:
"The designer of a module should strive to make all information about the module part of the module itself."
The point: reuse is only possible when end users can easily and quickly learn how to reuse software components available to them.
Origin of the Name IRON
As many readers will know, the name "Eiffel" was chosen to reflect the elegance and soundness of constructing large, complex software systems, with simple, individual components, each of which is a unit by itself and has its own existence, and can be tested for integrity as a separate unit, but its role in the larger scheme of things is to be used as a "building block" for constructing high-integrity software systems. The picture on the front of the book Object‑Oriented Software Construction, 2nd Edition illustrates this.
This of course is intentionally meant as a direct parallel to the famous structure built by the architect and civil engineer Alexandre Gustave Eiffel. This structure was constructed with simple, individual components, each of which is a unit by itself and has its own existence, and can be tested for integrity as a separate unit, but its role in the larger scheme of things is to be used as a "building block" for constructing a high-integrity structure: the Eiffel Tower.
As a parallel to this, "IRON", as a name, was chosen to reflect the fact that the individual building blocks were themselves made from iron. In the Eiffel world, constructing a large complex software system is done with libraries of high-quality reusable components. Thus, the "building blocks" are made from iron, and software systems are made from those building blocks. Hence, IRON provides the "raw material" from which complex Eiffel systems are developed.
This documentation describes the version of iron released with EiffelStudio 14.05.More features are planned or are already under development:
- the ability to analyze the contents of the package, to extract information related to its .ECF file(s)
- a way of ensuring that the package compiles under the specified version of EiffelStudio
- support for test suite
- detection and actions related to package dependencies
- package version
- ability to upgrade of packages already installed
- extended post-installation operations
- more features that users may request or suggest.
- Parent <Solutions>