Skip to content

Commit

Permalink
Disable linking to proc_macro on musl
Browse files Browse the repository at this point in the history
Closes #52
  • Loading branch information
alexcrichton committed Aug 12, 2018
1 parent 5746c2d commit f3d1b2c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ fn maybe_enable_use_proc_macro(target: &str) {
return
}

// There are currently no musl builds of the compiler, so proc_macro is
// always missing, so disable this feature.

This comment has been minimized.

Copy link
@jirutka

jirutka Aug 12, 2018

There are currently no musl builds of the compiler

What exactly do you mean by this?

This comment has been minimized.

Copy link
@alexcrichton

alexcrichton Aug 12, 2018

Author Contributor

We do not do binary releases of the compiler for musl targets today, which means there are no binary releases of proc_macro, which means it's destined to always fail to compile

This comment has been minimized.

Copy link
@jirutka

jirutka Aug 12, 2018

That doesn't mean that no one else do binary releases of the compiler for musl. We do it for more than a year in Alpine Linux (APKBUILD) and VoidLinux. I hope that this assumption will not break our rust build again.

This comment has been minimized.

Copy link
@alexcrichton

alexcrichton Aug 12, 2018

Author Contributor

If it does feel free to send a PR!

if target.contains("-musl") {
return
}

// Otherwise, only enable it if our feature is actually enabled.
if cfg!(feature = "proc-macro") {
println!("cargo:rustc-cfg=use_proc_macro");
Expand Down

0 comments on commit f3d1b2c

Please sign in to comment.