1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-12-22 17:01:08 +01:00

nix: don't require ln to build libstore

This commit is contained in:
eveeifyeve 2025-12-16 08:28:00 +11:00
parent 8e044f1ed0
commit 832b81761e

View file

@ -39,28 +39,32 @@ deps_public_maybe_subproject = [
] ]
subdir('nix-meson-build-support/subprojects') subdir('nix-meson-build-support/subprojects')
run_command( can_link_symlink = false
'ln', native_ln = find_program('ln', required : false, native : true)
'-s', if native_ln.found()
meson.project_build_root() / '__nothing_link_target', run_command(
meson.project_build_root() / '__nothing_symlink', native_ln,
# native doesn't allow dangling symlinks, which the tests require '-s',
env : {'MSYS' : 'winsymlinks:lnk'}, meson.project_build_root() / '__nothing_link_target',
check : true, meson.project_build_root() / '__nothing_symlink',
) # native doesn't allow dangling symlinks, which the tests require
can_link_symlink = run_command( env : {'MSYS' : 'winsymlinks:lnk'},
'ln', check : true,
meson.project_build_root() / '__nothing_symlink', )
meson.project_build_root() / '__nothing_hardlink', can_link_symlink = run_command(
check : false, native_ln,
).returncode() == 0 meson.project_build_root() / '__nothing_symlink',
run_command( meson.project_build_root() / '__nothing_hardlink',
'rm', check : false,
'-f', ).returncode() == 0
meson.project_build_root() / '__nothing_symlink', run_command(
meson.project_build_root() / '__nothing_hardlink', 'rm',
check : true, '-f',
) meson.project_build_root() / '__nothing_symlink',
meson.project_build_root() / '__nothing_hardlink',
check : true,
)
endif
summary('can hardlink to symlink', can_link_symlink, bool_yn : true) summary('can hardlink to symlink', can_link_symlink, bool_yn : true)
configdata_priv.set('CAN_LINK_SYMLINK', can_link_symlink.to_int()) configdata_priv.set('CAN_LINK_SYMLINK', can_link_symlink.to_int())