More details on the segfault vs non-segfault issue with workspaces.
I’m working off of the server branch of https://github.com/frankmcsherry/differential-dataflow/, which at least for the moment exhibits the following behavior:
git clone https://github.com/frankmcsherry/differential-dataflow/
cd differential-dataflow
cd server
git checkout server
rustup override set nightly-2017-11-29
cargo build --release
cd dataflows/random_graph
cargo build --release
cd ../..
Now if we spin up the server binary and attempt to load the random_graph dylib, we get the intended non-segfaulting experience:
Echidnatron% cargo run --release
Finished release [optimized] target(s) in 0.0 secs
Running `target/release/server`
load dataflows/random_graph/target/release/librandom_graph.dylib build <graph_name> 1000 1000 1000
worker 0: received command: ["load", "dataflows/random_graph/target/release/librandom_graph.dylib", "build", "<graph_name>", "1000", "1000", "1000"]
handles set
If we repeat the process from scratch, but with edits to Cargo.toml uncommenting the workspace binding,
git clone https://github.com/frankmcsherry/differential-dataflow/
cd differential-dataflow
cd server
git checkout server
rustup override set nightly-2017-11-29
%% edit Cargo.toml to uncomment workspace links.
cargo build --release --all
when we run things we get a less awesome experience
Echidnatron% cargo run --release
Finished release [optimized] target(s) in 0.0 secs
Running `target/release/server`
load ./target/release/librandom_graph.dylib build <graph_name> 1000 1000 1000
worker 0: received command: ["load", "./target/release/librandom_graph.dylib", "build", "<graph_name>", "1000", "1000", "1000"]
handles set
zsh: segmentation fault cargo run --release
Echidnatron%
The handles set line is produced in the dylib, so we are landing in there in both cases, but something horrible is happening along the way.
As Ariel mentions, std is probably being linked statically, and I have no clue whether this does a bad thing in this case or not. The librandom_graph.dylib was 825,632 bytes with workspaces, and 2,291,824 bytes without, so something fundamentally different seems to be happening beyond exploding (do workspaces institute a -C prefer-dynamic?).