Looks CoreFoundation related.
Undefined symbols for architecture x86_64:
"_CFURLResourceIsReachable", referenced from:
fsevent_sys::core_foundation::str_path_to_cfstring_ref::h0ea4bd94e2c613f2 in libfsevent_sys-ef30b6879660a6c1.rlib(fsevent_sys-ef30b6879660a6c1.fsevent_sys7-49ce33334334dd3a5c7883bf4070f954.rs.rcgu.o)
ld: symbol(s) not found for architecture x86_64
/cc ZHF #45961
While it's possible to build on darwin, we never had a successful build.
Undefined symbols for architecture x86_64:
"sf::microseconds(long long)", referenced from:
_sfSleep in Sleep.cpp.o
/cc ZHF #45961
Using gccStdenv makes the build go further, but then it fails with.
kuipc /private/tmp/nix-build-cernlib-2006.drv-0/2006/src/packlib/kuip/code_kuip/kuipcdf.cdf kuipcdf.c
Makefile:413: archive/kuipcdf.d: No such file or directory
make[3]: *** [Makefile:473: kuipcdf.c] Abort trap: 6
/cc ZHF #45961
This commit adds test based on real-world crates (brotli).
There were a few more edge cases that were missing beforehand. Also it
turned out that we can get rid of the `finalBins` list since that will
now be handled during runtime.
The build expression got quiet large over time and to make it a bit
easier to grasp the different scripts involved in the build are now
separated from the nix file.
Cargo has a few odd (old) ways of picking source files if the `bin.path`
attribute isn't given in the Cargo.toml. This commit adds support for
some of those. The previous behaviour always defaulted to `src/main.rs`
which was not always the right choice.
Since there is look-ahead into the unpacked sources before running the
actual builder the path selection logic has to be embedded within the
build script.
`buildRustCrate` currently supports two ways of running building
binaries when processing a crate:
- Explicit definition of all the binaries (& optionally the paths to
their respective `main.rs`) and,
- if not binary was explictly configured all files matching the patterns
`src/main.rs`, `src/bin/*.rs`.
When the explicit list is given without path information paths are now
being picked from a list of candidates. The first match wins. The order
is the same as within the cargo compatibility code.
If the crate does not provide any libraries the path `src/{bin_name}.rs`
is also considered.
All underscores within the binary names are translated into dashes (`-`)
before the lookups are made. This seems to be a common convention.