prefix-dev / pixi

Package management made easy
https://pixi.sh
BSD 3-Clause "New" or "Revised" License
3.02k stars 166 forks source link

Windows: A required privilege is not held by the client. #2151

Open certik opened 3 hours ago

certik commented 3 hours ago
~/repos/gui(master)$ pixi r build
✨ Pixi task (build): cmake -DCMAKE_BUILD_TYPE=Debug -B build && cd build && make
  ⠉ validate cache       [00:00:11] [━━━━━━━━━━━━━━━━╾───] python (+8)
  ⠒ download & extract   [00:00:11] [━───────────────────] 9.61 MiB @ 1005.06 KiB/s qt-webengine (+16)
  ⠋ installing packages  [00:00:10] [━━━━━━━━━━━╾────────]    36/65 libuv (+1)    × failed to fetch sysroot_linux-64-2.12-he073ed8_17.conda
  ├─▶ an io error occurred
  ├─▶ failed to unpack `\\?\C:
  │   \Users\ondrejcertik\AppData\Local\rattler\cache\pkgs\sysroot_linux-64-
  │   2.12-he073ed8_17\x86_64-conda-linux-gnu\sysroot\usr\lib64\librt.so`
  ╰─▶ A required privilege is not held by the client. (os error
      1314) when symlinking ../../lib64/librt.so.1 to \\?\C:
  ⠈ validate cache       [00:00:11] [━━━━━━━━━━━━━━━━╾───] python (+8)
  ⠒ download & extract   [00:00:11] [━───────────────────] 9.61 MiB @ 1005.06 KiB/s qt-webengine (+16)
$ cat pixi.toml
[project]
authors = ["Ondřej Čertík <ondrej@certik.us>"]
channels = ["conda-forge"]
description = "GUI test"
name = "gui"
platforms = ["linux-64", "win-64"]
version = "0.1.0"

[tasks]
build = "cmake -DCMAKE_BUILD_TYPE=Debug -B build && cd build && make"

[dependencies]
cxx-compiler = "1.8.0"
make = ">=4.4.1,<5"
cmake = ">=3.25.2,<4"
qt = ">=5.15.8,<6"
mesa-libgl-devel-cos6-x86_64 = ">=11.0.7,<12"
wolfv commented 3 hours ago

Do you really need the mesa library on windows? You could require it only on Linux. Otherwise you could enable dev mode for windows to allow symlinks.

Lastly we could experiment with "junctions" which I think are similar to symlinks but don't require elevated privileges. I need to read up on it.

certik commented 2 hours ago

Yes, I don't need it, I first got a Qt app working in linux where it is needed, then I was porting it to Windows and discovered the bug above. The solution is to not use it:

[target.linux-64.dependencies]
mesa-libgl-devel-cos6-x86_64 = ">=11.0.7,<12"

Then everything works. But I would think the error message should be improved:

  ╰─▶ A required privilege is not held by the client. (os error
      1314) when symlinking ../../lib64/librt.so.1 to \\?\C:

That seems hard to understand, like the path \\?\C:...