Ok! I'm back. Booted up the ol' Ubuntu machine and after some classic shenanigans getting things up to date I'm now giving roc another go!
Versions of stuff:
But when running cargo run repl, I get
error: failed to run custom build command for `roc_builtins v0.1.0 (/home/matthias/Projects/roc/compiler/builtins)`
Caused by:
process didn't exit successfully: `/home/matthias/Projects/roc/target/debug/build/roc_builtins-fc46a14962010627/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-changed=build.rs
cargo:rustc-env=BUILTINS_O=/home/matthias/Projects/roc/target/debug/build/roc_builtins-2ac40a7585634db0/out/builtins.o
Compiling zig object to: /home/matthias/Projects/roc/compiler/builtins/bitcode/builtins-host.o
Compiling host ir to: /home/matthias/Projects/roc/compiler/builtins/bitcode/builtins-host.ll
Compiling 32-bit i386 ir to: /home/matthias/Projects/roc/compiler/builtins/bitcode/builtins-i386.ll
Compiling 32-bit wasm32 ir to: /home/matthias/Projects/roc/compiler/builtins/bitcode/builtins-wasm32.ll
Moving zig object to: /home/matthias/Projects/roc/target/debug/build/roc_builtins-2ac40a7585634db0/out/builtins.o
Compiling 32-bit bitcode to: /home/matthias/Projects/roc/compiler/builtins/bitcode/builtins-i386.bc
--- stderr
thread 'main' panicked at 'llvm-as failed: No such file or directory (os error 2)', compiler/builtins/build.rs:127:24
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Ohh wait I might have missed a step setting up llvm :thinking:
Hmm, maybe not. I forgot to do the symlink step mentioned here: https://github.com/rtfeldman/roc/blob/trunk/BUILDING_FROM_SOURCE.md
But after doing that I still get the above issue.
Hmm, also looks like the referenced llvm installation script installs llvm 13.x as opposed to 12.x mentioned in the guide. That an issue?
oooo, things are movin now. switched the symlinks to refer to 13 instead of 12.
Oh snap I'm in the repl!! :tada: :tada:
huh, llvm 13 is not even released ?! Are you using 12 or 13 now?
@Matthew Griffith congrats! :smiley:
you should also be able to run the examples now! e.g. cargo run examples/hello-world/Hello.roc
also cargo run edit
to bring up the editor
Folkert de Vries said:
huh, llvm 13 is not even released ?! Are you using 12 or 13 now?
13 I suppose. I just switched the symlinks to point to clang-13
and llvm-as-13
and things worked.
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
installed 13
Richard Feldman said:
also
cargo run edit
to bring up the editor
Sweet!
well I suppose the good news is that our llvm12 -> 13 upgrade will be smooth if things just work already :smile:
release is scheduled for end of september
I have never tried to build anything from source :sweat_smile:
Just installed LLVM default via sudo apt install llvm
And cargo test gives me the following error:
...
Compiling bytemuck v1.7.2
Compiling palette v0.5.0
Compiling futures-util v0.3.17
Compiling glyph_brush v0.7.2
Compiling zerocopy v0.3.0
error: could not find native static library `Polly`, perhaps an -L flag is missing?
error: could not compile `llvm-sys` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed
Not seen this one anywhere mentioned. Unsure how to proceed
LLVM version is 12. Perhaps that is the problem?
The Polly issue was painful to deal with in Zig too. IIRC LLVM themselves fixed this in subsequent releases.
I think it only manifested in MacOS targets there tho.
I'm on Pop!_OS, Ubuntu based. Just trying to figure out one error at a time. Previous one, as far as I could tell, was that LLVM wasnt installed.
I also installed zig via snapd if that helps
So should I try and get a newer version of LLVM than 12 ? @Shritesh Bhattarai
Honestly, I don't know. Reading BUILDING_FROM_SOURCE.md
, it seems like it is recommended to use LLVM's apt remote to install.
Hmmm... I might be in trouble then:
oliverschoning@pop-os:~/Projects/roc$ sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
--2021-10-21 17:09:16-- https://apt.llvm.org/llvm.sh
Resolving apt.llvm.org (apt.llvm.org)... 2a04:4e42:38::561, 151.101.238.49
Connecting to apt.llvm.org (apt.llvm.org)|2a04:4e42:38::561|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3636 (3.6K) [application/octet-stream]
Saving to: ‘STDOUT’
- 100%[============================>] 3.55K --.-KB/s in 0s
2021-10-21 17:09:17 (33.7 MB/s) - written to stdout [3636/3636]
[sudo] password for oliverschoning:
+ needed_binaries=(lsb_release wget add-apt-repository)
+ missing_binaries=()
+ for binary in "${needed_binaries[@]}"
+ which lsb_release
+ for binary in "${needed_binaries[@]}"
+ which wget
+ for binary in "${needed_binaries[@]}"
+ which add-apt-repository
+ [[ 0 -gt 0 ]]
+ LLVM_VERSION=13
+ '[' 0 -eq 1 ']'
++ lsb_release -is
+ DISTRO=Pop
++ lsb_release -sr
+ VERSION=21.04
+ DIST_VERSION=Pop_21.04
+ [[ 0 -ne 0 ]]
+ declare -A LLVM_VERSION_PATTERNS
+ LLVM_VERSION_PATTERNS[9]=-9
+ LLVM_VERSION_PATTERNS[10]=-10
+ LLVM_VERSION_PATTERNS[11]=-11
+ LLVM_VERSION_PATTERNS[12]=-12
+ LLVM_VERSION_PATTERNS[13]=-13
+ LLVM_VERSION_PATTERNS[14]=
+ '[' '!' _ ']'
+ LLVM_VERSION_STRING=-13
+ case "$DIST_VERSION" in
+ echo 'Distribution '\''Pop'\'' in version '\''21.04'\'' is not supported by this script (Pop_21.04).'
Distribution 'Pop' in version '21.04' is not supported by this script (Pop_21.04).
+ exit 2
That just looks like the script doesn't realize pop is ubuntu
You might need to slightly modify it to hardcode your distro as ubuntu.
That is the output of the sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
from https://github.com/rtfeldman/roc/blob/trunk/BUILDING_FROM_SOURCE.md
Looking at apt.llvm.org Default Packages section now. I wonder if I can just run:
apt-get install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python-clang
This is very new territory for me hehe. I am used to npm i
:smiley:
First you need to add the llvm ppa, then that would work correctly
So am I understanding it correctly that the sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
is sugar for that longer sudo apt-get install ?
These days I just download the llvm zip file
On Linux mint
Also, the script does a few more things than just an install command. This is the core:
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
add-apt-repository "${REPO_NAME}"
apt-get update
apt-get install -y clang-$LLVM_VERSION lldb-$LLVM_VERSION lld-$LLVM_VERSION clangd-$LLVM_VERSION
Which zip and what version @Folkert de Vries ?
from this page
https://github.com/llvm/llvm-project/releases/tag/llvmorg-12.0.0
I think that should be 12.0.1
now
then define your equvalent of this variable set -x LLVM_SYS_120_PREFIX "/home/folkertdev/Downloads/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04"
not with zig 0.8.0
or at least, that is untested
and then you may need to symlink some executables or add the /bin
folder from the extracted archive to your PATH
@Folkert de Vries hmm but I already have llvm 12 I think
oliverschoning@pop-os:~/Projects/roc$ llvm-config --version
12.0.0
and zig 0.8.1
Sorry what is failing then?
I am running cargo test
in the roc repo:
oliverschoning@pop-os:~/Projects/roc$ cargo test
Compiling serde v1.0.130
Compiling morphic_lib v0.1.0 (/home/oliverschoning/Projects/roc/vendor/morphic_lib)
Compiling rkyv v0.6.7
Compiling darling v0.13.0
Compiling minimp3 v0.5.1
Compiling futures-executor v0.3.17
Compiling roc_parse v0.1.0 (/home/oliverschoning/Projects/roc/compiler/parse)
Compiling roc_types v0.1.0 (/home/oliverschoning/Projects/roc/compiler/types)
Compiling darling v0.10.2
Compiling llvm-sys v120.2.1
Compiling clap_derive v3.0.0-beta.1 (https://github.com/rtfeldman/clap?branch=master#e1d83a78)
Compiling enumset_derive v0.5.5
Compiling test_mono_macros v0.1.0 (/home/oliverschoning/Projects/roc/compiler/test_mono_macros)
error: could not find native static library `Polly`, perhaps an -L flag is missing?
error: could not compile `llvm-sys` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed
oliverschoning@pop-os:~/Projects/roc$
I installed llvm via sudo apt install llvm
can you define the shell variable like I showed, that might llvm-sys figure things out
Sorry @Folkert de Vries but I am unfamilliar with setting a variable like this:
set -x LLVM_SYS_120_PREFIX "/home/folkertdev/Downloads/clang+llvm-12.0.0-x86_64-linux-gnu-ubuntu-20.04"
I can set something in my .bashrc if that is the idea? But I also do not know the path like you specified since I did not download it into my home/username/Downloads folder.
Do you have some more hints so I can figure it out? :smile:
allright first we need to figure out where llvm is actually installed
first try which llvm-as
/usr/bin/llvm-as
and then that should hopefully be a symlink
maybe ls -h /usr/bin/llvm-as
works?
oliverschoning@pop-os:~$ ls -h /usr/bin/llvm-as
/usr/bin/llvm-as
actually try readlink -f /usr/bin/llvm-as
Look at us, pair programming without a video share or call :grinning_face_with_smiling_eyes:
oliverschoning@pop-os:~$ readlink -f /usr/bin/llvm-as
/usr/lib/llvm-12/bin/llvm-as
cool, eh then in the .bashrc
export LLVM_SYS_120_PREFIX="<that path>"
actually, just /usr/lib/llvm-12
and then I think source ~/.bashrc
before you try running cargo again
Just export /usr/... you mean?
export LLVM_SYS_120_PREFIX="/usr/lib/llvm-12"
Ok I did the source command
right so then you can try compiling again
(in the shell where you did the source)
Oh, adding to .bashrc does not make it permanent to all terminals?
oliverschoning@pop-os:~/Projects/roc$ source ~/.bashrc
oliverschoning@pop-os:~/Projects/roc$ cargo test
Compiling object v0.25.3
Compiling llvm-sys v120.2.1
Compiling object v0.24.0
Compiling petgraph v0.6.0
Compiling serde_yaml v0.8.20
Compiling typetag v0.1.7
Compiling csv v1.1.6
Compiling tinytemplate v1.2.1
Compiling backtrace v0.3.61
Compiling wasmer-types v2.0.0
Compiling cranelift-codegen v0.74.0
Compiling clap v3.0.0-beta.1 (https://github.com/rtfeldman/clap?branch=master#e1d83a78)
error: could not find native static library `Polly`, perhaps an -L flag is missing?
error: could not compile `llvm-sys` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed
oliverschoning@pop-os:~/Projects/roc$
Same error unfortunately
makes it permanent in all new terminals, but does not change existing ones you have open
here
I'm attempting to use LLVM bindings in Rust, the common bindings are the
llvm-sys crate. To link, they use
llvm-config-10 --link-static --libnames
to find all the libraries. That list includes libPolly.a which isn't
installed
as part of llvm-10 but is instead included in libclang-common-10-dev which
may or may not be installed.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=966574
you also need to install libclang-common-dev-12-dev it seems
To make sure always the most recent versions of the packages are installed, we are providing some default packages.
To install all of them (currently version 14):
apt-get install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python-clang
https://apt.llvm.org/#default_pkg
Maybe I need to manually install these then?
I downloaded the llvm.sh file. Perhaps I can tweak it to accept my distro
Its based on ubuntu 21.04. So just a wild guess that I can change the Ubuntu_21.04 to Pop_21.04
# find the right repository name for the distro and version
case "$DIST_VERSION" in
Debian_9* ) REPO_NAME="deb http://apt.llvm.org/stretch/ llvm-toolchain-stretch$LLVM_VERSION_STRING main" ;;
Debian_10* ) REPO_NAME="deb http://apt.llvm.org/buster/ llvm-toolchain-buster$LLVM_VERSION_STRING main" ;;
Debian_11* ) REPO_NAME="deb http://apt.llvm.org/bullseye/ llvm-toolchain-bullseye$LLVM_VERSION_STRING main" ;;
Debian_unstable ) REPO_NAME="deb http://apt.llvm.org/unstable/ llvm-toolchain$LLVM_VERSION_STRING main" ;;
Debian_testing ) REPO_NAME="deb http://apt.llvm.org/unstable/ llvm-toolchain$LLVM_VERSION_STRING main" ;;
Ubuntu_16.04 ) REPO_NAME="deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial$LLVM_VERSION_STRING main" ;;
Ubuntu_18.04 ) REPO_NAME="deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic$LLVM_VERSION_STRING main" ;;
Ubuntu_18.10 ) REPO_NAME="deb http://apt.llvm.org/cosmic/ llvm-toolchain-cosmic$LLVM_VERSION_STRING main" ;;
Ubuntu_19.04 ) REPO_NAME="deb http://apt.llvm.org/disco/ llvm-toolchain-disco$LLVM_VERSION_STRING main" ;;
Ubuntu_19.10 ) REPO_NAME="deb http://apt.llvm.org/eoan/ llvm-toolchain-eoan$LLVM_VERSION_STRING main" ;;
Ubuntu_20.04 ) REPO_NAME="deb http://apt.llvm.org/focal/ llvm-toolchain-focal$LLVM_VERSION_STRING main" ;;
Ubuntu_21.04 ) REPO_NAME="deb http://apt.llvm.org/groovy/ llvm-toolchain-groovy$LLVM_VERSION_STRING main" ;;
Ubuntu_21.10 ) REPO_NAME="deb http://apt.llvm.org/hirsute/ llvm-toolchain-hirsute$LLVM_VERSION_STRING main" ;;
* )
echo "Distribution '$DISTRO' in version '$VERSION' is not supported by this script (${DIST_VERSION})."
exit 2
esac
Ohh
Something is happening
Hmm, progress perhaps?
Get:11 http://us.archive.ubuntu.com/ubuntu hirsute-updates InRelease [115 kB]
Get:12 http://us.archive.ubuntu.com/ubuntu hirsute-backports InRelease [101 kB]
Hit:10 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease
Fetched 326 kB in 2s (170 kB/s)
Reading package lists... Done
+ apt-get install -y clang-13 lldb-13 lld-13 clangd-13
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies.
liblldb-13 : Depends: libpython3.8 (>= 3.8.2) but it is not installable
E: Unable to correct problems, you have held broken packages.
On Linux I’ve had a good time with llvmenv
hmm llvm13 is definitely not what you want
this is why I download that zip: it's a bit of work, but at least it's all simple stuff, no fighting with shell scripts or anything like that
You can pass a number to the shell script for the version you want to install
Just an FYI
Ok a little update
I ran
apt-get install clang-format clang-tidy clang-tools clang clangd libc++-dev libc++1 libc++abi-dev libc++abi1 libclang-dev libclang1 liblldb-dev libllvm-ocaml-dev libomp-dev libomp5 lld lldb llvm-dev llvm-runtime llvm python-clang
And I think I am pretty close now?
Output too long, here is a hastebin:
https://hastebin.com/uwoqebigep.rb
It seems to run the cargo test now, but a lot of failures:
failures:
cli_run::astar
cli_run::base64
cli_run::cfold
cli_run::cli
cli_run::closure
cli_run::deriv
cli_run::effect
cli_run::fib
cli_run::hello_rust
cli_run::hello_world
cli_run::hello_zig
cli_run::nqueens
cli_run::quicksort
cli_run::rbtree_ck
cli_run::rbtree_insert
cli_run::run_multi_dep_str_optimized
cli_run::run_multi_dep_str_unoptimized
cli_run::run_multi_dep_thunk_optimized
cli_run::run_multi_dep_thunk_unoptimized
test result: FAILED. 2 passed; 19 failed; 0 ignored; 0 measured; 0 filtered out; finished in 9.26s
Interesting. Some sort of linker argument error.
Well, I am, for the first time, able to run the repl! I call that success :D
Well.. babysteps :joy:
The rockin’ roc repl
────────────────────────
Enter an expression, or :help, or :exit/:q.
» 1 +1
ld: Error: unable to disambiguate: -arch (did you mean --arch ?)
thread 'main' panicked at 'Error loading compiled dylib for test: DlOpen { desc: "/tmp/.tmpYFlZpw/app.so.1.0: cannot open shared object file: No such file or directory" }', cli/src/repl/gen.rs:227:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Hmm. I see some comments in the code related to this error, but not sure of the correct fix at the moment.
oliverschoning@pop-os:~/Projects/roc/examples$ cargo run hello-world/Hello.roc
Finished dev [unoptimized + debuginfo] target(s) in 0.17s
Running `/home/oliverschoning/Projects/roc/target/debug/roc hello-world/Hello.roc`
ld: Error: unable to disambiguate: -arch (did you mean --arch ?)
oliverschoning@pop-os:~/Projects/roc/examples$
I think the fix might be for me to go to my storage room and get my macbook 2012 :joy:
What do you get when you run ld --version
oliverschoning@pop-os:~/Projects/roc/examples$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.36.1
Copyright (C) 2021 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public Licence version 3 or (at your option) a later version.
This program has absolutely no warranty.
Also, roc should run on Ubuntu or pop just fine. I exclusively use Linux.
I'm sure it will eventually work on my machine since it's ubuntu based. I am only mentioning osx coz a buddy tried roc today and had it working almost immediately hehe
Fair enough
But I would like to avoid having to run triple boot just to get this working. Id like to stay dual booted
I get no hits on google for " -arch (did you mean --arch ?)"
Can you try pulling and running theupdate-arch
branch?
See if that fixes it for you?
Brendan Hansknecht said:
First you need to add the llvm ppa, then that would work correctly
you mentioned this @Brendan Hansknecht , I did not do this. Maybe that is why?
That shouldn't be the cause of this issue cause it is caused by ld
which is gnu, not llvm
ok, so I'm gonna try switching to that branch
I can only see a fix-arch-docs, that one?
oliverschoning@pop-os:~/Projects/roc$ git status
On branch fix-arch-docs
Your branch is up-to-date with 'origin/fix-arch-docs'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
cli/tests/
compiler/
examples/
nothing added to commit but untracked files present (use "git add" to track)
oliverschoning@pop-os:~/Projects/roc$ cargo test
Updating git repository `https://github.com/TheDan64/inkwell`
error: failed to get `inkwell` as a dependency of package `roc v0.1.0 (/home/oliverschoning/Projects/roc)`
Caused by:
failed to load source for dependency `inkwell`
Caused by:
Unable to update https://github.com/TheDan64/inkwell?branch=llvm8-0#aeba58a7
Caused by:
object not found - no match for id (aeba58a7c684b27416b55bc1e53e4d2bee15c5ec); class=Odb (9); code=NotFound (-3)
oliverschoning@pop-os:~/Projects/roc$
oh wait. I see it now
make sure to git pull
I just made the branch
A unfortunately same issue. The cargo test hangs right now and a lot of failed. And Cargo run gives:
oliverschoning@pop-os:~/Projects/roc/examples$ cargo run hello-world/Hello.roc
Compiling rand_core v0.4.2
Compiling rand v0.8.4
Compiling wyhash v0.3.0
Compiling roc_collections v0.1.0 (/home/oliverschoning/Projects/roc/compiler/collections)
Compiling roc_module v0.1.0 (/home/oliverschoning/Projects/roc/compiler/module)
Compiling ven_graph v2.0.5-pre (/home/oliverschoning/Projects/roc/vendor/pathfinding)
Compiling tempfile v3.2.0
Compiling twox-hash v1.6.1
Compiling wasmer-engine-dylib v2.0.0
Compiling glyph_brush v0.7.2
Compiling wgpu_glyph v0.14.1
Compiling wasmer v2.0.0
Compiling wasmer-wasi v2.0.0
Compiling roc_types v0.1.0 (/home/oliverschoning/Projects/roc/compiler/types)
Compiling roc_parse v0.1.0 (/home/oliverschoning/Projects/roc/compiler/parse)
Compiling roc_builtins v0.1.0 (/home/oliverschoning/Projects/roc/compiler/builtins)
Compiling roc_unify v0.1.0 (/home/oliverschoning/Projects/roc/compiler/unify)
Compiling roc_problem v0.1.0 (/home/oliverschoning/Projects/roc/compiler/problem)
Compiling roc_fmt v0.1.0 (/home/oliverschoning/Projects/roc/compiler/fmt)
Compiling roc_can v0.1.0 (/home/oliverschoning/Projects/roc/compiler/can)
Compiling roc_solve v0.1.0 (/home/oliverschoning/Projects/roc/compiler/solve)
Compiling roc_constrain v0.1.0 (/home/oliverschoning/Projects/roc/compiler/constrain)
Compiling roc_mono v0.1.0 (/home/oliverschoning/Projects/roc/compiler/mono)
Compiling roc_reporting v0.1.0 (/home/oliverschoning/Projects/roc/compiler/reporting)
Compiling roc_gen_llvm v0.1.0 (/home/oliverschoning/Projects/roc/compiler/gen_llvm)
Compiling roc_gen_wasm v0.1.0 (/home/oliverschoning/Projects/roc/compiler/gen_wasm)
Compiling roc_load v0.1.0 (/home/oliverschoning/Projects/roc/compiler/load)
Compiling roc_ast v0.1.0 (/home/oliverschoning/Projects/roc/ast)
Compiling roc_gen_dev v0.1.0 (/home/oliverschoning/Projects/roc/compiler/gen_dev)
Compiling roc_build v0.1.0 (/home/oliverschoning/Projects/roc/compiler/build)
Compiling roc_linker v0.1.0 (/home/oliverschoning/Projects/roc/linker)
Compiling roc_code_markup v0.1.0 (/home/oliverschoning/Projects/roc/code_markup)
Compiling roc_docs v0.1.0 (/home/oliverschoning/Projects/roc/docs)
Compiling roc_editor v0.1.0 (/home/oliverschoning/Projects/roc/editor)
Compiling roc_cli v0.1.0 (/home/oliverschoning/Projects/roc/cli)
Finished dev [unoptimized + debuginfo] target(s) in 1m 02s
Running `/home/oliverschoning/Projects/roc/target/debug/roc hello-world/Hello.roc`
ld: Error: unable to disambiguate: --arch (did you mean ---arch ?)
oliverschoning@pop-os:~/Projects/roc$ cargo run repl
Finished dev [unoptimized + debuginfo] target(s) in 0.18s
Running `target/debug/roc repl`
The rockin’ roc repl
────────────────────────
Enter an expression, or :help, or :exit/:q.
» 1 + 1
ld: Error: unable to disambiguate: --arch (did you mean ---arch ?)
thread 'main' panicked at 'Error loading compiled dylib for test: DlOpen { desc: "/tmp/.tmpmH53wB/app.so.1.0: cannot open shared object file: No such file or directory" }', cli/src/repl/gen.rs:227:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
oliverschoning@pop-os:~/Projects/roc$
I just pushed one more commit to temporarily disable the arch flag, can you pull and run one more time? I am really confused as to the issue your version of ld is having the the arch flag.
Will do! Most likely I messed up the install I assume
https://hastebin.com/aziporewec.rust <- cargo test
oliverschoning@pop-os:~/Projects/roc/examples$ cargo run hello-world/Hello.roc
Blocking waiting for file lock on build directory
warning: unused import: `crate::target::arch_str`
--> compiler/build/src/link.rs:1:5
|
1 | use crate::target::arch_str;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused variable: `arch`
--> compiler/build/src/link.rs:726:9
|
726 | let arch = match target.architecture {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_arch`
|
= note: `#[warn(unused_variables)]` on by default
warning: `roc_build` (lib) generated 2 warnings
Finished dev [unoptimized + debuginfo] target(s) in 15.37s
Running `/home/oliverschoning/Projects/roc/target/debug/roc hello-world/Hello.roc`
Error: Os { code: 26, kind: ExecutableFileBusy, message: "Text file busy" }
oliverschoning@pop-os:~/Projects/roc/examples$
I was hower able to write 1 + 1 in the repl this time!
Oh, you need to install valgrind
Should just be an sudo apt install valgrind
Omg it worked!
Now only one tests fails and I was able to run helloworld!
test cli_run::astar ... FAILED
<- this test
Thank you very much @Brendan Hansknecht
If you run the tests again or just that test alone, does it consistently fail. I think our tests have a minor filesystem race condition that hasn't been fixed yet.
How can I run a single test?
cargo test --test cli_run deriv
should run just the deriv cli test
I have re-run the all tests a couple of times. Sometimes they hang:
test cli_run::cfold has been running for over 60 seconds
test cli_run::cli has been running for over 60 seconds
Sometimes a test fails, never the same, sometimes they all pass.
Very confusing
yea that happens, seems like you're hit hard by it though
there is some race condition in there
does cargo test --test cli_run -- --test-threads 1
work?
(it is going to be slow, but it should be correct)
Running it now. Why are tests sometimes failing tho? That's not how I usually expect unit tests to work haha
Those are integration tests and a number of them generate the same file. So sometimes they delete the file while another test is using it. I thought we set them to run sequentially but I guess it doesn't work.
Result from:
cargo test --test cli_run -- --test-threads 1
``oliverschoning@pop-os:~/Projects/roc$ cargo test --test cli_run -- --test-threads 1
warning: unused import:
crate::target::arch_str
--> compiler/build/src/link.rs:1:5
|
1 | use crate::target::arch_str;
| ^^^^^^^^^^^^^^^^^^^^^^^
|
= note:
#[warn(unused_imports)]` on by default
warning: unused variable: arch
--> compiler/build/src/link.rs:726:9
|
726 | let arch = match target.architecture {
| ^^^^ help: if this is intentional, prefix it with an underscore: _arch
|
= note: #[warn(unused_variables)]
on by default
warning: roc_build
(lib) generated 2 warnings
Finished test [unoptimized + debuginfo] target(s) in 0.18s
Running tests/cli_run.rs (target/debug/deps/cli_run-42f9a13667c40034)
running 21 tests
test cli_run::astar ... ok
test cli_run::base64 ... ok
test cli_run::cfold ... ok
test cli_run::cli ... ok
test cli_run::closure ... ok
test cli_run::deriv ... ok
test cli_run::effect ... ok
test cli_run::fib ... ok
test cli_run::hello_rust ... ok
test cli_run::hello_web ... ok
test cli_run::hello_world ... ok
test cli_run::hello_zig ... ok
test cli_run::nqueens ... ok
test cli_run::quicksort ... ok
test cli_run::quicksort_app ... ok
test cli_run::rbtree_ck ... ok
test cli_run::rbtree_insert ... ok
test cli_run::run_multi_dep_str_optimized ... ok
test cli_run::run_multi_dep_str_unoptimized ... ok
test cli_run::run_multi_dep_thunk_optimized ... ok
test cli_run::run_multi_dep_thunk_unoptimized ... ok
test result: ok. 21 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 49.42s
Cool. You have a working compiler. The warning messages are due to my quick hacks to disable the -arch
Still need to figure out what exactly is going on there.
:tada: yay! thanks so much
I can live with this, eventually there will be an installer I assume :D
@Brendan Hansknecht those tests don't run sequentially normally
it just seems that some machines are more likely to run into that race condition
maybe based on processor speed or number of cores
Oh, i didn't realize. We should maybe at least make the ones in the benchmarks folder run sequentially. Or first compile the host and then use the --precompiled-host
flag.
that flag exists?
if so we can use it, on ci at least
because there one of the tests is run to compile the host, effectively pre-compiling it for the rest
I added the flag as part of linker changes
oh, excellent
Thanks for working through this with us @Oliver Schöning ! I have improved the llvm installation instructions for Ubuntu/Debian, I'll also be working on a complete install script today.
@Anton omg no problem! I’m just very grateful for all the help I’ve gotten! Clearly the Elm community spirit also lives in Roc ❤️
@Brendan Hansknecht and @Oliver Schöning I think this PR will solve the -arch
problem: https://github.com/rtfeldman/roc/pull/1851
Could you guys take a look? @Oliver Schöning this change should make it work smooth.
Last updated: Jul 06 2025 at 12:14 UTC