since different platforms have subtle differences (libc in this case) i want to run configuration tests from build.rs.
For each 'feature' defined in Cargo.toml check if there is a conf_test/feature.rs, if so then try to compile (which may already fail) and run it. When both succeeds then enable that feature.
So far so good, I got that mostly working. What is lacking is that haven't found a way how to get the library path that cargo passes to build.rs with the --extern flag. Is there any way to access that or get cargo to tell me about the libraries used and resolve the paths?
'cargo rustc --message-format json -- --emit metadata' would give me the the data, but calling cargo from cargo blocks, possibly because it waits for a lock in the build directory.
'cargo rustc --target-dir ...' fixed the locking problem. I hope that solved all problems.