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

Error 'no space left on device' is shown if code signing is not disabled. #3301

Closed
ghost opened this issue Sep 5, 2018 · 8 comments · Fixed by #4171
Closed

Error 'no space left on device' is shown if code signing is not disabled. #3301

ghost opened this issue Sep 5, 2018 · 8 comments · Fixed by #4171

Comments

@ghost
Copy link

ghost commented Sep 5, 2018

  • Version: 20.28.1
  • Target: mac zip

I am trying to build for mac zip.

If I run the command CSC_IDENTITY_AUTO_DISCOVERY=false yarn electron-builder -m, the command executes successfully.

If I run the command yarn electron-builder -m, the command throws error - open /Volumes/AppName 0.0.0/.VolumeIcon.icns: no space left on device

Below is the full output for the 2 commands-

$  CSC_IDENTITY_AUTO_DISCOVERY=false yarn electron-builder -m
yarn run v1.5.1
warning package.json: No license field
$ /Users/user/app-repo/node_modules/.bin/electron-builder -m
  • electron-builder version=20.28.1
  • loaded configuration file=package.json ("build" field)
  • writing effective config file=release/builder-effective-config.yaml
  • rebuilding native production dependencies platform=darwin arch=x64
  • rebuilding native dependency name=grpc
  • rebuilding native dependency name=realm
  • packaging       platform=darwin arch=x64 electron=1.8.7 appOutDir=release/mac
  • skipped macOS application code signing reason=, see https://electron.build/code-signing CSC_IDENTITY_AUTO_DISCOVERY=false
  • building        target=pkg arch=x64 file=release/AppName-0.0.0.pkg
  • building        target=DMG arch=x64 file=release/AppName-0.0.0.dmg
  • building        target=macOS zip arch=x64 file=release/AppName-0.0.0-mac.zip
  • building block map blockMapFile=release/AppName-0.0.0.dmg.blockmap
✨  Done in 201.65s.
$ yarn electron-builder -m
yarn run v1.5.1
warning package.json: No license field
$ /Users/user/app-repo/node_modules/.bin/electron-builder -m
  • electron-builder version=20.28.1
  • loaded configuration file=package.json ("build" field)
  • writing effective config file=release/builder-effective-config.yaml
  • rebuilding native production dependencies platform=darwin arch=x64
  • rebuilding native dependency name=grpc
  • rebuilding native dependency name=realm
  • packaging       platform=darwin arch=x64 electron=1.8.7 appOutDir=release/mac
  • signing         file=release/mac/AppName.app identityName=user identityHash=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX provisioningProfile=none
  • building        target=pkg arch=x64 file=release/AppName-0.0.0.pkg
  • building        target=DMG arch=x64 file=release/AppName-0.0.0.dmg
  • building        target=macOS zip arch=x64 file=release/AppName-0.0.0-mac.zip
  ⨯ open /Volumes/AppName 0.0.0/.VolumeIcon.icns: no space left on device
github.com/develar/app-builder/vendor/github.com/develar/go-fs-util.open
        /Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/develar/go-fs-util/fs.go:22
github.com/develar/app-builder/vendor/github.com/develar/go-fs-util.WriteFile
        /Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/develar/go-fs-util/fs.go:50
github.com/develar/app-builder/vendor/github.com/develar/go-fs-util.CopyFile
        /Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/develar/go-fs-util/fs.go:45
github.com/develar/app-builder/pkg/fs.(*FileCopier).CopyFile
        /Users/develar/go/src/github.com/develar/app-builder/pkg/fs/copier.go:156
github.com/develar/app-builder/pkg/fs.(*FileCopier).copyDirOrFile
        /Users/develar/go/src/github.com/develar/app-builder/pkg/fs/copier.go:125
github.com/develar/app-builder/pkg/fs.(*FileCopier).CopyDirOrFile
        /Users/develar/go/src/github.com/develar/app-builder/pkg/fs/copier.go:68
github.com/develar/app-builder/pkg/fs.CopyDirOrFile
        /Users/develar/go/src/github.com/develar/app-builder/pkg/fs/copier.go:54
github.com/develar/app-builder/pkg/dmg.BuildDmg
        /Users/develar/go/src/github.com/develar/app-builder/pkg/dmg/dmg.go:41
github.com/develar/app-builder/pkg/dmg.ConfigureCommand.func1
        /Users/develar/go/src/github.com/develar/app-builder/pkg/dmg/dmg.go:28
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(*actionMixin).applyActions
        /Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/actions.go:28
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(*Application).applyActions
        /Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/app.go:557
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(*Application).execute
        /Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/app.go:390
github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin.(*Application).Parse
        /Users/develar/go/src/github.com/develar/app-builder/vendor/github.com/alecthomas/kingpin/app.go:222
main.main
        /Users/develar/go/src/github.com/develar/app-builder/main.go:74
runtime.main
        /usr/local/Cellar/go/1.10.3/libexec/src/runtime/proc.go:198
runtime.goexit
        /usr/local/Cellar/go/1.10.3/libexec/src/runtime/asm_amd64.s:2361

Error: /Users/user/app-repo/node_modules/app-builder-bin/mac/app-builder exited with code 1
    at ChildProcess.childProcess.once.code (/Users/user/app-repo/node_modules/builder-util/src/util.ts:254:14)
    at Object.onceWrapper (events.js:317:30)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
From previous event:
    at customizeDmg (/Users/user/app-repo/node_modules/dmg-builder/out/dmg.js:209:18)
    at /Users/user/app-repo/node_modules/dmg-builder/src/dmg.ts:41:7
    at /Users/user/app-repo/node_modules/dmg-builder/src/dmgUtil.ts:37:31
From previous event:
    at attachAndExecute (/Users/user/app-repo/node_modules/dmg-builder/out/dmgUtil.js:114:17)
    at /Users/user/app-repo/node_modules/dmg-builder/src/dmg.ts:41:7
    at Generator.next (<anonymous>)
From previous event:
    at DmgTarget.build (/Users/user/app-repo/node_modules/dmg-builder/src/dmg.ts:73:7)
    at Function.buildAsyncTargets (/Users/user/app-repo/node_modules/app-builder-lib/src/platformPackager.ts:139:36)
    at MacPackager.packageInDistributableFormat (/Users/user/app-repo/node_modules/app-builder-lib/src/platformPackager.ts:118:24)
    at nonMasPromise.then.then (/Users/user/app-repo/node_modules/app-builder-lib/src/macPackager.ts:90:26)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
    at /Users/user/app-repo/node_modules/app-builder-lib/src/macPackager.ts:90:10
    at Generator.next (<anonymous>)
From previous event:
    at MacPackager.pack (/Users/user/app-repo/node_modules/app-builder-lib/src/macPackager.ts:80:95)
    at /Users/user/app-repo/node_modules/app-builder-lib/src/packager.ts:376:24
    at Generator.next (<anonymous>)
    at xfs.stat (/Users/user/app-repo/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
    at /Users/user/app-repo/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:153:5)
From previous event:
    at Packager.doBuild (/Users/user/app-repo/node_modules/app-builder-lib/src/packager.ts:344:39)
    at /Users/user/app-repo/node_modules/app-builder-lib/src/packager.ts:314:57
    at Generator.next (<anonymous>)
    at /Users/user/app-repo/node_modules/graceful-fs/graceful-fs.js:99:16
    at /Users/user/app-repo/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
    at Packager._build (/Users/user/app-repo/node_modules/app-builder-lib/src/packager.ts:285:133)
    at /Users/user/app-repo/node_modules/app-builder-lib/src/packager.ts:281:23
    at Generator.next (<anonymous>)
From previous event:
    at Packager.build (/Users/user/app-repo/node_modules/app-builder-lib/src/packager.ts:238:14)
    at build (/Users/user/app-repo/node_modules/app-builder-lib/src/index.ts:58:28)
    at build (/Users/user/app-repo/node_modules/electron-builder/src/builder.ts:227:10)
    at then (/Users/user/app-repo/node_modules/electron-builder/src/cli/cli.ts:42:48)
    at runCallback (timers.js:810:20)
    at tryOnImmediate (timers.js:768:5)
    at processImmediate [as _immediateCallback] (timers.js:745:5)
From previous event:
    at Object.args [as handler] (/Users/user/app-repo/node_modules/electron-builder/src/cli/cli.ts:42:48)
    at Object.runCommand (/Users/user/app-repo/node_modules/electron-builder/node_modules/yargs/lib/command.js:237:44)
    at Object.parseArgs [as _parseArgs] (/Users/user/app-repo/node_modules/electron-builder/node_modules/yargs/yargs.js:1085:24)
    at Object.get [as argv] (/Users/user/app-repo/node_modules/electron-builder/node_modules/yargs/yargs.js:1000:21)
    at Object.<anonymous> (/Users/user/app-repo/node_modules/electron-builder/src/cli/cli.ts:25:28)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:191:16)
    at bootstrap_node.js:612:3
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c /Users/user/app-repo/node_modules/.bin/electron-builder -m
Directory: /Users/user/app-repo
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/Users/user/app-repo/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I have replaced some path names for privacy concerns.

Below is the relevant part of package.json-

  "build": {
    "appId": "com.company.appName",
    "productName": "AppName",
    "publish": [
      {
        "provider": "generic",
        "url": "https://gitlab.com"
      }
    ],
    "directories": {
      "output": "release"
    },
    "linux": {
      "target": [
        "appImage"
      ]
    },
    "win": {
      "target": "nsis"
    },
    "icon": "src/assets/icons/png/appName.png",
    "mac": {
      "category": "public.app-category.utilities",
      "target": [
        "pkg",
        "dmg",
        "zip"
      ],
      "entitlements": "build/entitlements.mac.plist",
      "type": "distribution"
    },
    "files": [
      "public/",
      "node_modules/**/*",
      "src/**/*",
      "main.js",
      "package.json",
      "embedded.provisionprofile"
    ]
  }
@tommoor
Copy link

tommoor commented Nov 8, 2018

Hitting a similar issue – were you able to overcome this?

@VikramTiwari
Copy link

Hey @iaaflaafc and @tommoor Were you able to overcome this? If so, how?

@slawo-ch
Copy link

slawo-ch commented Apr 3, 2019

I may have some more information here. I was facing the same error 'no space left on device', and it was not related to code signing. After some digging I found that it is actually related to no space being left on the dmg.

The dmg is built in stages. First it is built from the out folder containing the app, then it is resized down, taking into account any extra space needed for customization like dmg icons, background and the like.

The code trying to find the correct final size is here: https://github.com/electron-userland/electron-builder/blob/master/packages/dmg-builder/src/dmg.ts#L39

It ends up calling this: https://github.com/electron-userland/electron-builder/blob/master/packages/dmg-builder/src/dmg.ts#L248 which tries to calculate extra space needed for storing the images plus some 32k (I'm assuming) of extra space for metadata etc.

Some strange effect is happening there, such that if app content size falls within certain boundaries, the above calculation falls short. You can decrease or increase your content size (artificially add or remove 10MB+ content) and it will work again. I don't know the correct way to calculate the resize value. For now I'm assuming there's some strange interaction between block sizes, size-on-disk, the units hdutil understands, KiloByte vs. KibiByte etc.

As a temporary hack, if I increase the default extra space of 32 x 1024 (assuming that's 32k) to something much larger like 10 x 1024 x 1024 (assuming that's 10MB) my image builds fine, although the dmg grows in size somewhat unnecessarily.

@vladotesanovic
Copy link
Contributor

@slawo-ch

Hi Slawo,

Did you find permanent fix for this issue?
Changing memory allocation in dmg-builder seams to fix error but is not good approach.

Either we can submit PR to increase size in hdiutil, and avoid this error? At is seams that memory computation is not correct in some cases.

@slawo-ch
Copy link

@slawo-ch

Hi Slawo,

Did you find permanent fix for this issue?
Changing memory allocation in dmg-builder seams to fix error but is not good approach.

Either we can submit PR to increase size in hdiutil, and avoid this error? At is seams that memory computation is not correct in some cases.

Hey @vladotesanovic,

Unfortunately, I don't have a proper fix. For now I live with a workaround. I add or remove an all-white background .tif file if the build fails.

@vladotesanovic
Copy link
Contributor

@slawo-ch

Well, for me icon and background is null, and according to code, if it is null, than it is ignored.

I was thinking to play with hdiutil arguments for beginning, and if that fail than to change this computeAssetSize function and submit PR

@tobiasmuecksch
Copy link

@develar Why has this issue been closed? The bug is still there... and I'm not able to publish any updates anymore...

@tobiasmuecksch
Copy link

I can confirm, that this workaround fixes the issue

1d21620

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 a pull request may close this issue.

5 participants