ugexe / zef

Raku Module Management
Artistic License 2.0
207 stars 44 forks source link

Couldn't upgrade zef on windows #490

Closed skaji closed 1 year ago

skaji commented 1 year ago

Context

I couldn't upgrade zef on windows.

Expected Behavior

I could upgrade zef on windows.

Actual Behavior

I couldn't upgrade zef on windows.

Steps to Reproduce

I prepared a github action that reproduce this problem:

name: test

on:
  push:

jobs:
  raku:
    strategy:
      fail-fast: false
      matrix:
        os:
          - ubuntu-latest
          - macos-latest
          - windows-latest
    runs-on: ${{ matrix.os }}
    steps:
      - uses: Raku/setup-raku@v1
      - run: zef upgrade --/test --trace zef

And the output of zef upgrade --/test --trace zef on windows is:

Run zef upgrade --/test --trace zef
  zef upgrade --/test --trace zef
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
===> Searching for: zef
===> Updating fez mirror: https://360.zef.pm/
===> Updated fez mirror: https://360.zef.pm/
===> Found: zef:ver<0.14.6>:auth<github:ugexe>:api<0> [via Zef::Repository::Ecosystems<rea>]
===> Updating rea mirror: https://raw.githubusercontent.com/Raku/REA/main/META.json
The following distributions will be upgraded: zef:ver<0.14.6>:auth<github:ugexe>:api<0>
===> Updated rea mirror: https://raw.githubusercontent.com/Raku/REA/main/META.json
===SORRY!=== Error while compiling D:\a\raku-Acme-Test-Module-Zef\raku-Acme-Test-Module-Zef/site#sources\DCB99ACA68D021919905AE60DA2201FDE0EB1A31 (Zef::CLI)

===> Updating: zef:ver<0.14.6>:auth<github:ugexe>:api<0>
at D:\a\raku-Acme-Test-Module-Zef\raku-Acme-Test-Module-Zef/site#sources\DCB99ACA68D021919905AE60DA2201FDE0EB1A31 (Zef::CLI):2
===> Fetching: https://raw.githubusercontent.com/raku/REA/main/archive/Z/zef/zef%3Aver%3C0.14.6%3E%3Aauth%3Cgithub%3Augexe%3E.tar.gz

[https://raw.githubusercontent.com/raku/REA/main/archive/Z/zef/zef%3Aver%3C0.14.6%3E%3Aauth%3Cgithub%3Augexe%3E.tar.gz] Fetching https://raw.githubusercontent.com/raku/REA/main/archive/Z/zef/zef%3Aver%3C0.14.6%3E%3Aauth%3Cgithub%3Augexe%3E.tar.gz with plugin: Zef::Service::Shell::curl+{<anon|1>}
===> Fetching [OK]: https://raw.githubusercontent.com/raku/REA/main/archive/Z/zef/zef%3Aver%3C0.14.6%3E%3Aauth%3Cgithub%3Augexe%3E.tar.gz to C:\Users\RUNNER~1\AppData\Local\Temp/.zef\1672744416.1228.5838.499920392934\zef%3Aver%3C0.14.6%3E%3Aauth%3Cgithub%3Augexe%3E.tar.gz
===> Extracting: https://raw.githubusercontent.com/raku/REA/main/archive/Z/zef/zef%3Aver%3C0.14.6%3E%3Aauth%3Cgithub%3Augexe%3E.tar.gz
[https://raw.githubusercontent.com/raku/REA/main/archive/Z/zef/zef%3Aver%3C0.14.6%3E%3Aauth%3Cgithub%3Augexe%3E.tar.gz] Extracting with plugin: Zef::Service::Shell::tar+{<anon|1>}
===> Extraction [OK]: https://raw.githubusercontent.com/raku/REA/main/archive/Z/zef/zef%3Aver%3C0.14.6%3E%3Aauth%3Cgithub%3Augexe%3E.tar.gz to C:\Users\RUNNER~1\AppData\Local\Temp/.zef\zef%3Aver%3C0.14.6%3E%3Aauth%3Cgithub%3Augexe%3E.tar.gz
===> Dependencies: NativeCall
===> CompUnit::Repository install target is valid: C:\hostedtoolcache\windows\rakudo\2022.12-01\x86_64\share\perl6\site
===> Filtering: zef:ver<0.14.6>:auth<github:ugexe>:api<0>
===> Filtering [OK] for zef:ver<0.14.6>:auth<github:ugexe>:api<0>
===> # SKIP: No need to build zef:ver<0.14.6>:auth<github:ugexe>:api<0>
===> Installing: zef:ver<0.14.6>:auth<github:ugexe>:api<0>
[zef] Installing with plugin: Zef::Service::InstallRakuDistribution+{<anon|1>}
===> Install [FAIL] for zef:ver<0.14.6>:auth<github:ugexe>:api<0>: ===SORRY!=== Error while compiling D:\a\raku-Acme-Test-Module-Zef\raku-Acme-Test-Module-Zef/site#sources\DCB99ACA68D021919905AE60DA2201FDE0EB1A31 (Zef::CLI)

at D:\a\raku-Acme-Test-Module-Zef\raku-Acme-Test-Module-Zef/site#sources\DCB99ACA68D021919905AE60DA2201FDE0EB1A31 (Zef::CLI):2

!!!> Failed upgrading *all* modules
Error: Process completed with exit code 1.

links:

Your Environment

raku version 2022.12

ugexe commented 1 year ago

In this case it is rakudo itself that is failing. zef calls CompUnit::Repository::Installation.install(...), which is failing when it tries to precompile for whatever reason. zef upgrade works on other distributions (according to appveyor) which might hint at a root cause (such as rakudo trying to delete/write to an existing zef precomp file that is loaded into memory already, something windows handles differently than other OS) -- this could be tested by seeing if zef upgrade works on a module that wouldn't also be loaded when zef is trying to upgrade it (TAP::Harness might be a bad choice, since it would be loaded for running tests). Another way to test would be to clone zef to a directory and run raku -I. bin/zef upgrade zef which wouldn't load the installed files into memory (I do something similar for the gh action I've been trying to get working via https://github.com/ugexe/zef/actions/runs/3783050969/workflow#L18-L19 )

fwiw I've been trying to get a gh action working using zefs current t/ and CI tests, but the windows VM fails consistently at different points in the process. So it is also a good data point to know if these types of failures are only occuring for github actions.

skaji commented 1 year ago

It seems that this is an issue for rakudo, not zef. So I close this issue.