[PATCH] D127938: Update Windows packaging script.

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 27 08:12:36 PDT 2022


hans added inline comments.


================
Comment at: llvm/utils/release/build_llvm_release.bat:6
+REM
+REM Run the script with administrator permissions.
+if not exist %SYSTEMROOT%\SYSTEM32\WDI\LOGFILES (
----------------
CarlosAlbertoEnciso wrote:
> hans wrote:
> > CarlosAlbertoEnciso wrote:
> > > hans wrote:
> > > > CarlosAlbertoEnciso wrote:
> > > > > thieta wrote:
> > > > > > CarlosAlbertoEnciso wrote:
> > > > > > > hans wrote:
> > > > > > > > Wait, what? This seems undesirable.
> > > > > > > Running the script from a standard DOS prompt, I get the following errors:
> > > > > > > 
> > > > > > > 
> > > > > > > ```
> > > > > > > ...
> > > > > > > 7-Zip 21.06 (x64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-11-24
> > > > > > > 
> > > > > > > Scanning the drive for archives:
> > > > > > > 1 file, 223803667 bytes (214 MiB)
> > > > > > > 
> > > > > > > Extracting archive: src.zip
> > > > > > > --
> > > > > > > Path = src.zip
> > > > > > > Type = zip
> > > > > > > ...
> > > > > > > ERROR: Cannot create symbolic link : A required privilege is not held by the client. : .\llvm-project-main\libclc\clspv64
> > > > > > > ERROR: Cannot create symbolic link : A required privilege is not held by the client. : .\llvm-project-main\libcxx\test\std\pstl
> > > > > > > ERROR: Cannot create symbolic link : A required privilege is not held by the client. : .\llvm-project-main\openmp\tools\analyzer\llvm-openmp-analyzer++
> > > > > > > 
> > > > > > > Sub items Errors: 17
> > > > > > > 
> > > > > > > Archives with Errors: 1
> > > > > > > 
> > > > > > > Sub items Errors: 17
> > > > > > > ```
> > > > > > > May be the configuration we use is incorrect.
> > > > > > symlinks requires admin rights on windows unfortunately. But I have never seen this - so it has to be some place where it conditions the symlinking?
> > > > > Removed the administrator check. I am assumming it is my local configuration.
> > > > Some searching suggests this may be to due to 7zip's behaviour having changed in recent versions. I'm using 18.05 which is probably old by now, but doesn't seem to have this problem.
> > > I am using `7-Zip 21.06 (x64)`.
> > The behaviour that changed is that older 7zip seems to simply not handle symlinks in zip archives (at least on Windows). If there's a symlink foo -> bar in the archive, it will just create a file "foo" with the contents "bar".  And it seems the symlinks were not important enough to break the tests.
> > 
> > I haven't bisected the exact 7zip version where this changed.
> > 
> > These are the symlinks currently in the repository:
> > 
> > ```
> > $ wget https://github.com/llvm/llvm-project/archive/refs/heads/main.zip
> > $ zipinfo main.zip | grep '^l'
> > lrwxrwxrwx  2.3 unx       24 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/CUDA-symlinks/usr/bin/ptxas
> > lrwxrwxrwx  2.3 unx       30 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/i386-unknown-linux-gnu-ld
> > lrwxrwxrwx  2.3 unx       32 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/basic_cross_linux_tree/usr/bin/x86_64-unknown-linux-gnu-ld
> > lrwxrwxrwx  2.3 unx        7 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/basic_cross_linux_tree/usr/i386-unknown-linux-gnu/bin/ld
> > lrwxrwxrwx  2.3 unx        7 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld
> > lrwxrwxrwx  2.3 unx       25 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/as
> > lrwxrwxrwx  2.3 unx       25 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/multilib_32bit_linux_tree/usr/bin/ld
> > lrwxrwxrwx  2.3 unx       35 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/as
> > lrwxrwxrwx  2.3 unx       35 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/multilib_32bit_linux_tree/usr/i386-unknown-linux/bin/ld
> > lrwxrwxrwx  2.3 unx       27 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/as
> > lrwxrwxrwx  2.3 unx       27 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/multilib_64bit_linux_tree/usr/bin/ld
> > lrwxrwxrwx  2.3 unx       37 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/as
> > lrwxrwxrwx  2.3 unx       37 tx stor 22-Jun-21 14:24 llvm-project-main/clang/test/Driver/Inputs/multilib_64bit_linux_tree/usr/x86_64-unknown-linux/bin/ld
> > lrwxrwxrwx  2.3 unx       13 tx stor 22-Jun-21 14:24 llvm-project-main/libclc/amdgcn-mesa3d
> > lrwxrwxrwx  2.3 unx        5 tx stor 22-Jun-21 14:24 llvm-project-main/libclc/clspv64
> > lrwxrwxrwx  2.3 unx       22 tx stor 22-Jun-21 14:24 llvm-project-main/libcxx/test/std/pstl
> > lrwxrwxrwx  2.3 unx       20 tx stor 22-Jun-21 14:24 llvm-project-main/openmp/tools/analyzer/llvm-openmp-analyzer++
> > ```
> > 
> > Perhaps we should ask users of this script to use the old 7zip version, or point out that users of newer versions will need to run as administrator? Perhaps only the 7zip part could be run as admin?
> In relation to the 7zip versions with the symbolic links issue:
> 19.00 works
> 20.02 works
> 21.07 Fails
> 22.00 Fails
> 
> Perhaps this should be the first patch and decide on:
> 1) Check the 7zip version and ask the user to use an older version or run the script as administrator
> or
> 2) Run the 7zip part as administrator.
> 
Thanks for investigating. We already require pretty specific versions of tools in this script, so maybe we could suggest a specific version of 7zip (and tell people to run the script as admin otherwise).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127938/new/

https://reviews.llvm.org/D127938



More information about the llvm-commits mailing list