Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix packaging on windows (documentation and file path limit) #4134

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Simon-Laux
Copy link
Member

@Simon-Laux Simon-Laux commented Sep 14, 2024

  • there is a new step before running pnpm run pack: pnpm pack:patch-node-modules (I added that to the documentation
  • and there was the window path length limit that I ran into, added a note about it in docs and set a configuration variable to limit path length generated by pnpm internally to make the issue less likely.

@maxphilippov
Copy link
Collaborator

maxphilippov commented Sep 15, 2024

I saw there was a CI Problem, but I have some other trouble on local Windows 10 machine (I did follow the DEVELOPMENT.md instructions from this branch):

PS C:\dev\deltachat-desktop\packages\target-electron> pnpm pack:win

> @deltachat-desktop/target-electron@1.46.2-monorepo pack:win C:\dev\deltachat-desktop\packages\target-electron
> electron-builder --config ./electron-builder.json5 --win nsis portable

  • electron-builder  version=24.13.3 os=10.0.19045
  • loaded configuration  file=C:\dev\deltachat-desktop\packages\target-electron\electron-builder.json5
  • writing effective config  file=dist\builder-effective-config.yaml
  • packaging       platform=win32 arch=x64 electron=32.0.2 appOutDir=dist\win-unpacked
{
  context: {
    appOutDir: 'C:\\dev\\deltachat-desktop\\packages\\target-electron\\dist\\win-unpacked',
    outDir: 'C:\\dev\\deltachat-desktop\\packages\\target-electron\\dist',
    arch: 1,
    targets: [ [NsisTarget], [NsisTarget] ],
    packager: WinPackager {
      info: [Packager],
      platform: [Platform],
      _resourceList: [Lazy],
      platformSpecificBuildOptions: [Object],
      appInfo: [AppInfo],
      cscInfo: [Lazy],
      _iconPath: [Lazy],
      vm: [Lazy],
      computedPublisherName: [Lazy],
      lazyCertInfo: [Lazy]
    },
    electronPlatformName: 'win32'
  },
  source_dir: 'C:\\dev\\deltachat-desktop\\packages\\target-electron'
}
{
  prebuilds: [ 'stdio-rpc-server-win32-ia32', 'stdio-rpc-server-win32-x64' ],
  toDelete: [ 'stdio-rpc-server-win32-ia32' ]
}
{ prebuilds_after_cleanup: [ 'stdio-rpc-server-win32-x64' ] }
  • downloading     url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSi
gn-2.6.0/winCodeSign-2.6.0.7z size=5.6 MB parts=1
  • downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSi
gn-2.6.0/winCodeSign-2.6.0.7z duration=55.146s
  ⨯ cannot execute  cause=exit status 2
                    out=
    7-Zip (a) 21.07 (x64) : Copyright (c) 1999-2021 Igor Pavlov : 2021-12-26

    Scanning the drive for archives:
    1 file, 5635384 bytes (5504 KiB)

    Extracting archive: C:\Users\max\AppData\Local\electron-builder\Cache\winCodeSign\470389003.7z
    --
    Path = C:\Users\max\AppData\Local\electron-builder\Cache\winCodeSign\470389003.7z
    Type = 7z
    Physical Size = 5635384
    Headers Size = 1492
    Method = LZMA2:24m LZMA:20 BCJ2
    Solid = +
    Blocks = 2


    Sub items Errors: 2

    Archives with Errors: 1

    Sub items Errors: 2

                    errorOut=ERROR: Cannot create symbolic link : A required privilege is not held by the client.
: C:\Users\max\AppData\Local\electron-builder\Cache\winCodeSign\470389003\darwin\10.12\lib\libcrypto.dylib
    ERROR: Cannot create symbolic link : A required privilege is not held by the client. : C:\Users\max\AppData\Lo
cal\electron-builder\Cache\winCodeSign\470389003\darwin\10.12\lib\libssl.dylib

                    command='C:\dev\deltachat-desktop\node_modules\.pnpm\7zip-bin@5.2.0\node_modules\7zip-bin\win\
x64\7za.exe' x -bd 'C:\Users\max\AppData\Local\electron-builder\Cache\winCodeSign\470389003.7z' '-oC:\Users\max\Ap
pData\Local\electron-builder\Cache\winCodeSign\470389003'
                    workingDir=C:\Users\max\AppData\Local\electron-builder\Cache\winCodeSign
  • Above command failed, retrying 3 more times

I'm working under an unprivileged account (kinda trying to emulate sudo behavior where I explicitly run things as admin) and this is what I get. I've found a similar bug report in Electron.NET repo (ElectronNET/Electron.NET#829). It's a bit weird since from what I see it only touches my own directories and should have all the required permissions.

@Simon-Laux
Copy link
Member Author

I wonder why it tries to load macOS/darwin libraries. 👀

@imysl0
Copy link

imysl0 commented Sep 18, 2024

Hi @maxphilippov

Give Cygwin a try? I successfully packaged a Windows version using Cygwin on a non-administrator account on Windows 11.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants