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

Update snap to use base: #119436

Closed
joaomoreno opened this issue Mar 22, 2021 · 1 comment · Fixed by #127320
Closed

Update snap to use base: #119436

joaomoreno opened this issue Mar 22, 2021 · 1 comment · Fixed by #127320
Assignees
Labels
engineering VS Code - Build / issue tracking / etc. insiders-released Patch has been released in VS Code Insiders linux Issues with VS Code on Linux snap Issues related to the snap package
Milestone

Comments

@joaomoreno
Copy link
Member

joaomoreno commented Mar 22, 2021

More info: #118116 (comment)

https://snapcraft.io/blog/all-about-that-base

@joaomoreno joaomoreno added feature-request Request for new features or functionality linux Issues with VS Code on Linux snap Issues related to the snap package labels Mar 22, 2021
@joaomoreno joaomoreno added this to the Backlog milestone Mar 22, 2021
@joaomoreno joaomoreno self-assigned this Mar 22, 2021
@joaomoreno
Copy link
Member Author

From @igorljubuncic:

Some notes:

  1. Code-oss needs to be built in a 20.04 docker container, so you will need to amend the docker line to use a 20.04 image, build your own image, or configure the container to have core20 installed. Otherwise, it will either segfault on pixbufs, or hang on launch.

Re: docker/image, we have some of this documented:
https:/snapcore/snapcraft/blob/master/docker/Dockerfile
This is a direct link to a Dockerfile that can be parametrized to build the right thing.

  1. For reference, I built vscode from deb on a 20.04 machine, and it works just fine.
    I ran it in both Ubuntu and Fedora.

VS Code:

name: vscode
version: "1.0"
summary: Code editing. Redefined.
description: |
  Visual Studio Code is a new choice of tool that combines the
  simplicity of a code editor with what developers need for the core
  edit-build-debug cycle.

architectures:
  - build-on: amd64
    run-on: amd64

grade: stable
confinement: classic
base: core20

parts:
#  gnome:
#    plugin: nil
#    build-packages:
#      - software-properties-common
#    override-pull: |
#      add-apt-repository -y ppa:ubuntu-desktop/gnome-3-26
#      apt -y update

  code:
#    after:
#      - gnome
    plugin: dump
    source: ./code_1.54.3-1615806378_amd64.deb
    source-type: deb
    stage-packages:
      - libx11-xcb1
      - libx11-6
      - libxcomposite1
      - libxdamage1
      - libxext6
      - libxfixes3
      - libxrandr2
      - libasound2
      - libatk1.0-0
      - libatk-bridge2.0-0
      - libatspi2.0-0
      - libcairo2
      - libdrm2
      - libgbm1
      - libgdk-pixbuf2.0-0
      - libgtk-3-0
      - libnspr4
      - libnss3
      - libpango-1.0-0
      - libsecret-1-0
      - libxcb1
      - libxkbcommon0
      - libxkbfile1
#    prime:
#      - -usr/share/doc
#      - -usr/share/fonts
#      - -usr/share/icons
#      - -usr/share/lintian
#      - -usr/share/man

apps:
  code:
    #extensions: [gnome-3-34]
    command: usr/share/code/bin/code
    common-id: code.desktop
    environment:
      DISABLE_WAYLAND: 1
      GSETTINGS_SCHEMA_DIR: usr/share/glib-2.0/schemas

  url-handler:
    command: usr/share/code/bin/code --open-url
    environment:
      DISABLE_WAYLAND: 1
      GSETTINGS_SCHEMA_DIR: usr/share/glib-2.0/schemas

OSS:

name: @@NAME@@
version: @@VERSION@@
summary: Code editing. Redefined.
description: |
  Visual Studio Code is a new choice of tool that combines the
  simplicity of a code editor with what developers need for the core
  edit-build-debug cycle.

architectures:
  - build-on: amd64
    run-on: @@ARCHITECTURE@@

grade: stable
confinement: classic
base: core20

parts:
#  gnome:
#    plugin: nil
#    build-packages:
#      - software-properties-common
#    override-pull: |
#      add-apt-repository -y ppa:ubuntu-desktop/gnome-3-26
#      apt -y update

  code:
#    after:
#      - gnome
    plugin: dump
    source: .
    stage-packages:
      #- libc6 # without it, pixbuf segfaults, with it code-oss runs on non-xenial-built images but is not responsive
      - libx11-xcb1
      - libx11-6
      - libxcomposite1
      - libxdamage1
      - libxext6
      - libxfixes3
      - libxrandr2
      - libasound2
      - libatk1.0-0
      - libatk-bridge2.0-0
      - libatspi2.0-0
      - libcairo2
      - libdrm2
      - libgbm1
      - libgdk-pixbuf2.0-0
      - libgtk-3-0
      - libnspr4
      - libnss3
      - libpango-1.0-0
      - libsecret-1-0
      - libxcb1
      - libxkbcommon0
      - libxkbfile1
#    stage-packages:
#      - ibus-gtk3
#      - fcitx-frontend-gtk3
#      - gvfs-libs
#      - libasound2
#      - libgconf-2-4
#      - libgdk-pixbuf2.0-0
#      - libglib2.0-bin
#      - libgnome-keyring0
#      - libxkbfile1
#      - libgbm1
#      - libgtk-3-0
#      - libnotify4
#      - libnspr4
#      - libnss3
#      - libpcre3
#      - libpulse0
#      - libsecret-1-0
#      - libxss1
#      - libxtst6
#      - zlib1g
#    prime:
#      - -usr/share/doc
#      - -usr/share/fonts
#      - -usr/share/icons
#      - -usr/share/lintian
#      - -usr/share/man

apps:
  @@NAME@@:
    #extensions: [gnome-3-34]
    command: electron-launch $SNAP/usr/share/@@NAME@@/bin/@@NAME@@
    common-id: @@NAME@@.desktop
    environment:
      DISABLE_WAYLAND: 1
      GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas

  url-handler:
    command: electron-launch $SNAP/usr/share/@@NAME@@/bin/@@NAME@@ --open-url
    environment:
      DISABLE_WAYLAND: 1
      GSETTINGS_SCHEMA_DIR: $SNAP/usr/share/glib-2.0/schemas

@joaomoreno joaomoreno assigned deepak1556 and unassigned joaomoreno Nov 8, 2021
@joaomoreno joaomoreno added engineering VS Code - Build / issue tracking / etc. and removed feature-request Request for new features or functionality labels Nov 8, 2021
@joaomoreno joaomoreno assigned joaomoreno and unassigned deepak1556 Dec 12, 2022
@deepak1556 deepak1556 self-assigned this Jan 23, 2023
@deepak1556 deepak1556 modified the milestones: Backlog, February 2023 Jan 23, 2023
@deepak1556 deepak1556 modified the milestones: February 2023, March 2023 Feb 21, 2023
@vscodenpa vscodenpa added unreleased Patch has not yet been released in VS Code Insiders insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Mar 9, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
engineering VS Code - Build / issue tracking / etc. insiders-released Patch has been released in VS Code Insiders linux Issues with VS Code on Linux snap Issues related to the snap package
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants