The static linker allows to bundle a component together with (a subset of) its direct and indirect imports. It can also be used to inspect import and export signatures of components.
In the first form, the linker takes the root component from <root url>, bundles it with the components it depends on, and writes an output component that has the same export signature as the root component. Components can be selected for inclusion depending on the URL they reside on.
When the URL of a component is tested for inclusion, it is tested in order against the prefixes given by the --include and --exclude options (see below), where string prefix matching is used. The first match decides. If no --include option is given, only the root component will be included.
Note that Alice library components (under the x-alice: scheme) are always excluded. This is necessary to achieve sandboxing security with component managers.
In the second form, the linker just prints the import and export signatures of the component at <root url> to standard output.
A typical application of the linker is to link all components imported using relative imports from the same directory as or a subdirectory of the root component. The following command line accomplishes this for a root component Foo:
alicelink -v ./Foo --include ./ -o LinkedFoo.alc
Print usage information.
Specify where to write the output component. If omitted, do not produce any output.
Print messages on activities performed.
Dump import/export signatures of resulting component, or of root component if no ouput file has been specified.
Minimize output component.
Include components with these URL prefixes.
Exclude components with these URL prefixes.
Specifies how to rewrite import URLs in resulting component. A <rule> is of the form <from>=<to>, where <from> and <to> are patterns in which ?{x} denotes a variable. It is an error if multiple import URLs from the resulting component are rewritten to the same URL. If the environment variable ALICE_TRACE_REWRITE is set (its value does not matter), trace messages about rewriting attempts are output to standard error.
The static linker is parameterized by the same environment variables as the virtual machine, plus:
if set (its value does not matter), causes rewriting of URLs to output trace messages to standard error. Use this for debugging when you have multiple (possibly overlapping) rewrite rules and you want to understand the results of rewriting.