Tuesday, March 5, 2013

A package for rust - Mozilla's experimental language


Mozilla has picked up a language to address a couple of common issues in coding. The language they picked is rust.
It doesn't fit into my current environment, but it has some nice features, like lightweight threads (green threads) and message passing support which make it interesting for me to play with. These are two features which I am missing in vala - but they might just be a bit out of scope of vala's focus.

I've only played with rust a little, but to ease Fedora users access to this language I've created an initial specfile which can be used to build the package.
For convenience I'm also providing an rpm.

Rust is currently not suitable for an official inclusion into Fedora's repositories as it builds it's own patched version of llvm, does some stuff with rpaths, …. There is work to upstream the patches, but that's still far in the future.

So - pick it up and install it, look at the quite nice tutorial and get your hands dirty.

# Clone
git clone git://github.com/fabiand/rust-spec.git

# Build requirements
sudo yum install gcc gcc-c++ python perl curl fedora-packager

# Build it
cd rust-spec
rpmbuild -ba rust.spec

Edit: It is assumed that your env is set up for building packages

6 comments:

  1. $ rpmbuild -ba rust.spec
    error: line 31: Unknown tag: %filter_from_requires /x86_64-unknown-linux-gnu/d

    ReplyDelete
    Replies
    1. I suppose there were soe missing build deps. I've updated the post to mention that it is assumed that there is a working packaging env.

      Delete
    2. You're right, installing @development-tools fedora-packager solved the problem. But compiling brings another problem:

      compile_and_link: x86_64-unknown-linux-gnu/stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libcore.so
      x86_64-unknown-linux-gnu/stage2/bin/rustc: symbol lookup error: x86_64-unknown-linux-gnu/stage2/bin/rustc: undefined symbol: _ZN8unstable4lang5start17_c395f477ee3c68483_06E
      make: *** [x86_64-unknown-linux-gnu/stage2/lib/rustc/x86_64-unknown-linux-gnu/lib/libcore.so] Error 127

      Delete
    3. Same compile error here. :(

      Delete
    4. Hey,

      I've updated the spec and it should work with 0.6 now.
      Please use the official 0.6 targz.

      Delete
    5. Now there is even a build available for rust: http://dummdida.blogspot.com/2013/05/mozillas-rust-in-fedoras-ppa-copr.html

      Delete