Build error using various toolchains



I’m a newcomer to Rust landscape.
I have some issues with building, maybe someone has fought already and is willing to share some insights.
The big picture: I’m trying to build a project based on Pikkr -
It has as dependencies fnv 1.0.6 and x86intrin 0.4.5.
If I try to build using stable, x86intrin won’t compile, ![feature] not allowed in stable.
If I try to build in current nightly, x86intrin won’t compile due to other errors.
If I install the previous nightly ( nightly-2018-11-03-x86_64 ), fnv, x86intrin and pikkr are compiled without error, but when building my project Rust bombs out with this:

error: could not exec the linker `cc`

= note: Not a directory (os error 20)
= note: “cc” “-m64” “-L” ( and a lot of filenames afterwards )

The only reference I was able to find on the net was that re-installing Rust toolchain from scratch made the issue go away, which unfortunately didn’t helped me.

Anyone has any ideas that can help ?

And on a broader view, my current understanding is that a nightly build is something with experimental features, to be used only by those that want to be on the bleeding edge… Why would I publish a library that FORCES me to use only nightly toolchains to compile ? Is there a different approach in Rust ?
I understand that by example I use some feature in 1.32 nightly, but eventually that feature would make it ( or not ) into stable, so maybe I should be able to compile using 1.33 stable … Where is my understanding wrong ?

TIA :slight_smile:



Sorry, forgot to mention … OSX Darwin 64



I am not sure what the question is. You seem to understand the big picture well, and the specific case needs more information to help. That is, if your “my project” can’t be public, at least there should be a way to reproduce the problem.

The big picture is that stable toolchain should work, and if toolchain breaks for nightly-only libraries like pikkr, you (pikkr developers, pikkr users, etc.) are responsible for fix.

As for “why would one publish a library that forces one to use only nightly toolchains”, there are two answers for two different aspects of the question. First, why would one use nightly? So that one can use nightly-only features. Second, why would one publish such code? So that others on the bleeding edge can try it.

In other words, if you want stability, do not use nightly-only libraries. Just forget pikkr exists at all. It does not exist for you.



OK, I’ll try to put some more context.
What I’m trying to compile is pretty simple:

use std::io::BufReader;
use std::io::BufRead;
use std::fs::File;
fn main() {   
    let queries = vec![
    let train_num = 10; // Number of records used as training data
                       // before Pikkr starts speculative parsing.
    let mut p = match pikkr::Pikkr::new(&queries, train_num) {
        Ok(p) => p,
        Err(err) => panic!("There was a problem creating a JSON parser: {:?}", err.kind()),

    //let f = File::open("/Volumes/Data/logs/fatal.json").unwrap();
    let f = File::open("/Volumes/Data/logs/lim.json").unwrap();
    let file = BufReader::new(&f);
    for (num, line) in file.lines().enumerate() {
        let l = line.unwrap();
        match p.parse(l.as_bytes()) {
            Ok(results) => {
                for result in results {
                    print!("{} {}", num, match result {
                        Some(result) => String::from_utf8(result.to_vec()).unwrap(),
                        None => String::from("None"),
            Err(err) => println!("There was a problem parsing a record: {:?}", err.kind()),
        //println!(">{}, {}", num, l);        

In cargo.toml I have only one dependency on pikkr 0.16.0 …
Now, In the travis file for pikkr they use both nightly and stable, and apparently it passes builds.

Thanks for confirming my concerns about stable/nigthly. Point taken, don’t use nightly is you don’t want that. But let’s assume I’d like to.
I’ll try to re-phrase my question:
Rust bombs out because apparently it cannot find the linker ( I think I pasted the lines with the error, but here it is again for the reference ).

error: could not exec the linker `cc`
  = note: Not a directory (os error 20)
  = note: "cc" "-m64" "-L" <snip>

“cc” is in path and installed:

Apple LLVM version 7.3.0 (clang-703.0.31)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/

If I copy/paste same command reported back by Rust on the command line, it works.
So, what can I do to build my project ?



For the record, I tried at home on my Ubuntu machine, everything works like a charm … I wish I could understand.