crane
crane copied to clipboard
Source prefix mapping is broken if rustflags are set in .cargo/config.toml
Originally brought up in https://github.com/ipetkov/crane/discussions/75
Repro flake: https://github.com/shanesveller/axum-rest-example/blob/5e8831b91724f81970204fff877293e2f2ec65d2/flake.nix#L83-L169
Running nix path-info .#docker -r
gives:
/nix/store/004217z94skkdd664v74aa1a43x1xq7b-cargo-package-aho-corasick-0.7.18 /nix/store/00d196bbncisks5amrximqmia6p6w204-cargo-package-mime-0.3.16 /nix/store/01a5gg965ki1zx34vzl9jk5wz4f4y01b-cargo-package-async-stream-impl-0.3.3 /nix/store/0ap1cxi1l8ax2as9znihmh8w99bdh8ai-cargo-package-which-4.2.5 /nix/store/0gnkg18w8fh6x87w7ywg3qmj05l87r0w-cargo-package-atoi-1.0.0 /nix/store/0kx0m1dyby3q7ngww9x7k1ikdl3h1x60-cargo-package-unicode-normalization-0.1.21 /nix/store/0rgm65ymq6hhkf4b3sy0qqadckkypndv-cargo-package-tokio-1.20.1 /nix/store/0vdzclflbbmlq0y509prp7fn8jv5pl8j-cargo-package-httparse-1.7.1 /nix/store/1269vy9nzw5p170p26i9hkisrbmn4hvd-cargo-package-parking_lot-0.11.2 /nix/store/185dqq2w54qm1qri00ixa7smb1cg5fx9-cargo-package-android_system_properties-0.1.4 /nix/store/1afbvyc3d2r9v8i81iwm8hbnb4lmv3qz-cargo-package-typenum-1.15.0 /nix/store/1gcgis47wk8qxc5ch9frdacwas8jx0n4-cargo-package-sqlformat-0.1.8 /nix/store/1mpj58d7lr0m2h3cz0w716hnl10dm28m-axum-rest-example-customisation-layer /nix/store/1nlhzs2n4h71kmxzk0zimjhj14q0zwyn-cargo-package-paste-1.0.8 /nix/store/1pxc8zaydlbdcxyprlxvs0yd8m4gw36p-cargo-package-async-stream-0.3.3 /nix/store/1v5i6h1407qmhgy6yrjri8kjwpz6445x-cargo-package-tracing-attributes-0.1.22 /nix/store/1vw0adh7g5hm6ffq06msqyqha7qj52l9-cargo-package-webpki-0.21.4 /nix/store/1zjg5svjy32yz6m89baxnkq2i02ic714-cargo-package-smallvec-1.9.0 /nix/store/2caw02v8dgcdcrnff3ci0rsbqshr4knj-cargo-package-fastrand-1.8.0 /nix/store/2iq3n9asdaqs4871fsh8sxwb6qdf9xd0-cargo-package-tokio-util-0.6.10 /nix/store/3461zyyxqdjlkln6wbq2kv3bv818xkx9-cargo-package-wasm-bindgen-macro-0.2.82 /nix/store/3f2ia14y2xlvik4k996548jdib6ss0kd-cargo-package-winapi-i686-pc-windows-gnu-0.4.0 /nix/store/3nryb2j8i2xkj14x3xvpf9x9n2fzc9nh-cargo-package-thiserror-1.0.32 /nix/store/437vh6mhmvvvpd43ayn0i44i4qwslh9i-cargo-package-matchers-0.1.0 /nix/store/43hh5jnf1qzky420jw0xhsc59368sgif-cargo-package-spin-0.5.2 /nix/store/4p4gajw62mk83d5i5fgj2kbp32bndbj2-cargo-package-tracing-futures-0.2.5 /nix/store/4qj9vznf8dza5iral96024rm82vwv6x5-cargo-package-headers-0.3.7 /nix/store/4vpqn2vbz51vbprkzpgld2f2wmwqn4f6-cargo-package-itoa-1.0.3 /nix/store/4x2gwz8dinbkxryrriga1annhdh53fvh-cargo-package-dotenvy-0.15.1 /nix/store/51p3356hv1k0zyidbadrxf79azi0m8ry-cargo-package-ryu-1.0.11 /nix/store/54ikgwrwqsmhglyllm89byydxj63iidk-cargo-package-tinyvec-1.6.0 /nix/store/wj6j8lrdlind44n7vqn864ga7y802vc7-libunistring-1.0 /nix/store/rp4dwxbw4vk590lrbcf9r198cdjwjhmd-libidn2-2.3.2 /nix/store/scd5n7xsn0hh0lvhhnycr9gx0h8xfzsl-glibc-2.34-210 /nix/store/q7k32ydcqlram7f0l6b1y2c4cs07765y-zlib-1.2.12 /nix/store/55x9vyjbplnkrc0b2f060jqzdwqd13n4-sqlite-3.38.5 /nix/store/59y3yhsz7hh6bkd0r7z345fh9016pggr-cargo-package-pin-project-1.0.11 /nix/store/5lx2zyfn1ww907349n8a3nlqn9ng15hs-cargo-package-js-sys-0.3.59 /nix/store/5rimm8cqvp9y77zkp1zxncd6jv4fnh4p-cargo-package-sqlx-0.6.1 /nix/store/5s5cwhq5jxf15kv1cva9i54mhrv4mfif-cargo-package-syn-1.0.99 /nix/store/5v741l9rbidqx0dn307lklbz1djcgf81-cargo-package-futures-executor-0.3.21 /nix/store/61ffmipxrswk0x09rnwfdh0d8bkpg2cd-cargo-package-unicode_categories-0.1.1 /nix/store/633irk75644qhlkalvz9isb8izs227x0-cargo-package-rand_core-0.6.3 /nix/store/63g892cqzc5dkn60lv4yr09zwpvwwk59-cargo-package-tempfile-3.3.0 /nix/store/67iapzh2zzlcykn5hn70jki5xyps3k7c-cargo-package-lazy_static-1.4.0 /nix/store/67iymy0yxc5kaqar4y1gy1kwlwk5qmll-cargo-package-tonic-build-0.6.2 /nix/store/6li05ajqrqvqvg705cadfrdhvaf1nkji-cargo-package-http-body-0.4.5 /nix/store/6yzsbgj7vq0scl5jfkcp2zv0ksqpai64-cargo-package-tower-service-0.3.2 /nix/store/6zm46bgj056kb5rvklwjfikbsfkpr7m6-cargo-package-autocfg-1.1.0 /nix/store/74nilnyl1ycjm5lf7apl1q5sdf2x1cn7-cargo-package-cfg-if-1.0.0 /nix/store/79f1w796ljm8l8v137kngq326qm04x20-cargo-package-async-trait-0.1.57 /nix/store/7l35dn3rw3dlpxc6iyppcxc96kc1z6zy-cargo-package-zeroize-1.5.7 /nix/store/7qwzhp0qs4vx37sia21dcnfiscx5m87g-cargo-package-digest-0.10.3 /nix/store/7zj5yv17cnhyiaba38z3qdqnif3x58rz-cargo-package-indexmap-1.9.1 /nix/store/8636r3d8rsk7c3l5xcgb1mn37pkfc84k-ncurses-6.3-p20220507 /nix/store/89abgv341an3ywpwwhzv359kafmq10ig-cargo-package-winapi-0.3.9 /nix/store/8dwij0g1sbxhwzaabb3qp9sjw7gkavzh-cargo-package-headers-core-0.2.0 /nix/store/8i6b27rnzj1w02rma3rb30f7fq4k2hl6-cargo-package-prost-build-0.9.0 /nix/store/8j1vf2i92pdh7x7vx26l49980kbmvdi9-cargo-package-tower-0.4.13 /nix/store/8mg064bixgn15v4586caaqn3xblkb9ix-cargo-package-opentelemetry-0.17.0 /nix/store/8pd4xbrwj353k8k0wsl55c0x4ymkcnvq-cargo-package-hashlink-0.8.0 /nix/store/8rg8jz4nxl05mxfilxxr91m12fblxy0f-cargo-package-remove_dir_all-0.5.3 /nix/store/92n8p9kz64d926nsyxp2v5wqhsrqs8s2-cargo-package-lock_api-0.4.7 /nix/store/95p24qvbfrmf1ndc5c6ica23kmpziqzk-cargo-package-once_cell-1.13.0 /nix/store/972dq59321d1h1xzr6m766065xzfa98v-cargo-package-iana-time-zone-0.1.44 /nix/store/9jphwyj3pgn8nwg1xsbahx6p1adf0shz-cargo-package-version_check-0.9.4 /nix/store/9kbzfwxgq91x5cg7lfvjzchqbdy9gzln-cargo-package-axum-0.5.15 /nix/store/9pdicwb4a75r6x6i06g7pfd0npwsvdgr-cargo-package-dirs-sys-0.3.7 /nix/store/9q8i1yx9jgw923zp4vrd4v0pc08c3m6r-cargo-package-mio-0.8.4 /nix/store/9sw9rc0vl4jxysymi2ypc633zg8k51sb-cargo-package-percent-encoding-2.1.0 /nix/store/a25rbnln4l36jbcaiihyy42wrkpf044k-cargo-package-pin-project-internal-1.0.11 /nix/store/a29gzg1i5xwcmh7k7pym7zxaajkv2n4q-cargo-package-url-2.2.2 /nix/store/a6sp57hx5w0qpgqw6spnfcmskfcj1cvm-cargo-package-secrecy-0.8.0 /nix/store/a7p17wqxbyciiilwq7sdkpvs3a94jr9l-cargo-package-unicode-segmentation-1.9.0 /nix/store/a8y640s77z4s2b2zv6jvrsqknpj3n8ng-cargo-package-sqlx-rt-0.6.1 /nix/store/ak8afa90mw48jin8gvn654jzbbdczdif-cargo-package-web-sys-0.3.59 /nix/store/b65cqbics4ivq34lf5pqwsbdp4jhb1fp-cargo-package-block-buffer-0.10.2 /nix/store/b862q0qxgvjdvc3w16h7nb4xy665hrhv-cargo-package-getrandom-0.2.7 /nix/store/baj3qaw2f55vjdmsj2a46iyga1lbkw1z-cargo-package-ahash-0.7.6 /nix/store/bav2l95yl31dpz9z6n07ym242zmy57s1-cargo-package-bitflags-1.3.2 /nix/store/bk243s31zrlgzgg9ikb78dp9zg7pgqms-cargo-package-futures-intrusive-0.4.0 /nix/store/bmx7yd2bg9llbjv6s7bq2jd8hvbriccl-cargo-package-regex-1.6.0 /nix/store/brfyazqhaq8mr4b4mikwhp5np81439f1-cargo-package-ppv-lite86-0.2.16 /nix/store/c0gga2igwzg2iwpv15f7kdnb7l0m73iw-cargo-package-tinyvec_macros-0.1.0 /nix/store/c98n3ifn21wd5g44gsnayhbkk4wwvlwv-cargo-package-parking_lot-0.12.1 /nix/store/cba31l14xc1m8n76bxjlwbsc113sp1fy-cargo-package-futures-task-0.3.21 /nix/store/ccwc7k0bg1y42rdqh77p2pazyyvdb86l-cargo-package-hmac-0.12.1 /nix/store/cgnr2rhhqz98iw6cgyqr738cv4nwa0j0-cargo-package-windows_aarch64_msvc-0.36.1 /nix/store/cvw4ziyls1fkpb1r2flnjhgj23x29m01-cargo-package-webpki-0.22.0 /nix/store/cz4jn9pd4hz41ja6vsg5hlaym75piyhf-cargo-package-instant-0.1.12 /nix/store/d0qdby99xhhhj279slp9s4fdpax08s4h-cargo-package-dirs-4.0.0 /nix/store/d3zszpf41l7kwlnlsc0js3lzvnkpfanf-cargo-package-cc-1.0.73 /nix/store/d7wb87s6jmrf8d7bdlv6rjjy872q5hb7-cargo-package-idna-0.2.3 /nix/store/d9iw77mq6sddsjjl2gci3hl62bbrh6p0-cargo-package-nom-7.1.1 /nix/store/dba9y45v2i1186mf3v8jwcbva6xcx18b-cargo-package-matchit-0.5.0 /nix/store/dbixnf39diwj12grq6z3dziy4qcp3hqq-cargo-package-futures-io-0.3.21 /nix/store/djll0qnml986lws89f93cjzczzxl2z10-cargo-package-parking_lot_core-0.9.3 /nix/store/djzbyqlf06g4h6fyzhjvninyswd9xav3-cargo-package-wasm-bindgen-macro-support-0.2.82 /nix/store/dknd0mwlnavya38rfdnr9q1r20lscc7d-cargo-package-dashmap-4.0.2 /nix/store/dnjm9ca53rp45n6l3pig1akp5blsna60-cargo-package-crossbeam-channel-0.5.6 /nix/store/f9b66ih9i7w2pn65hhi1rzvdg43l4vxf-cargo-package-hex-0.4.3 /nix/store/fanwhgr320kx728kl5y2xk4anys3h7nh-cargo-package-hermit-abi-0.1.19 /nix/store/fb2wvzfn5l4kscqdz24121fpb1x8qqyz-cargo-package-tokio-util-0.7.3 /nix/store/fnifgymxswp35qm2jabhaf7qq2iy8nqf-cargo-package-base-x-0.2.11 /nix/store/fsrsx4r5hr0kscj68ljfw52k6anl2nzx-cargo-package-serde_derive-1.0.143 /nix/store/fyd4wzawcfg948kiwc5f0nakx04a92zn-cargo-package-axum-core-0.2.7 /nix/store/g3j4f81jhfr0wsj2r5z7db7svmil5dhr-cargo-package-bytes-1.2.1 /nix/store/gfmarjz9ia1wg5ddnwcw0ykx6nd0n15a-cargo-package-crossbeam-utils-0.8.11 /nix/store/gi37fl04rqdhs0akwfs27f9mia4a47ig-cargo-package-tower-http-0.3.4 /nix/store/giz0zjfkrnz2df2svkcgydkh81fyj7rv-cargo-package-prost-0.9.0 /nix/store/gj98cm9f01dvpi4f5kscgvzyaw3jh1s2-cargo-package-toml-0.5.9 /nix/store/gjy4ria5smwkllvh99wcaarmjwlaix5f-cargo-package-subtle-2.4.1 /nix/store/gmfb2aw4gfy6i2a595djfd78gwqpk2xg-cargo-package-sharded-slab-0.1.4 /nix/store/gqp0icmb7vz0lygq1bqpbqvzfb5ylxdq-cargo-package-sha2-0.10.2 /nix/store/gw11ixj525zb3pf59ybc0y6nfinjyklc-cargo-package-rand-0.8.5 /nix/store/h2rc98v40y1v24nyjv4yw4jppc7ahrpa-cargo-package-sqlx-core-0.6.1 /nix/store/h34srjafsvw870a6s68b4fcxwbsg7rnc-cargo-package-either-1.7.0 /nix/store/h4kq9mcf417qvhyam23735hzyapfik89-cargo-package-uuid-1.1.2 /nix/store/h8834d3rx088389npps7p76h6q57yhr6-cargo-package-windows_i686_msvc-0.36.1 /nix/store/h8h43cph3hl0f3dn5qrv153m9f4gylgm-cargo-package-redox_syscall-0.2.16 /nix/store/hrzn3xca6d4nnw9kx2qgj9s11yfk9r8q-cargo-package-parking_lot_core-0.8.5 /nix/store/hxm548klczvkj4n4r8jvsz35ray6z6pr-cargo-package-crc-catalog-2.1.0 /nix/store/hz62fklhcyqa3ga6sjd0kmwn7y5pdp78-cargo-package-rustls-0.20.6 /nix/store/i2l93111ysjc7mg70xl0l6krr2w02cxm-cargo-package-proc-macro2-1.0.43 /nix/store/i2n58pbp06yrpg59x0wkwk5lvclgmd14-cargo-package-socket2-0.4.4 /nix/store/i80chifd5x8ap9dj8xqda7kspc4pdmq4-cargo-package-want-0.3.0 /nix/store/i8aznvf6svp954ndyix3x4j9k3p7a6hz-cargo-package-pin-utils-0.1.0 /nix/store/ihmv8pll0z10k6hqjzzdi2dca7sy448r-cargo-package-windows_x86_64_msvc-0.36.1 /nix/store/ii6k2l28x2cvs88f93wfy325dqfadb5y-cargo-package-wasm-bindgen-shared-0.2.82 /nix/store/imxjpkpa2gwn1dfdcd4a7a2yf859yq6n-cargo-package-futures-channel-0.3.21 /nix/store/in6dcpgkh63wsp5m7bwz656sv6x5k9ri-cargo-package-fixedbitset-0.4.2 /nix/store/irrw3ch38darl4wyn63npcs6gwmcdhrh-cargo-package-memchr-2.5.0 /nix/store/j744r7a5zf09kb07dans8gqnavw8ql7p-cargo-package-futures-util-0.3.21 /nix/store/jay7qmnjqq9cqfyqj1qbpsy8h8nkv9ns-cargo-package-tracing-subscriber-0.3.15 /nix/store/jbclnj1liavhy1yb59kiibcz7wb1ybcz-cargo-package-thread_local-1.1.4 /nix/store/jd18qn8jx3aigh6yim172321mkcvqily-cargo-package-prost-derive-0.9.0 /nix/store/jg1z378q62ns7wxwh8iaq0zya3bcshk3-cargo-package-unicode-ident-1.0.3 /nix/store/jwprn09ra82bgcx3by84javg02bamzam-cargo-package-serde-1.0.143 /nix/store/jyqh3f1isfgrb0p017ywwrlqimzpxr2v-cargo-package-sync_wrapper-0.1.1 /nix/store/k2qssnmpx5fzdc8vjj9h4q2zds4gq9xf-cargo-package-rand_chacha-0.3.1 /nix/store/k3qzzj9f0baarfr89d9dv9xk40i4rn7b-cargo-package-tokio-macros-1.8.0 /nix/store/k3w5jq0v2aqyn0x9rdnpdfvrxi279fn4-cargo-package-generic-array-0.14.6 /nix/store/k75k57b502qijh6ahx4m4dxblf6kaz5q-cargo-package-core-foundation-sys-0.8.3 /nix/store/k7m54cxqw7zh3kb8va371j1blpdhr1w2-cargo-package-try-lock-0.2.3 /nix/store/kmwwa1gbn3d1agxrrlhm6bmk4vba0lw2-cargo-package-redox_users-0.4.3 /nix/store/kpf20vr3i31qc1dvwxxf7g5671gswz4c-cargo-package-winapi-x86_64-pc-windows-gnu-0.4.0 /nix/store/kqzzxyaqx6jy7s707lwp8f3rrshx0g0b-cargo-package-byteorder-1.4.3 /nix/store/ksgi1bqrr2pf9n5zqz6g275yz1l08hgv-cargo-package-sqlx-macros-0.6.1 /nix/store/kyj8jl5qw4ixbb9jwmvn0b8n3yrwfp9p-cargo-package-httpdate-1.0.2 /nix/store/kyqxrrj9579lmflcfidgzz8h7mriwq1c-cargo-package-sct-0.7.0 /nix/store/kzrjjjaasiz08xj1607kl74mj1l87d1j-cargo-package-libc-0.2.131 /nix/store/l23hc9mc6ymrq77dvfwg0j4d7nn54p36-cargo-package-tonic-0.6.2 /nix/store/l6sw8iv2syx8b5lhb7dqa88n8qk0z423-cargo-package-pin-project-lite-0.2.9 /nix/store/l9n8pgnpcmfi1vzc4rlm6aykjxglv1mj-cargo-package-rustls-0.19.1 /nix/store/l9xpibgx1ql852k6svwxi7171dj8pl50-cargo-package-http-range-header-0.3.0 /nix/store/la1qayscjr9wdvddxgl5asmxsqg4a22b-cargo-package-tokio-rustls-0.22.0 /nix/store/lbrryxk0frpi7vkxiz798h0w6cniszli-cargo-package-tracing-0.1.36 /nix/store/lc5vipn5lkwj43slpnh84jgkp97vipy6-cargo-package-heck-0.3.3 /nix/store/ldvnkv12as592m9jvw74pmi85i6wyd0z-cargo-package-thiserror-impl-1.0.32 /nix/store/lq0pqmhvc1f0d77cbgd034n5lgqpwzyc-cargo-package-serde_json-1.0.83 /nix/store/ls322d3bxy6drmhbp82r4wfq96k6kh4j-cargo-package-futures-0.3.21 /nix/store/lvlf1xn5xg0finap2swr1r9pqjp6z0sr-cargo-package-num-traits-0.2.15 /nix/store/lvvvalbhizsjx8fklfs82z6zxrbh03jz-cargo-package-untrusted-0.7.1 /nix/store/m0zcsjv1ckgnjz2s71d5c5nff096rliy-cargo-package-wasi-0.11.0+wasi-snapshot-preview1 /nix/store/m1l7mc65nank1kmiq4jdbznlmv1qgnkh-cargo-package-crossbeam-queue-0.3.6 /nix/store/m4af3ypfxllmq5636i8ykpjv154h1mpr-cargo-package-http-0.2.8 /nix/store/m9gqaz0ly00da4dkjhx6bga9bp8fnb89-cargo-package-tokio-rustls-0.23.4 /nix/store/md8pghg4hr3sczgkgzpxql6x63dhl2ab-cargo-package-hyper-timeout-0.4.1 /nix/store/mps2syk6rqn8mqlsxbzpf6myig3hh5fx-cargo-package-windows_i686_gnu-0.36.1 /nix/store/nbizgs21ffg2m1dsmvayhf57131619kl-cargo-package-config-0.13.2 /nix/store/nj2jmlwp3aijbvfk8aphkqnjnfw0303y-cargo-package-bumpalo-3.10.0 /nix/store/nyfskjcil4nrspri09mfma9wr3kfi4wg-cargo-package-regex-automata-0.1.10 /nix/store/p2fzm8mb52mwvhqj5xrip2lpz72qfh1i-cargo-package-cpufeatures-0.2.2 /nix/store/p3nm48rwh6n0cmzz1db49fjbwc64l9vq-cargo-package-sha-1-0.10.0 /nix/store/pbxa4pgc7if6qpkq6fqswcdwdpfvl3mz-cargo-package-tracing-opentelemetry-0.17.4 /nix/store/plrl7pahxvxk91pwirmifj9qblc08hxl-cargo-package-ring-0.16.20 /nix/store/pmdpxs37vkg8x1afypjay4d0zzgasy1g-cargo-package-tracing-log-0.1.3 /nix/store/ps9makph9k4qn8r2kq7fzfjrik9fkyy5-cargo-package-wasm-bindgen-backend-0.2.82 /nix/store/py6k2z2rka5ddss2gbh7i33zy8n1d2bc-cargo-package-unicode-bidi-0.3.8 /nix/store/qcg5pqlmcqfx3qc9l93rn6246c6zwwfr-cargo-package-windows_x86_64_gnu-0.36.1 /nix/store/qhj3fgxqfh0pxd0qx4znvlzjk9mhsw5n-cargo-package-multimap-0.8.3 /nix/store/ql84jyy7fanpwf5jzdpx00rgnjrhn7dk-cargo-package-scopeguard-1.1.0 /nix/store/qx0b4iyr9lpsdp1pc7nzmdz0862ka683-cargo-package-futures-sink-0.3.21 /nix/store/r0mwk59w6mf17nh3i3wxnaj46rmg62ah-cargo-package-prost-types-0.9.0 /nix/store/r36041g57qsm2yjbrh9127hvdjk3gj3l-cargo-package-tower-layer-0.3.1 /nix/store/r8j83qr1ach6xr0zdiyhg7nz9s0lnfdi-cargo-package-ansi_term-0.12.1 /nix/store/r9hnvr96h5azbvxpqfkj3ymd0sin8q0q-cargo-package-signal-hook-registry-1.4.0 /nix/store/rksf7mxzlsf00vyqhiaahb77drf727h2-cargo-package-hkdf-0.12.3 /nix/store/rlclyizazj193pyym3i52675qhhh21d8-cargo-package-hyper-0.14.20 /nix/store/rnrsjfb6r2zcvp90azxmhc0j6hbwj14l-cargo-package-time-0.1.44 /nix/store/rqa3d2zqc5jhx62ll327pm9l9phxgfkp-cargo-package-crypto-common-0.1.6 /nix/store/rrbirdbjxm3hivs1x66wdg6ffpqzfgx4-cargo-package-matches-0.1.9 /nix/store/sd0g4xa5y2ryp86i0ckmrpxcxhrhgypi-cargo-package-wasm-bindgen-0.2.82 /nix/store/vf92l1bbsa4hangmin35dznmhwrjs6lv-cargo-package-regex-syntax-0.6.27 /nix/store/vgkmpn5vvn6l99ghxgjkp5qz90alcl15-cargo-package-quote-1.0.21 /nix/store/w128k732blza1saglgqfa20d57f4p9j1-cargo-package-fnv-1.0.7 /nix/store/w7028a73i2sm2qvmgdr12x2qqh599fam-cargo-package-anyhow-1.0.61 /nix/store/wcz2c8n50crmnmgm8av3sx8gp8ai6r20-cargo-package-opentelemetry-otlp-0.10.0 /nix/store/wfbz1wp107wnkniiqv1vmq8qrx6pybzf-cargo-package-tracing-core-0.1.29 /nix/store/wjvn818ilnynx3xilgkdw79j26yapij4-cargo-package-minimal-lexical-0.2.1 /nix/store/wljkgmwin4cbsvgniwqwypkwji75vp5m-cargo-package-pathdiff-0.2.1 /nix/store/wlp1yh98l0kwpmnq1041l8asxjf1zwf0-cargo-package-base64-0.13.0 /nix/store/wnz2zv7qh50hadiz5xxg3pbpxjnlx62i-cargo-package-futures-core-0.3.21 /nix/store/wpy1bfbaj9zbbmrgsa9j7bh5cj7xaxcc-cargo-package-tracing-serde-0.1.3 /nix/store/ws7viiibzxvlv4k97v5p3bb8n33dnpiw-cargo-package-num_cpus-1.13.1 /nix/store/x0s280vs80h4bvdxs5ygfn9x58801f7d-cargo-package-rustls-pemfile-1.0.1 /nix/store/x0vcgs6ia2k8fxq97wnz152ag4rs8xsa-cargo-package-whoami-1.2.1 /nix/store/xbpb6pf98fpn7df3pyy7r78cxjdk41wa-cargo-package-petgraph-0.6.2 /nix/store/xfjgkhbzr2cszvl8pkywmd8yrsrg4d1p-cargo-package-tokio-io-timeout-1.2.0 /nix/store/xkww4ryksqbpa0zj08k7sp2wfqpk5crb-cargo-package-hashbrown-0.12.3 /nix/store/xnysj4rszdhpjip46rk2grd5kq8hv430-cargo-package-sct-0.6.1 /nix/store/xxv1cbz6ryxzwkyyfq8hakhm6fadbq0a-cargo-package-md-5-0.10.1 /nix/store/y523r7ww233y3bd3ha67gjqwi6ka3yy5-cargo-package-slab-0.4.7 /nix/store/y63vzdr13fyr1qxqi5zr29y6kcaqdsza-cargo-package-tokio-stream-0.1.9 /nix/store/yc32wdj7w7n8k0ipjy62f74v0r8yqql3-cargo-package-h2-0.3.13 /nix/store/yff36h95c136bqwmi6amsc2n5brzcc3m-cargo-package-heck-0.4.0 /nix/store/ykq47d0gdsc67ha0xvzk35b79d0qs0qx-cargo-package-event-listener-2.5.3 /nix/store/yn3pirkddz2lg8zdg7y3n6151a7czxm8-cargo-package-webpki-roots-0.22.4 /nix/store/yp3ad8g5pfslp7bxvfzvr09x668gmav3-cargo-package-log-0.4.17 /nix/store/ypj3sshn2fgx41mhpdlpm14lppi9iv5b-cargo-package-num-integer-0.1.45 /nix/store/yqyr5r0c3mkar1973x61qvc2swdjc9jw-cargo-package-form_urlencoded-1.0.1 /nix/store/yrazpg632l09dl3db4cknasl27ryxgzc-cargo-package-wasi-0.10.0+wasi-snapshot-preview1 /nix/store/yzkyzlkx7gwm61qf1krhqdlhqpljrqyd-cargo-package-serde_urlencoded-0.7.1 /nix/store/yzp4wn5kjry7qri1l2npkwr4jhaqdb26-cargo-package-itertools-0.10.3 /nix/store/z25a1634xiw0dd00rhwmnf5ywwynw3w6-cargo-package-stringprep-0.1.2 /nix/store/zdqw9cg4nj82crqdkwanni9vl5ky1cfj-cargo-package-crc-3.0.0 /nix/store/zfd46ycd7lhbb5ln611x0ircd9frr14a-cargo-package-valuable-0.1.0 /nix/store/zv1wjjgb9xgsy3ivqi1cfflmwb6cfqiw-cargo-package-chrono-0.4.22 /nix/store/zzkrs87x3a2n4d7x2jj3zrgij6p3w8vb-cargo-package-windows-sys-0.36.1 /nix/store/wnhmrwxwpy4ci6ndvkppm5z496hnx26i-vendor-registry /nix/store/i4rbvnvy4s0k78hjbnfacsxf7xhbjsbm-vendor-cargo-deps /nix/store/mii834bf617gfgzf2lrsilixc1q726ip-axum-rest-example-0.1.0 /nix/store/cah7gc1abrsagxyc5a1v00phf8znz990-axum-rest-example-conf.json /nix/store/cki6zalbpin96q7k33a1s26ffmbqvr4r-xz-5.2.5 /nix/store/cvjizmvf7bml9a9ppcbl4gxc2y8smbai-bzip2-1.0.6.0.2 /nix/store/gidv7w43ilgj22g1mkd3b9if5h4k0xgv-readline-6.3p08 /nix/store/iffl6dlplhv22i2xy7n1w51a5r631kmi-bash-5.1-p16 /nix/store/n83qx7m848kg51lcjchwbkmlgdaxfckf-tzdata-2022a /nix/store/nwf2y0nc48ybim56308cr5ccvwkabcqc-openssl-1.1.1q /nix/store/q8gnp7r8475p52k9gmdzsrcddw5hirbn-gdbm-1.23 /nix/store/qvv10nni6ya53k9gvybyw10kh6c380f2-mailcap-2.1.53 /nix/store/v3j1blvixih1gd29l8j1mxaf3v26cn2w-libffi-3.4.2 /nix/store/v92pzd7ln3nyvqrz9dzzf8mcfh8xnisp-expat-2.4.8 /nix/store/xpwwghl72bb7f48m51amvqiv1l25pa01-python3-3.9.13 /nix/store/dv5wgy8129chfgwswjfz9nz6ivmkyblw-stream /nix/store/93g9alqzh1gxfxzy6ahpqpwbky6jxizj-stream-axum-rest-example
Similarly, running nix build .#axum-rest-example && strings ./result/bin/axum-rest-example
shows references to /nix/store/i4rbvnvy4s0k78hjbnfacsxf7xhbjsbm-vendor-cargo-deps/c19b7c6f923b580ac259164a89f2577984ad5ab09ee9d583b888f934adbbe8d0/...
when it should instead contain strings to /sources/...
The current source prefix mapping sets the root of all directories which contains vendored sources, but apparently that isn't enough to make the remapping work, so we'll need to remap things multiple times
Ah I finally found the issue after banging my head for a few hours as to why I couldn't reproduce it as a test case within this repo:
The flake in question has a .cargo/config.toml
setting for rustflags
. It appears that cargo will give precedence to these flags instead of the CARGO_BUILD_RUSTFLAGS
environment variable we set. Commenting out the rustflags
configuration below breaks the Nix dependency to the crate's sources
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=lld"]
# nightly
# rustflags = ["-Clink-arg=-fuse-ld=lld", "-Zshare-generics=y"]
If we instead set RUSTFLAGS
it "fixes" the dependency issue, but has the effect of ignoring whatever flags the project may have configured in .cargo/config.toml
Perhaps we need to have another mechanism to do the source prefix remapping besides setting the rustc flag (maybe patching the binaries after the fact?)
Do you have any link at hand where I could read about what is actually going on here? It seems like Nix does some scanning of binaries to find dependencies of each binary?
Do you have any link at hand where I could read about what is actually going on here?
Did a quick search but I couldn't find a well documented place which explains this :(
It seems like Nix does some scanning of binaries to find dependencies of each binary?
Yep, this is exactly what Nix does in practice. If it finds any reference to /nix/store/<hash>-<package>/...
then it infers that the final binary depends on that store path. For interpreted languages this could be references to other code, or it could be shared libraries and so on