[PATCH] D127938: Update Windows packaging script.

Hans Wennborg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 21 05:35:22 PDT 2022


hans added a comment.

> 1. Use the existing script but restoring the deleted packaging step.

Do you mean the repackaging? If so, I'd prefer that to be behind a flag, which means we'd need flag processing first.

> Including a solution for the admin permissions.

I've added a comment about that above.

> 2. Refactor the build and test steps into functions. Using current directory as output location. No additional command lines.
> 3. Add cmdline options to select the build, test and package steps.
> 4. Add cmdline options to select output directory, log filename.
> 5. Add cmdline options to extend the input branch to include any random branch/sha/tag.



================
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:
> > > 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?


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

https://reviews.llvm.org/D127938



More information about the llvm-commits mailing list