Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
223 changes: 223 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
name: ci

on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:

# Cancel superseded runs for the same ref to save CI minutes.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
parse:
# poky-the-distro covers up to walnascar; whinlatter+ no longer
# publish a poky combo repo and are handled by parse-oe-core below.
name: parse (${{ matrix.poky_branch }} / ${{ matrix.machine }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
poky_branch: [kirkstone, scarthgap, styhead, walnascar]
# MACHINE controls which Microsoft binary tarball the recipe
# resolves to:
# qemux86-64 -> linux-x64
# qemuarm64 -> linux-arm64
# qemuarm -> linux-armhf
machine: [qemux86-64, qemuarm64, qemuarm]
steps:
- uses: actions/checkout@v4
with:
path: meta-vscode

- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/opt/hostedtoolcache/CodeQL /usr/local/share/boost \
"$AGENT_TOOLSDIRECTORY"

- name: Cache poky checkout
uses: actions/cache@v4
with:
path: poky
key: poky-${{ matrix.poky_branch }}-v1
restore-keys: poky-${{ matrix.poky_branch }}-

- name: Clone poky
run: |
if [ ! -d poky/.git ]; then
git clone --depth 1 --branch ${{ matrix.poky_branch }} \
https://git.yoctoproject.org/poky poky
else
git -C poky fetch --depth 1 origin \
${{ matrix.poky_branch }}:refs/remotes/origin/${{ matrix.poky_branch }}
git -C poky checkout -B ${{ matrix.poky_branch }} \
refs/remotes/origin/${{ matrix.poky_branch }}
fi

- name: Install Yocto host dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gawk wget git diffstat unzip texinfo gcc build-essential chrpath \
socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool \
file locales libacl1
sudo locale-gen en_US.UTF-8

- name: Parse the layer (MACHINE=${{ matrix.machine }})
env:
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8
run: |
set -eo pipefail
cd poky
source oe-init-build-env build
cat >> conf/local.conf <<EOF
MACHINE = "${{ matrix.machine }}"
BB_NUMBER_THREADS = "2"
PARALLEL_MAKE = "-j 2"
CONF_VERSION = "2"
EOF
bitbake-layers add-layer "$GITHUB_WORKSPACE/meta-vscode"
bitbake-layers show-layers
bitbake -p

- name: Fetch vscode (MACHINE=${{ matrix.machine }})
env:
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8
run: |
set -eo pipefail
cd poky
source oe-init-build-env build
bitbake -c fetch vscode

parse-oe-core:
# whinlatter and wrynose dropped the combined poky repository, so
# we clone openembedded-core + bitbake separately.
name: parse (${{ matrix.release }} / ${{ matrix.machine }})
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
release: [whinlatter, wrynose]
machine: [qemux86-64, qemuarm64, qemuarm]
# include adds the bitbake-version axis as a value-mapping
# against an existing matrix axis (release); GHA pairs the
# extra key (bitbake) with each existing combo that shares the
# release value.
include:
- release: whinlatter
bitbake: '2.16'
- release: wrynose
bitbake: '2.18'
steps:
- uses: actions/checkout@v4
with:
path: meta-vscode

- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/opt/hostedtoolcache/CodeQL /usr/local/share/boost \
"$AGENT_TOOLSDIRECTORY"

- name: Clone oe-core (${{ matrix.release }})
run: |
git clone --depth 1 --branch ${{ matrix.release }} \
https://git.openembedded.org/openembedded-core oe-core

- name: Clone bitbake (${{ matrix.bitbake }})
run: |
git clone --depth 1 --branch ${{ matrix.bitbake }} \
https://git.openembedded.org/bitbake oe-core/bitbake

- name: Install Yocto host dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gawk wget git diffstat unzip texinfo gcc build-essential chrpath \
socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool \
file locales libacl1
sudo locale-gen en_US.UTF-8

- name: Parse the layer (MACHINE=${{ matrix.machine }})
env:
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8
run: |
set -eo pipefail
cd oe-core
source oe-init-build-env build
cat >> conf/local.conf <<EOF
MACHINE = "${{ matrix.machine }}"
BB_NUMBER_THREADS = "2"
PARALLEL_MAKE = "-j 2"
CONF_VERSION = "2"
EOF
bitbake-layers add-layer "$GITHUB_WORKSPACE/meta-vscode"
bitbake-layers show-layers
bitbake -p

- name: Fetch vscode (MACHINE=${{ matrix.machine }})
env:
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8
run: |
set -eo pipefail
cd oe-core
source oe-init-build-env build
bitbake -c fetch vscode

# Build vscode end-to-end on the LTS we care most about today
# (scarthgap). This catches QA failures (libdir, file-rdeps, etc.)
# that bitbake -p doesn't run. Single arch (x86_64) for cost; the
# parse matrix above still proves the other arches' URLs resolve.
build:
name: build vscode (scarthgap / qemux86-64)
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
path: meta-vscode

- name: Free disk space
run: |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
/opt/hostedtoolcache/CodeQL /usr/local/share/boost \
"$AGENT_TOOLSDIRECTORY"

- name: Clone poky (scarthgap)
run: git clone --depth 1 --branch scarthgap https://git.yoctoproject.org/poky poky

- name: Install Yocto host dependencies
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gawk wget git diffstat unzip texinfo gcc build-essential chrpath \
socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool \
file locales libacl1
sudo locale-gen en_US.UTF-8

- name: Build vscode
env:
LANG: en_US.UTF-8
LC_ALL: en_US.UTF-8
run: |
set -eo pipefail
cd poky
source oe-init-build-env build
cat >> conf/local.conf <<'EOF'
MACHINE = "qemux86-64"
BB_NUMBER_THREADS = "2"
PARALLEL_MAKE = "-j 2"
INHERIT += "rm_work"
CONF_VERSION = "2"
EOF
bitbake-layers add-layer "$GITHUB_WORKSPACE/meta-vscode"
bitbake vscode
8 changes: 5 additions & 3 deletions conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ BBPATH .= ":${LAYERDIR}"
# Append recipe dir to BBFILES
BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend"

LAYERSERIES_COMPAT_meta-vscode = "kirkstone"

BBFILE_COLLECTIONS += "meta-vscode"
BBFILE_PATTERN_meta-vscode = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-vscode = "1"
BBFILE_PATTERN_meta-vscode = "${LAYERDIR}"

LAYERDEPENDS_meta-vscode = "core"
LAYERVERSION_meta-vscode = "1"
LAYERSERIES_COMPAT_meta-vscode = "kirkstone scarthgap styhead walnascar whinlatter wrynose"
71 changes: 71 additions & 0 deletions recipes-devtools/vscode/vscode_1.120.0.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
SUMMARY = "Visual Studio Code"
DESCRIPTION = "Visual Studio Code, pre-built binaries from Microsoft's stable \
release CDN. The shipped binaries include the proprietary Microsoft branding, \
telemetry, and Marketplace access; the OSS-licensed portions of the source are \
the same code as github.com/microsoft/vscode but the assembled binary is \
covered by the Microsoft Software License Terms."
HOMEPAGE = "https://code.visualstudio.com/"

# Microsoft's distributed VSCode build is covered by the Microsoft Software
# License Terms; the embedded Chromium and Node.js components are BSD / MIT.
# We pin LIC_FILES_CHKSUM to LICENSES.chromium.html since it's the most
# stable artefact across versions and exists in every architecture's tarball.
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://LICENSES.chromium.html;md5=56eefdb0904e3e5ddf43f1d2e7f9a379"

# Only the three Linux arches Microsoft actually ships pre-built binaries for.
# riscv64 / mips / etc users have to build from source (out of scope for this
# layer) or use a remote-development setup (code-server / openvscode-server).
COMPATIBLE_HOST = "(x86_64|aarch64|arm).*-linux"

def get_vscode_arch(d):
arch = d.getVar('HOST_ARCH')
mapping = {
'aarch64': 'arm64',
'arm': 'armhf',
'x86_64': 'x64',
}
return mapping.get(arch, '')

VSCODE_ARCH ?= "${@get_vscode_arch(d)}"

# Per-arch upload timestamps Microsoft embeds in the tarball URL. Bumping
# the version means re-resolving these via
# `curl -sLI https://update.code.visualstudio.com/latest/linux-$arch/stable`
# and copying the timestamp out of the Location header.
GIT_SHA = "0958016b2af9f09bb4257e0df4a95e2f90590f9f"
TIMESTAMP-arm64 = "1778618964"
TIMESTAMP-armhf = "1778618962"
TIMESTAMP-x64 = "1778618960"

SRC_URI = "https://vscode.download.prss.microsoft.com/dbazure/download/stable/${GIT_SHA}/code-stable-${VSCODE_ARCH}-${TIMESTAMP-${VSCODE_ARCH}}.tar.gz;name=vscode-${VSCODE_ARCH}"

SRC_URI[vscode-x64.sha256sum] = "510426eb23d330bf25d84fe88e49a08d965d6b21957b82e196af7ccf7bdd882b"
SRC_URI[vscode-arm64.sha256sum] = "69c0d1d0534cd4173e2b3dbee5d001ed5c2bd0c846bb22dca917312b64eb1baf"
SRC_URI[vscode-armhf.sha256sum] = "1662d3dd08a3602544bc4ca1b091e04d5393a23414607b7c34f0570ebd0d5daa"

S = "${WORKDIR}/VSCode-linux-${VSCODE_ARCH}"

# These are arch-specific prebuilt ELFs, not noarch content; bin_package
# inherits allarch which is wrong here. Override back to per-machine
# packaging so an arm64 build and an x86_64 build produce distinct .ipks.
inherit bin_package
PACKAGE_ARCH = "${MACHINE_ARCH}"

do_install() {
install -d ${D}${datadir}/vscode
cp --preserve=mode,timestamps -R ${S}/. ${D}${datadir}/vscode/
}

FILES:${PN} = "${datadir}/vscode"

# The shipped binaries are stripped and link against the host's glibc / X /
# wayland stack; suppress Yocto QA checks that would otherwise complain
# about them.
INSANE_SKIP:${PN} += "already-stripped file-rdeps ldflags libdir arch staticdev"

# The Microsoft tarball includes its own libvulkan / chrome-sandbox under
# /usr/share/vscode/; Yocto's debug-info split picks those up and stashes a
# .debug/ next to them, which then trips the libdir QA check on ${PN}-dbg.
# Same root cause as the main package; suppress it there too.
INSANE_SKIP:${PN}-dbg += "libdir"
41 changes: 0 additions & 41 deletions recipes-devtools/vscode/vscode_1.89.bb

This file was deleted.

Loading