Skip to content

Commit 9647ee1

Browse files
Merge pull request #1 from EmbeddedAndroid/modernize-and-update
Modernize meta-vscode: bump to 1.120, fix per-arch, add multi-release CI
2 parents 2016ac8 + 9f82dc5 commit 9647ee1

4 files changed

Lines changed: 299 additions & 44 deletions

File tree

.github/workflows/ci.yml

Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
# Cancel superseded runs for the same ref to save CI minutes.
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
parse:
16+
# poky-the-distro covers up to walnascar; whinlatter+ no longer
17+
# publish a poky combo repo and are handled by parse-oe-core below.
18+
name: parse (${{ matrix.poky_branch }} / ${{ matrix.machine }})
19+
runs-on: ubuntu-22.04
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
poky_branch: [kirkstone, scarthgap, styhead, walnascar]
24+
# MACHINE controls which Microsoft binary tarball the recipe
25+
# resolves to:
26+
# qemux86-64 -> linux-x64
27+
# qemuarm64 -> linux-arm64
28+
# qemuarm -> linux-armhf
29+
machine: [qemux86-64, qemuarm64, qemuarm]
30+
steps:
31+
- uses: actions/checkout@v4
32+
with:
33+
path: meta-vscode
34+
35+
- name: Free disk space
36+
run: |
37+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
38+
/opt/hostedtoolcache/CodeQL /usr/local/share/boost \
39+
"$AGENT_TOOLSDIRECTORY"
40+
41+
- name: Cache poky checkout
42+
uses: actions/cache@v4
43+
with:
44+
path: poky
45+
key: poky-${{ matrix.poky_branch }}-v1
46+
restore-keys: poky-${{ matrix.poky_branch }}-
47+
48+
- name: Clone poky
49+
run: |
50+
if [ ! -d poky/.git ]; then
51+
git clone --depth 1 --branch ${{ matrix.poky_branch }} \
52+
https://git.yoctoproject.org/poky poky
53+
else
54+
git -C poky fetch --depth 1 origin \
55+
${{ matrix.poky_branch }}:refs/remotes/origin/${{ matrix.poky_branch }}
56+
git -C poky checkout -B ${{ matrix.poky_branch }} \
57+
refs/remotes/origin/${{ matrix.poky_branch }}
58+
fi
59+
60+
- name: Install Yocto host dependencies
61+
run: |
62+
sudo apt-get update
63+
sudo apt-get install -y --no-install-recommends \
64+
gawk wget git diffstat unzip texinfo gcc build-essential chrpath \
65+
socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
66+
iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool \
67+
file locales libacl1
68+
sudo locale-gen en_US.UTF-8
69+
70+
- name: Parse the layer (MACHINE=${{ matrix.machine }})
71+
env:
72+
LANG: en_US.UTF-8
73+
LC_ALL: en_US.UTF-8
74+
run: |
75+
set -eo pipefail
76+
cd poky
77+
source oe-init-build-env build
78+
cat >> conf/local.conf <<EOF
79+
MACHINE = "${{ matrix.machine }}"
80+
BB_NUMBER_THREADS = "2"
81+
PARALLEL_MAKE = "-j 2"
82+
CONF_VERSION = "2"
83+
EOF
84+
bitbake-layers add-layer "$GITHUB_WORKSPACE/meta-vscode"
85+
bitbake-layers show-layers
86+
bitbake -p
87+
88+
- name: Fetch vscode (MACHINE=${{ matrix.machine }})
89+
env:
90+
LANG: en_US.UTF-8
91+
LC_ALL: en_US.UTF-8
92+
run: |
93+
set -eo pipefail
94+
cd poky
95+
source oe-init-build-env build
96+
bitbake -c fetch vscode
97+
98+
parse-oe-core:
99+
# whinlatter and wrynose dropped the combined poky repository, so
100+
# we clone openembedded-core + bitbake separately.
101+
name: parse (${{ matrix.release }} / ${{ matrix.machine }})
102+
runs-on: ubuntu-22.04
103+
strategy:
104+
fail-fast: false
105+
matrix:
106+
release: [whinlatter, wrynose]
107+
machine: [qemux86-64, qemuarm64, qemuarm]
108+
# include adds the bitbake-version axis as a value-mapping
109+
# against an existing matrix axis (release); GHA pairs the
110+
# extra key (bitbake) with each existing combo that shares the
111+
# release value.
112+
include:
113+
- release: whinlatter
114+
bitbake: '2.16'
115+
- release: wrynose
116+
bitbake: '2.18'
117+
steps:
118+
- uses: actions/checkout@v4
119+
with:
120+
path: meta-vscode
121+
122+
- name: Free disk space
123+
run: |
124+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
125+
/opt/hostedtoolcache/CodeQL /usr/local/share/boost \
126+
"$AGENT_TOOLSDIRECTORY"
127+
128+
- name: Clone oe-core (${{ matrix.release }})
129+
run: |
130+
git clone --depth 1 --branch ${{ matrix.release }} \
131+
https://git.openembedded.org/openembedded-core oe-core
132+
133+
- name: Clone bitbake (${{ matrix.bitbake }})
134+
run: |
135+
git clone --depth 1 --branch ${{ matrix.bitbake }} \
136+
https://git.openembedded.org/bitbake oe-core/bitbake
137+
138+
- name: Install Yocto host dependencies
139+
run: |
140+
sudo apt-get update
141+
sudo apt-get install -y --no-install-recommends \
142+
gawk wget git diffstat unzip texinfo gcc build-essential chrpath \
143+
socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
144+
iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool \
145+
file locales libacl1
146+
sudo locale-gen en_US.UTF-8
147+
148+
- name: Parse the layer (MACHINE=${{ matrix.machine }})
149+
env:
150+
LANG: en_US.UTF-8
151+
LC_ALL: en_US.UTF-8
152+
run: |
153+
set -eo pipefail
154+
cd oe-core
155+
source oe-init-build-env build
156+
cat >> conf/local.conf <<EOF
157+
MACHINE = "${{ matrix.machine }}"
158+
BB_NUMBER_THREADS = "2"
159+
PARALLEL_MAKE = "-j 2"
160+
CONF_VERSION = "2"
161+
EOF
162+
bitbake-layers add-layer "$GITHUB_WORKSPACE/meta-vscode"
163+
bitbake-layers show-layers
164+
bitbake -p
165+
166+
- name: Fetch vscode (MACHINE=${{ matrix.machine }})
167+
env:
168+
LANG: en_US.UTF-8
169+
LC_ALL: en_US.UTF-8
170+
run: |
171+
set -eo pipefail
172+
cd oe-core
173+
source oe-init-build-env build
174+
bitbake -c fetch vscode
175+
176+
# Build vscode end-to-end on the LTS we care most about today
177+
# (scarthgap). This catches QA failures (libdir, file-rdeps, etc.)
178+
# that bitbake -p doesn't run. Single arch (x86_64) for cost; the
179+
# parse matrix above still proves the other arches' URLs resolve.
180+
build:
181+
name: build vscode (scarthgap / qemux86-64)
182+
runs-on: ubuntu-22.04
183+
steps:
184+
- uses: actions/checkout@v4
185+
with:
186+
path: meta-vscode
187+
188+
- name: Free disk space
189+
run: |
190+
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc \
191+
/opt/hostedtoolcache/CodeQL /usr/local/share/boost \
192+
"$AGENT_TOOLSDIRECTORY"
193+
194+
- name: Clone poky (scarthgap)
195+
run: git clone --depth 1 --branch scarthgap https://git.yoctoproject.org/poky poky
196+
197+
- name: Install Yocto host dependencies
198+
run: |
199+
sudo apt-get update
200+
sudo apt-get install -y --no-install-recommends \
201+
gawk wget git diffstat unzip texinfo gcc build-essential chrpath \
202+
socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
203+
iputils-ping python3-git python3-jinja2 python3-subunit zstd liblz4-tool \
204+
file locales libacl1
205+
sudo locale-gen en_US.UTF-8
206+
207+
- name: Build vscode
208+
env:
209+
LANG: en_US.UTF-8
210+
LC_ALL: en_US.UTF-8
211+
run: |
212+
set -eo pipefail
213+
cd poky
214+
source oe-init-build-env build
215+
cat >> conf/local.conf <<'EOF'
216+
MACHINE = "qemux86-64"
217+
BB_NUMBER_THREADS = "2"
218+
PARALLEL_MAKE = "-j 2"
219+
INHERIT += "rm_work"
220+
CONF_VERSION = "2"
221+
EOF
222+
bitbake-layers add-layer "$GITHUB_WORKSPACE/meta-vscode"
223+
bitbake vscode

conf/layer.conf

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ BBPATH .= ":${LAYERDIR}"
44
# Append recipe dir to BBFILES
55
BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend"
66

7-
LAYERSERIES_COMPAT_meta-vscode = "kirkstone"
8-
97
BBFILE_COLLECTIONS += "meta-vscode"
8+
BBFILE_PATTERN_meta-vscode = "^${LAYERDIR}/"
109
BBFILE_PRIORITY_meta-vscode = "1"
11-
BBFILE_PATTERN_meta-vscode = "${LAYERDIR}"
10+
11+
LAYERDEPENDS_meta-vscode = "core"
12+
LAYERVERSION_meta-vscode = "1"
13+
LAYERSERIES_COMPAT_meta-vscode = "kirkstone scarthgap styhead walnascar whinlatter wrynose"
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
SUMMARY = "Visual Studio Code"
2+
DESCRIPTION = "Visual Studio Code, pre-built binaries from Microsoft's stable \
3+
release CDN. The shipped binaries include the proprietary Microsoft branding, \
4+
telemetry, and Marketplace access; the OSS-licensed portions of the source are \
5+
the same code as github.com/microsoft/vscode but the assembled binary is \
6+
covered by the Microsoft Software License Terms."
7+
HOMEPAGE = "https://code.visualstudio.com/"
8+
9+
# Microsoft's distributed VSCode build is covered by the Microsoft Software
10+
# License Terms; the embedded Chromium and Node.js components are BSD / MIT.
11+
# We pin LIC_FILES_CHKSUM to LICENSES.chromium.html since it's the most
12+
# stable artefact across versions and exists in every architecture's tarball.
13+
LICENSE = "Proprietary"
14+
LIC_FILES_CHKSUM = "file://LICENSES.chromium.html;md5=56eefdb0904e3e5ddf43f1d2e7f9a379"
15+
16+
# Only the three Linux arches Microsoft actually ships pre-built binaries for.
17+
# riscv64 / mips / etc users have to build from source (out of scope for this
18+
# layer) or use a remote-development setup (code-server / openvscode-server).
19+
COMPATIBLE_HOST = "(x86_64|aarch64|arm).*-linux"
20+
21+
def get_vscode_arch(d):
22+
arch = d.getVar('HOST_ARCH')
23+
mapping = {
24+
'aarch64': 'arm64',
25+
'arm': 'armhf',
26+
'x86_64': 'x64',
27+
}
28+
return mapping.get(arch, '')
29+
30+
VSCODE_ARCH ?= "${@get_vscode_arch(d)}"
31+
32+
# Per-arch upload timestamps Microsoft embeds in the tarball URL. Bumping
33+
# the version means re-resolving these via
34+
# `curl -sLI https://update.code.visualstudio.com/latest/linux-$arch/stable`
35+
# and copying the timestamp out of the Location header.
36+
GIT_SHA = "0958016b2af9f09bb4257e0df4a95e2f90590f9f"
37+
TIMESTAMP-arm64 = "1778618964"
38+
TIMESTAMP-armhf = "1778618962"
39+
TIMESTAMP-x64 = "1778618960"
40+
41+
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}"
42+
43+
SRC_URI[vscode-x64.sha256sum] = "510426eb23d330bf25d84fe88e49a08d965d6b21957b82e196af7ccf7bdd882b"
44+
SRC_URI[vscode-arm64.sha256sum] = "69c0d1d0534cd4173e2b3dbee5d001ed5c2bd0c846bb22dca917312b64eb1baf"
45+
SRC_URI[vscode-armhf.sha256sum] = "1662d3dd08a3602544bc4ca1b091e04d5393a23414607b7c34f0570ebd0d5daa"
46+
47+
S = "${WORKDIR}/VSCode-linux-${VSCODE_ARCH}"
48+
49+
# These are arch-specific prebuilt ELFs, not noarch content; bin_package
50+
# inherits allarch which is wrong here. Override back to per-machine
51+
# packaging so an arm64 build and an x86_64 build produce distinct .ipks.
52+
inherit bin_package
53+
PACKAGE_ARCH = "${MACHINE_ARCH}"
54+
55+
do_install() {
56+
install -d ${D}${datadir}/vscode
57+
cp --preserve=mode,timestamps -R ${S}/. ${D}${datadir}/vscode/
58+
}
59+
60+
FILES:${PN} = "${datadir}/vscode"
61+
62+
# The shipped binaries are stripped and link against the host's glibc / X /
63+
# wayland stack; suppress Yocto QA checks that would otherwise complain
64+
# about them.
65+
INSANE_SKIP:${PN} += "already-stripped file-rdeps ldflags libdir arch staticdev"
66+
67+
# The Microsoft tarball includes its own libvulkan / chrome-sandbox under
68+
# /usr/share/vscode/; Yocto's debug-info split picks those up and stashes a
69+
# .debug/ next to them, which then trips the libdir QA check on ${PN}-dbg.
70+
# Same root cause as the main package; suppress it there too.
71+
INSANE_SKIP:${PN}-dbg += "libdir"

recipes-devtools/vscode/vscode_1.89.bb

Lines changed: 0 additions & 41 deletions
This file was deleted.

0 commit comments

Comments
 (0)