[rust-dev] building on SunOS, regex

Graydon Hoare graydon at mozilla.com
Sun Apr 1 09:38:05 PDT 2012

On 01/04/2012 2:49 AM, Mohd. Bilal Husain wrote:
> 1. How to compile for SunOS.
>  From what I understand, I first need a precompiled snapshot for SunOS#
> which was probably written in Ocaml##
> I have no clue which earlier version to checkout for the same. Or if the
> process has been changed.

Re-bootstrapping from rustboot (the original ocaml-based bootstrap 
compiler) is not a good route to a new target. The dialect of the 
language it compiled is long-since obsolete. You'd have to walk it 
through a year and a half of changes, hundreds of builds and snapshots. 
It would be very delicate and hard. The only programs that can process 
the current rust dialect are the existing stage0 snapshots (which we 
have binary snapshots of for 6 hosts presently: {macos,linux}-{x86,x64}, 
freebsd-x64, win32-x86)

The efficient route to getting a new target is to add support for the 
target architecture, in the form of .S files, to the runtime (if it's 
not already there), then add support to the configuration machinery, 
driver and linkage-driver for the new target. Then keep fiddling with it 
until it produces binaries that run on your target.

If you want a new _host_, you get 'target' mode working (as above) and 
then just cross-compile rustc from an existing host to your new SunOS 
target, and register the output from that cross-compilation as your 
target's new stage0 snapshot.

When you say "compile for SunOS", it depends if you mean as host or as 
target. We're going to be a bit cautious about adding more and more 
supported kinds of host. We added freebsd this time around, partly 
because it's so similar to the macos and linux ports that there was very 
little delta; but every host we support is a new bit of build machinery 
we have to keep online and moving forward in lock-step with the others. 
That's more ongoing porting and maintenance effort for us (mozilla) and 
at some point we're going to draw a line.

We should probably work out some sort of policy about 
community-supported hosts, possibly a way for people to run secondary 
repos or branches that advance at their own pace (rather than as a 
bottleneck on our master branch) while still using mostly-similar 

Extra targets, though, I think should usually be welcome in our master 
branch. They cost us much less than extra hosts.

> 2. Is there support for regular expressions; especially, in alt arms?
> Also, I couldn't locate regex in std or core module.

There's a pcre module in cargo[1]. We intend to integrate regexp-based 
switching (alt-like) via a syntax extension at some future date, and 
will probably bring re2 or pcre or something into libstd once we have a 
plausible story for optional std components, but have not done any work 
on this yet.


[1] https://github.com/mozilla/cargo-central

More information about the Rust-dev mailing list