Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysinfo broken on apple x86_64 with apple sdk 10 #915

Closed
DavHau opened this issue Jan 15, 2023 · 5 comments
Closed

sysinfo broken on apple x86_64 with apple sdk 10 #915

DavHau opened this issue Jan 15, 2023 · 5 comments
Labels

Comments

@DavHau
Copy link

DavHau commented Jan 15, 2023

Since this PR sysinfo is broken on macos x86_64 with apple sdk 10 (10.12 in my case):

sysinfo>           Undefined symbols for architecture x86_64:
sysinfo>             "_kCFURLVolumeAvailableCapacityForImportantUsageKey", referenced from:
sysinfo>                 _$LT$sysinfo..apple..disk..Disk$u20$as$u20$sysinfo..traits..DiskExt$GT$::refresh::h4315b636d597f960 in sysinfo-914f7d6a1f46d685.sysinf
o.c048b213-cgu.9.rcgu.o
sysinfo>                 sysinfo::apple::disk::get_disks::h93688aba489db381 in sysinfo-914f7d6a1f46d685.sysinfo.c048b213-cgu.9.rcgu.o
sysinfo>                 sysinfo::apple::disk::get_available_volume_space::h96cd83f2d4965573 in sysinfo-914f7d6a1f46d685.sysinfo.c048b213-cgu.9.rcgu.o
sysinfo>           ld: symbol(s) not found for architecture x86_64
sysinfo>           clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
sysinfo>
sysinfo> error: could not compile `sysinfo` due to previous error
error: builder for '/nix/store/2x5ascig10sywii4n38n710fh6gv2749-sysinfo-0.26.6.drv' failed with exit code 101;

Upgrading the apple sdk to version 11 fixes the problem.
The latest sysinfo release which still works with apple sdk 10 is 0.26.6.

@DrewMcArthur
Copy link

it might be worth noting, i only get this error running cargo test from within a nix-shell. i can cargo build && cargo test in my normal shell, (and it fails some environment tests in process.rs), and i can cargo build in the nix shell, but running cargo test gives me the same error as above.

let me know what other info would be helpful to have - i'm running macOS 12.6.2, nix-shell --version 2.11.1, rustc 1.66.0 (69f9c33d7 2022-12-12).

[nix-shell:~/coding/holochain-workspace/sysinfo]$ cargo build
    Finished dev [unoptimized + debuginfo] target(s) in 0.16s

[nix-shell:~/coding/holochain-workspace/sysinfo]$ cargo test
   Compiling sysinfo v0.27.6 (/Users/drew/coding/holochain-workspace/sysinfo)
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-arch" "x86_64" "-m64" "/tmp/tmp.KomCdgPfNJ/rustc59prHg/symbols.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06.1hpzdeq5ujbaiw84.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06.1qwmun41rvgcdu57.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06.29lvqnvz8hu4b2e3.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06.2eahvzl9eobt4o9v.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06.2mkxqoqd9hzcvv0d.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06.2o2zoiui7hedk4cf.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06.2r4url5fd4cutrot.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06.3dk5nkw9kwb7gmba.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06.kptes03c7tiuvef.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06.qw7lzpytvschkzw.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06.b6pfqwpvyi6wc22.rcgu.o" "-L" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps" "-L" "/nix/store/bb9j5l16j08cml40315dbb1pb6s2lq5k-rust-default-1.66.0/lib/rustlib/x86_64-apple-darwin/lib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libsysinfo.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/librayon-cc0529c2b24bcecc.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/librayon_core-a51815c0c9610976.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libnum_cpus-8887508434380ff8.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_deque-12d28d63c2815694.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_epoch-42b58ad56af0c3e3.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libmemoffset-e4315cab93c025ac.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libscopeguard-cd38da4e752b2cc5.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_channel-290c0ede9aef6209.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_utils-9decde4fa8c9882b.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libeither-2ac6d8e7583a9e9a.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/liblibc-688ab1fe8887d9e0.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcore_foundation_sys-05211128d981c9ae.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcfg_if-d85d9ec5782669b6.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libtest-99656c4366ed9298.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgetopts-f710087ea8b75a8e.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunicode_width-5f0026737698e726.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_std-d9c69185cc67da33.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-1a5555b33819f218.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-ad99943b3883262b.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-a034deb45cc53e74.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-5e0e57a3a2ab4c68.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-a8b87451901f6fdc.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-db96873d4b416987.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-f8dbba2e7fbd68fd.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-20f19fb0dc9ecd78.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-5fb1f09292aa40d3.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-69d352e9fa2aef8f.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-535415c0ec18a02d.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-68cad48883deb04b.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-e1381b59b4674059.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-bc9862af3dc33a8d.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-1aef678a4ef17b83.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-89dbd1bc070dbc89.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-2fcbf12f2f01bcfd.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-e9b2cab01a77c8cc.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-15a328b5c9f2daf6.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-bda477245996038f.rlib" "-framework" "IOKit" "-framework" "CoreFoundation" "-liconv" "-framework" "CoreFoundation" "-lSystem" "-lc" "-lm" "-L" "/nix/store/bb9j5l16j08cml40315dbb1pb6s2lq5k-rust-default-1.66.0/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/disk_list-c18615053c815a06" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: Undefined symbols for architecture x86_64:
            "_kCFURLVolumeAvailableCapacityForImportantUsageKey", referenced from:
                _$LT$sysinfo..apple..disk..Disk$u20$as$u20$sysinfo..traits..DiskExt$GT$::refresh::hc63e6e78ea9281cf in libsysinfo.rlib(sysinfo.2e8osl4efngheaa8.rcgu.o)
                sysinfo::apple::disk::get_disks::h081f36dd605be9d7 in libsysinfo.rlib(sysinfo.2e8osl4efngheaa8.rcgu.o)
                sysinfo::apple::disk::get_available_volume_space::h528ff5a28f34e278 in libsysinfo.rlib(sysinfo.2e8osl4efngheaa8.rcgu.o)
          ld: symbol(s) not found for architecture x86_64
          clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-arch" "x86_64" "-m64" "/tmp/tmp.KomCdgPfNJ/rustcUflZ9d/symbols.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b.12m596ftyyzf9ocx.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b.1f89d9p0i6ivvi9s.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b.1wiw08woz89gdhuj.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b.2fmb2sodx5ot2s6a.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b.3lbt2mmhw7uvtcu9.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b.3n4uv6ny7aem96ps.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b.4l49l9z3cla94uzg.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b.59g9hjb52xaa4qit.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b.5dnvgk8wxfxm9hgj.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b.8iy4nkib5tk3x07.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b.25hwtwci8oqwej2p.rcgu.o" "-L" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps" "-L" "/nix/store/bb9j5l16j08cml40315dbb1pb6s2lq5k-rust-default-1.66.0/lib/rustlib/x86_64-apple-darwin/lib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libsysinfo.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/librayon-cc0529c2b24bcecc.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/librayon_core-a51815c0c9610976.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libnum_cpus-8887508434380ff8.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_deque-12d28d63c2815694.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_epoch-42b58ad56af0c3e3.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libmemoffset-e4315cab93c025ac.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libscopeguard-cd38da4e752b2cc5.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_channel-290c0ede9aef6209.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_utils-9decde4fa8c9882b.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libeither-2ac6d8e7583a9e9a.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/liblibc-688ab1fe8887d9e0.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcore_foundation_sys-05211128d981c9ae.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcfg_if-d85d9ec5782669b6.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libtest-99656c4366ed9298.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgetopts-f710087ea8b75a8e.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunicode_width-5f0026737698e726.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_std-d9c69185cc67da33.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-1a5555b33819f218.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-ad99943b3883262b.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-a034deb45cc53e74.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-5e0e57a3a2ab4c68.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-a8b87451901f6fdc.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-db96873d4b416987.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-f8dbba2e7fbd68fd.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-20f19fb0dc9ecd78.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-5fb1f09292aa40d3.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-69d352e9fa2aef8f.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-535415c0ec18a02d.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-68cad48883deb04b.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-e1381b59b4674059.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-bc9862af3dc33a8d.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-1aef678a4ef17b83.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-89dbd1bc070dbc89.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-2fcbf12f2f01bcfd.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-e9b2cab01a77c8cc.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-15a328b5c9f2daf6.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-bda477245996038f.rlib" "-framework" "IOKit" "-framework" "CoreFoundation" "-liconv" "-framework" "CoreFoundation" "-lSystem" "-lc" "-lm" "-L" "/nix/store/bb9j5l16j08cml40315dbb1pb6s2lq5k-rust-default-1.66.0/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/cpu-a76e580e93fafb5b" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: Undefined symbols for architecture x86_64:
            "_kCFURLVolumeAvailableCapacityForImportantUsageKey", referenced from:
                _$LT$sysinfo..apple..disk..Disk$u20$as$u20$sysinfo..traits..DiskExt$GT$::refresh::hc63e6e78ea9281cf in libsysinfo.rlib(sysinfo.2e8osl4efngheaa8.rcgu.o)
                sysinfo::apple::disk::get_disks::h081f36dd605be9d7 in libsysinfo.rlib(sysinfo.2e8osl4efngheaa8.rcgu.o)
                sysinfo::apple::disk::get_available_volume_space::h528ff5a28f34e278 in libsysinfo.rlib(sysinfo.2e8osl4efngheaa8.rcgu.o)
          ld: symbol(s) not found for architecture x86_64
          clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `sysinfo` due to previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `sysinfo` due to previous error
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-arch" "x86_64" "-m64" "/tmp/tmp.KomCdgPfNJ/rustc1j4VQN/symbols.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8.14s63i7u9oe3sh2a.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8.17vewsik4zw1wbeq.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8.1rsht72tl4mw42fz.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8.352wrtsgwp3w9q67.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8.3t3uu3vh08wmnvda.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8.4h3wt42cctb6kovn.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8.51lqk4ergye5fmp4.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8.g9e8kf15lnl0nuq.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8.pbembidzgv27s1t.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8.qvvp1wjzsbzbn53.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8.2adef4iqog90kfjm.rcgu.o" "-L" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps" "-L" "/nix/store/bb9j5l16j08cml40315dbb1pb6s2lq5k-rust-default-1.66.0/lib/rustlib/x86_64-apple-darwin/lib" "-framework" "IOKit" "-framework" "CoreFoundation" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/librayon-cc0529c2b24bcecc.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/librayon_core-a51815c0c9610976.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libnum_cpus-8887508434380ff8.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_deque-12d28d63c2815694.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_epoch-42b58ad56af0c3e3.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libmemoffset-e4315cab93c025ac.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libscopeguard-cd38da4e752b2cc5.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_channel-290c0ede9aef6209.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_utils-9decde4fa8c9882b.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libeither-2ac6d8e7583a9e9a.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/liblibc-688ab1fe8887d9e0.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libtest-99656c4366ed9298.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgetopts-f710087ea8b75a8e.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunicode_width-5f0026737698e726.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_std-d9c69185cc67da33.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcore_foundation_sys-05211128d981c9ae.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcfg_if-d85d9ec5782669b6.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-1a5555b33819f218.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-ad99943b3883262b.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-a034deb45cc53e74.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-5e0e57a3a2ab4c68.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-a8b87451901f6fdc.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-db96873d4b416987.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-f8dbba2e7fbd68fd.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-20f19fb0dc9ecd78.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-5fb1f09292aa40d3.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-69d352e9fa2aef8f.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-535415c0ec18a02d.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-68cad48883deb04b.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-e1381b59b4674059.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-bc9862af3dc33a8d.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-1aef678a4ef17b83.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-89dbd1bc070dbc89.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-2fcbf12f2f01bcfd.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-e9b2cab01a77c8cc.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-15a328b5c9f2daf6.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-bda477245996038f.rlib" "-liconv" "-framework" "CoreFoundation" "-lSystem" "-lc" "-lm" "-L" "/nix/store/bb9j5l16j08cml40315dbb1pb6s2lq5k-rust-default-1.66.0/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/sysinfo-6af3abdb78801ae8" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: Undefined symbols for architecture x86_64:
            "_kCFURLVolumeAvailableCapacityForImportantUsageKey", referenced from:
                _$LT$sysinfo..apple..disk..Disk$u20$as$u20$sysinfo..traits..DiskExt$GT$::refresh::hb35175787d9a9eb6 in sysinfo-6af3abdb78801ae8.4h3wt42cctb6kovn.rcgu.o
                sysinfo::apple::disk::get_disks::h2f618e456acd75d1 in sysinfo-6af3abdb78801ae8.4h3wt42cctb6kovn.rcgu.o
                sysinfo::apple::disk::get_available_volume_space::hc5e1e886d354bf80 in sysinfo-6af3abdb78801ae8.4h3wt42cctb6kovn.rcgu.o
          ld: symbol(s) not found for architecture x86_64
          clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `sysinfo` due to previous error
error: linking with `cc` failed: exit status: 1
  |
  = note: "cc" "-arch" "x86_64" "-m64" "/tmp/tmp.KomCdgPfNJ/rustcR9pA8j/symbols.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141.15wecf05qwdfj8b7.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141.2dj0wrd8u2r58lml.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141.2zyytlzgbvbunofc.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141.3hpeoo628f0m9tnq.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141.3q3eccvh05o8v1qp.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141.44qiiqm7hde3gu5x.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141.5cvah6pesqm78a04.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141.tydob365kvlbojg.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141.ybu5b6v4m7l8cr5.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141.z0sdo0bwehhfmc3.rcgu.o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141.4y6i3q2gkfwdyez3.rcgu.o" "-L" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps" "-L" "/nix/store/bb9j5l16j08cml40315dbb1pb6s2lq5k-rust-default-1.66.0/lib/rustlib/x86_64-apple-darwin/lib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libtest-99656c4366ed9298.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgetopts-f710087ea8b75a8e.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunicode_width-5f0026737698e726.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_std-d9c69185cc67da33.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libsysinfo.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/librayon-cc0529c2b24bcecc.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/librayon_core-a51815c0c9610976.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libnum_cpus-8887508434380ff8.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_deque-12d28d63c2815694.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_epoch-42b58ad56af0c3e3.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libmemoffset-e4315cab93c025ac.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libscopeguard-cd38da4e752b2cc5.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_channel-290c0ede9aef6209.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcrossbeam_utils-9decde4fa8c9882b.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libeither-2ac6d8e7583a9e9a.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/liblibc-688ab1fe8887d9e0.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcore_foundation_sys-05211128d981c9ae.rlib" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/libcfg_if-d85d9ec5782669b6.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd-1a5555b33819f218.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-ad99943b3883262b.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libobject-a034deb45cc53e74.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libmemchr-5e0e57a3a2ab4c68.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-a8b87451901f6fdc.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libgimli-db96873d4b416987.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-f8dbba2e7fbd68fd.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libstd_detect-20f19fb0dc9ecd78.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-5fb1f09292aa40d3.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-69d352e9fa2aef8f.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libminiz_oxide-535415c0ec18a02d.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libadler-68cad48883deb04b.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-e1381b59b4674059.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libunwind-bc9862af3dc33a8d.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-1aef678a4ef17b83.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liblibc-89dbd1bc070dbc89.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/liballoc-2fcbf12f2f01bcfd.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-e9b2cab01a77c8cc.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcore-15a328b5c9f2daf6.rlib" "/nix/store/bkxwz9sl913zslcl1hwdizkg27c0sryk-rust-std-1.66.0-x86_64-apple-darwin/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-bda477245996038f.rlib" "-framework" "IOKit" "-framework" "CoreFoundation" "-liconv" "-framework" "CoreFoundation" "-lSystem" "-lc" "-lm" "-L" "/nix/store/bb9j5l16j08cml40315dbb1pb6s2lq5k-rust-default-1.66.0/lib/rustlib/x86_64-apple-darwin/lib" "-o" "/Users/drew/coding/holochain-workspace/holochain/target/debug/deps/process-c7d4f2bc1363c141" "-Wl,-dead_strip" "-nodefaultlibs"
  = note: Undefined symbols for architecture x86_64:
            "_kCFURLVolumeAvailableCapacityForImportantUsageKey", referenced from:
                _$LT$sysinfo..apple..disk..Disk$u20$as$u20$sysinfo..traits..DiskExt$GT$::refresh::hc63e6e78ea9281cf in libsysinfo.rlib(sysinfo.2e8osl4efngheaa8.rcgu.o)
                sysinfo::apple::disk::get_disks::h081f36dd605be9d7 in libsysinfo.rlib(sysinfo.2e8osl4efngheaa8.rcgu.o)
                sysinfo::apple::disk::get_available_volume_space::h528ff5a28f34e278 in libsysinfo.rlib(sysinfo.2e8osl4efngheaa8.rcgu.o)
          ld: symbol(s) not found for architecture x86_64
          clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
          

error: could not compile `sysinfo` due to previous error

@DrewMcArthur
Copy link

DrewMcArthur commented Jan 17, 2023

so the above error is when i was using the nix-shell environment from our holochain repo - another project depending on this one. I was able to get sys info building and testing ($ cargo build && cargo test) with the following in a shell.nix config file

{ pkgs ? import <nixpkgs> {} }:
  pkgs.mkShell {
    nativeBuildInputs = [ 
        pkgs.darwin.IOKit 
        pkgs.libiconv
        pkgs.darwin.apple_sdk_11_0.frameworks.CoreFoundation
    ];
}

so then the question for @DavHau is why the nix config in the holochain repo doesn't have these pieces loaded correctly. but that applies more to holochain#1764 than this issue.

also wrote this quick unit test to confirm that the specific macOS corefoundation constant causing the issue works within the above nix config - it does

use sysinfo::DiskExt;
use sysinfo::SystemExt;

#[test]
fn test_get_available_volume_space() {
  if sysinfo::System::IS_SUPPORTED {
    let s = &mut sysinfo::System::new_all();
    for disk in s.disks_mut() {
      disk.refresh();
      assert!(disk.available_space() > 0);
    }
  }
}

@GuillaumeGomez
Copy link
Owner

Seems like it's an issue outside of sysinfo scope. Closing then.

@jason-ni
Copy link

Seems like it's an issue outside of sysinfo scope. Closing then.

I would be greatly appreciated if sysinfo could support outdated macos. The "AvailableCapacityForImportantUsage" call is only available in macos 10.13. https://developer.apple.com/documentation/corefoundation/kcfurlvolumeavailablecapacityforimportantusagekey.

I commented out the usage of kCFURLVolumeAvailableCapacityForImportantUsageKey in the "src/apple/disk.rs" and "src/apple/ffi.rs", then got my project compiled.

In the "get_available_volume_space" function code, I see, in the comment, you prefer "AvailableCapacityForImportantUsage" over "AvailableCapacity". I guess there's a better way to fallback to use old "kCFURLVolumeAvailableCapacityKey" according to the macos version.

@GuillaumeGomez
Copy link
Owner

PRs are welcome. But it'll also require a CI to ensure this breakage doesn't happen again too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants