Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker images of working Firefly installation Please #716

Open
steele232 opened this issue Sep 6, 2022 · 3 comments
Open

Docker images of working Firefly installation Please #716

steele232 opened this issue Sep 6, 2022 · 3 comments

Comments

@steele232
Copy link

TL;DR

I was recently unable to build Firefly myself and I would love to use a Docker image made by someone who has successfully built it. I might be willing to dedicate more time to get it to build but it would be a lot nicer if I could try using it in a Docker environment to try out some things first.

The long story:

Hi all, I love the work you all are doing and I have high hopes for this project.

Disclaimers: I am new to Rust; I have written only Hello World types of programs in Rust, but I have installed Rust on several development computers in the last few years. I really have a love of Erlang/Elixir and I can see how Firefly would be a great benefit to the BEAM ecosystem so I am taking an interest in this. I think Rust has great potential as well and this is a great application of it.

This time around installing Rust on a new computer, I had no problem at all installing Rust and I was even able to try a few different nightly builds of Rust to try and compile Firefly successfully. In the nightly build that Firefly recommends for most stability (because it matches the version that the CI uses), I had several issues relating to "features" and "core_c_str" or something like that and I even tried learning how Rust "features" work in Cargo and kind of made progress but that's probably a fairly advanced thing to be worrying about for someone with my level of Rust/Cargo knowledge.

Rather than open an issue about the compiler errors and my installation problems, I thought it would be more efficient to ask for a working Docker container because I'm sure several of the project authors are able to compile the project and work on it and I would mostly love to try out the tool and see if I can use it for my use cases. If I am able to do some things with it, I can more easily justify further investigations into Rust and figuring out how to build Firefly by myself.

One of my use cases is compiling Erlang code down to Web Assembly so I think that's the sort of thing that would be doable from a Docker container, since it doesn't have anything to do with cross-compiling to other operating systems and things (which I think can be difficult in Docker sometimes).

@adjivas
Copy link

adjivas commented Sep 9, 2022

Hello @steele232 , I success to build this Firefly image, I wish it's may help you.

FROM ubuntu:latest
ENV DEBIAN_FRONTEND noninteractive

RUN useradd -ms /bin/bash user

RUN apt-get update && apt-get install -y build-essential vim git wget curl chrpath file python3

WORKDIR "/root"

# install nightly-2022-08-08 toolchain only
RUN curl https://sh.rustup.rs -sSf | \
    sh -s -- --default-toolchain nightly-2022-08-08 -y

ENV PATH=/root/.cargo/bin:$PATH

RUN rustup default nightly-2022-08-08

ENV CARGO_MAKE_TOOLCHAIN=nightly-2022-08-08

RUN cargo install cargo-make

RUN rustup target add wasm32-unknown-unknown --toolchain nightly-2022-08-08


RUN apt-get update && apt-get install -y ninja-build cmake ccache

# LLVM

ENV XDG_DATA_HOME=/root/.local/share

RUN mkdir -p $XDG_DATA_HOME/llvm/firefly/ && \
    cd $XDG_DATA_HOME/llvm/firefly/ && \
    wget https://github.com/getfirefly/llvm-project/releases/download/firefly-15.0.0-dev_2022-08-27/clang+llvm-15.0.0-x86_64-linux-gnu.tar.gz && \
    tar -xz --strip-components 1 -f clang+llvm-15.0.0-x86_64-linux-gnu.tar.gz && \
    rm clang+llvm-15.0.0-x86_64-linux-gnu.tar.gz && \
    cd -

# llvm-project
RUN git clone --depth 1 https://github.com/lumen/llvm-project
RUN cd /root/llvm-project && git checkout firefly
RUN make llvm-shared -C /root/llvm-project
RUN cd -

# FireFly
Run git clone https://github.com/GetFirefly/firefly.git
ENV CC=$XDG_DATA_HOME/llvm/firefly/bin/clang
ENV CXX=$XDG_DATA_HOME/llvm/firefly/bin/clang++
ENV LLVM_PREFIX=$XDG_DATA_HOME/llvm/firefly
ENV FIREFLY_BUILD_TYPE=static
RUN cd /root/firefly && cargo make firefly

@steele232
Copy link
Author

Ok! Just saw this. I will try this soon!

@steele232
Copy link
Author

steele232 commented Sep 29, 2022

So unfortunately this one fails for me. It made my Ubuntu 16GB laptop crash several times from CPU utilization or something and then when I tried to build the docker image without any other programs running simultaneously, it didn't crash the computer but it did fail with an error status of 2. It was very weird. It seemed to have problems shortly after step [ 2646 / 5700 ] or something like that.

But I'm glad that you and other people have gotten it working!

...used-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wmisleading-indentation -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O2 -g -DNDEBUG  -fno-exceptions -fno-rtti -UNDEBUG -std=c++14 -MD -MT tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaExpr.cpp.o -MF tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaExpr.cpp.o.d -o tools/clang/lib/Sema/CMakeFiles/obj.clangSema.dir/SemaExpr.cpp.o -c /root/llvm-project/clang/lib/Sema/SemaExpr.cpp
ninja: build stopped: subcommand failed.
make: *** [Makefile:27: llvm-shared] Error 1
make: Leaving directory '/root/llvm-project'
The command '/bin/sh -c make llvm-shared -C /root/llvm-project' returned a non-zero code: 2
make: *** [makefile:11: build] Error 2

I suppose possible next steps for me would be to

  • checkout a certain commit of the project and try again..
  • or try spinning up a more powerful machine in the cloud and trying to build it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants