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

"classic" confinement needs but doesn't install bin/electron-launch #113

Closed
3 tasks done
michaelfig opened this issue Feb 24, 2021 · 1 comment · Fixed by #144
Closed
3 tasks done

"classic" confinement needs but doesn't install bin/electron-launch #113

michaelfig opened this issue Feb 24, 2021 · 1 comment · Fixed by #144

Comments

@michaelfig
Copy link

michaelfig commented Feb 24, 2021

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:

Thanks for this work! Setting it up takes some investment, but it should pay off for the automation.

Building my Electron Forge app on Ubuntu 18.04 worked fine with "devmode", but when I tried using { "confinement": "classic" }, snapcraft exited with an error.

Console output when you run electron-installer-snap with the environment variable DEBUG='electron-installer-snap:*'. Please include the stack trace if one exists.

Everything looked good (sorry, I don't have the logs right now but will post later if you need them) until:

Sorry, an error occurred in Snapcraft:
Traceback (most recent call last):
  File "/usr/bin/snapcraft", line 11, in <module>
    load_entry_point('snapcraft==2.43.1+18.4.1', 'console_scripts', 'snapcraft')()
  File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 136, in snap
    project = _execute(steps.PRIME, parts=[], **kwargs)
  File "/usr/lib/python3/dist-packages/snapcraft/cli/lifecycle.py", line 35, in _execute
    lifecycle.execute(step, project_config, parts)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 90, in execute
    executor.run(step, part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 196, in run
    self._create_meta(step, processed_part_names)
  File "/usr/lib/python3/dist-packages/snapcraft/internal/lifecycle/_runner.py", line 359, in _create_meta
    self.config.validator.schema,
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 109, in create_snap_packaging
    packaging.write_snap_yaml()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 313, in write_snap_yaml
    snap_yaml = self._compose_snap_yaml()
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 517, in _compose_snap_yaml
    snap_yaml["apps"] = self._wrap_apps(self._config_data["apps"])
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 624, in _wrap_apps
    self._wrap_app(app, apps[app])
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 632, in _wrap_app
    app[k] = self._wrap_exe(app[k], "{}-{}".format(k, name))
  File "/usr/lib/python3/dist-packages/snapcraft/internal/meta/_snap_packaging.py", line 603, in _wrap_exe
    with open(exepath, "rb") as exefile:
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/electron-snap-6898rPhJrY5qIgxl/prime/bin/electron-launch'
We would appreciate it if you created a bug report at
https://launchpad.net/snapcraft/+filebug with the above text included.

What command line arguments are you passing? Alternatively, if you are using the API, what
parameters are you passing to the snap() function?

{ "confinement": "classic" }

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-quick-start
is a good starting point.

Adding the following part to the generated snapcraft.yaml,

parts:
  electron-launch:
    plugin: dump
    source: ./bin
    organize:
      electron-launch: bin/electron-launch

and rerunning:

/usr/bin/snapcraft snap --target-arch=amd64 --output=/media/psf/Home/agoric/Pledger-u18/packages/app-electron/out/make/snap/x64/pledger_0.2.0_amd64.snap

made things work just fine. I suspect that the electron-launch part just needs to be turned on for "classic" confinement, but I don't know the best way to do that in the code.

@welcome
Copy link

welcome bot commented Feb 24, 2021

👋 Thanks for opening your first issue here! If you have a question about using electron-installer-snap, read the support docs. If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. Development and issue triage is community-driven, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

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