Skip to content

rustc vs permissions #2360

Description

@jesse99

So I have a library where make essentialy does mkdir bin 2> /dev/null && rustc --out-dir bin -O src/rparse.rc. If I start with an empty bin directory and do something lame like sudo make followed by make I get a half-way reasonable error message on Mac:

error: linking with cc failed with code 1
note: cc arguments: -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -m64 -o bin/librparse-613e24f4d58a7a16-0.3.dylib bin/rparse.o -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -lcore-d27e4777a53c3e50-0.2 -L/usr/local/lib/rustc/x86_64-apple-darwin/lib -lstd-d399da1ab6f5bec0-0.2 -dynamiclib -Wl,-install_name,@rpath/librparse-613e24f4d58a7a16-0.3.dylib -lrustrt -Wl,-no_compact_unwind -lmorestack -Wl,-rpath,@executable_path/../../../../../../usr/local/lib/rustc/x86_64-apple-darwin/lib -Wl,-rpath,/usr/local/lib/rustc/x86_64-apple-darwin/lib
note: ld: can't write output file: bin/librparse-613e24f4d58a7a16-0.3.dylib for architecture x86_64
collect2: ld returned 1 exit status

error: aborting due to previous errors
rust: upcall fail 'explicit failure', src/librustsyntax/diagnostic.rs:77
rust: upcall fail 'explicit failure', src/rustc/driver/rustc.rs:232
rust: domain main @0x7f8774000010 root task failed
make: *** [lib] Error 101

But if I start with no bin directory and do the same thing I get the highly unhelpful:

Assertion failed: (FD >= 0 && "File not yet open!"), function preferred_buffer_size, file /Users/jessejones/Source/Third_Party/rust/src/llvm/lib/Support/raw_ostream.cpp, line 590.
make: *** [lib] Illegal instruction: 4

(which I originally thought was an ICE).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-codegenArea: Code generationE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions