electron-builder icon indicating copy to clipboard operation
electron-builder copied to clipboard

ENOENT: no such file or directory, chmod '7za in version 24.9.1 but not in version 24.6.4

Open elvince opened this issue 5 months ago • 4 comments

  • Electron-Builder Version:
  • 24.9.1
  • Node Version: 18.x
  • Electron Version: 27.3.0
  • Electron Type (current, beta, nightly): current

6.1.7

  • Target: win

In our CI pipeline, we are using the image "electronuserland/builder:18-wine-11.23"

When building the package, we have the following issue:

ENOENT: no such file or directory, chmod '7za' failedTask=build stackTrace=Error: ENOENT: no such file or directory, chmod '7za'

Previously we were using 24.6.4 that build without any issue with the same setup/prerequisites.

Is there any new prerequisites that we need to set on the CI build machine ? Package to install ?

Thanks,

elvince avatar Jan 31 '24 08:01 elvince

So we're using fs-extra with chmod to workaround an issue with an upstream dependency where the executable ironically isn't executable. https://github.com/electron-userland/electron-builder/blob/9d1d150896a763d3630418bf5be8fd3a070c0c40/packages/builder-util/src/7za.ts#L2-L12

Can you add DEBUG=electron-builder. Wondering if I need to add a log.debug or something similar when it tries to fetch 7za (if it doesn't have it already)

mmaietta avatar Feb 01 '24 17:02 mmaietta

Thanks for the feedback. I will add this DEBUG and provide you information.

elvince avatar Feb 02 '24 08:02 elvince

So we're using fs-extra with chmod to workaround an issue with an upstream dependency where the executable ironically isn't executable.

https://github.com/electron-userland/electron-builder/blob/9d1d150896a763d3630418bf5be8fd3a070c0c40/packages/builder-util/src/7za.ts#L2-L12

Can you add DEBUG=electron-builder. Wondering if I need to add a log.debug or something similar when it tries to fetch 7za (if it doesn't have it already)

Here is the debug log, I hope it helps.

> cross-env DEBUG=electron-builder electron-builder --win -c.extraMetadata.version=1.1.94-beta -c.productName=MyApp-beta -c.appId=org.erb.MyApp-beta
  • electron-builder  version=24.9.1 os=5.4.109+
  • artifacts will be published if draft release exists  reason=CI detected
  • loaded configuration  file=package.json ("build" field)
  • effective config  config=directories:
  output: MyApp
  buildResources: assets
  app: release/app
productName: MyApp-beta
appId: org.erb.MyApp-beta
asar: true
asarUnpack: '**\*.{node,dll}'
files:
  - filter:
      - dist
      - node_modules
      - package.json
extraMetadata:
  version: 1.1.94-beta
afterSign: .erb/scripts/notarize.js
win:
  target: nsis
  publish:
    - provider: generic
      url: https://MyApp.com/app/
nsis:
  artifactName: MyApp-setup-${version}.exe
  oneClick: false
  installerIcon: icon.ico
  uninstallerIcon: icon.ico
  allowToChangeInstallationDirectory: true
  installerSidebar: MyAppBmpBackground.bmp
  uninstallerSidebar: MyAppBmpBackground.bmp
  uninstallDisplayName: MyApp
  deleteAppDataOnUninstall: true
extraResources:
  - filter:
      - ./assets/**
      - ./splash/**
      - ./test-exe/**
      - ./tart-exe/**
  • two package.json structure is used  devPackageFile=/builds/MyApp1/MyApp/package.json appPackageFile=/builds/MyApp1/MyApp/release/app/package.json
  ⨯ ENOENT: no such file or directory, chmod '7za'  failedTask=build stackTrace=Error: ENOENT: no such file or directory, chmod '7za'

elvince avatar Feb 02 '24 09:02 elvince

@elvince Perhaps try updating to the next version of electron-builder v24.12.0? I updated and 7za.ts was no longer missing. I still run into other issues electron-user/electron-builder#8006, but I am building for Linux and maybe it will work for Windows. Hopefully this helps

clairejhaas avatar Feb 16 '24 20:02 clairejhaas