Registering @alexcrichton's ideas from #137 (comment) so they don't get lost:
We've got the following state of affairs:
- This report saying we don't compile by default on alpine
- This report saying the same
- This comment indicating that some musl builds have
proc_macro
- This report saying that if
proc_macro2 doesn't link to proc_macro then the dependencies of proc_macro2 aren't ready for that.
I think it's sort of a bummer that this crate doesn't work by default on the standard musl target, and I think it'd be great to fix this. Here's an idea, though, of how we could get this working:
- Somehow in this crate's build script we deterine whether or not to link to
proc_macro
- This crate also indicates
links = "proc-macro2-04x"
- This crate's build script now prints out whether or not it links to
proc_macro
- Crates like
syn have a build script.
syn reads the env var DEP_PROC_MACRO2_04X, learning about whether proc_macro was linked.
syn's build script then prints out something like cargo:rustc-args=--cfg proc_macro_works and is compiled appropriately
This is sort of heinously complex unfortunately though. It also requires this crate's build script to figure out whether to depend on proc_macro or not (which I'm not sure how to do)
Registering @alexcrichton's ideas from #137 (comment) so they don't get lost:
We've got the following state of affairs:
proc_macroproc_macro2doesn't link toproc_macrothen the dependencies ofproc_macro2aren't ready for that.I think it's sort of a bummer that this crate doesn't work by default on the standard musl target, and I think it'd be great to fix this. Here's an idea, though, of how we could get this working:
proc_macrolinks = "proc-macro2-04x"proc_macrosynhave a build script.synreads the env varDEP_PROC_MACRO2_04X, learning about whetherproc_macrowas linked.syn's build script then prints out something likecargo:rustc-args=--cfg proc_macro_worksand is compiled appropriatelyThis is sort of heinously complex unfortunately though. It also requires this crate's build script to figure out whether to depend on
proc_macroor not (which I'm not sure how to do)