test: create integration workspace with bitbake-setup#535
Conversation
8b50cb3 to
2aa92a8
Compare
|
Follow-up: the latest commits fix the integration-test fallout from the bitbake-setup layout switch. The CI failures were caused by a few remaining assumptions from the old Poky layout:
Both CI jobs are now green on |
deribaucourt
left a comment
There was a problem hiding this comment.
Great job, there were a few technical problems I see, but you found a solution for them all! This first iteration should have thus already addressed all the pain points. I added some comments to simplify the implementation and align it even further with what should be the standard bitbake-setup practices.
I'm also discovering bitbake-setup, so feel free to come up with suggestions of your own :)
I'll be on summer vacation next week 😎. Please accept my apologies if I only respond later.
|
|
||
| const pathToBuildFolder = path.join(__dirname, '../../../../../integration-tests/project-folder/build') | ||
| const pathToEnvScript = path.join(__dirname, '../../../../../integration-tests/project-folder/sources/poky/oe-init-build-env') | ||
| const pathToBuildFolder = path.join(__dirname, '../../../../../integration-tests/project-folder/sources/poky/build') |
There was a problem hiding this comment.
build folder should not be under sources. We will use the sources directory only for our custom layers (meta-fixture, ...). Expected standard bitbake-setup directory structure is:
- integration-tests/project-folder/build
- integration-tests/project-folder/layers
Can you use this bitbake-setup argument to initialize the build folder in the following old path (integration-tests/project-folder/build)?
bitbake-setup --setting default top-dir-prefix integration-tests/project-folder
--setting default top-dir-name integration-tests
There was a problem hiding this comment.
I know it may be hard to do, but I would prefer if you rebase with the review fixes instead of pushing additional fixup commits on top.
| git clone --depth 1 --branch "$tag" "$url" "$destination" | ||
| git -C "$destination" checkout --detach "$commit" | ||
| cleanup() { | ||
| rm -rf "$BOOTSTRAP_DIR" |
There was a problem hiding this comment.
No need to remove the bitbake bootstrap at the end of this script, npm run clean used to handle cleaning up anything downloaded with npm run fetch. We will be needing it for testing future bitbake-setup features.
| YOCTO_DIR="resources/poky" | ||
| RESOURCES_DIR="resources" | ||
| YOCTO_DIR="$RESOURCES_DIR/poky" | ||
| BOOTSTRAP_DIR="$RESOURCES_DIR/.bitbake-setup-bootstrap" |
There was a problem hiding this comment.
Let's use a simpler folder: resources/bitbake.
| POKY_DISTRO="distro/poky" | ||
| POKY_MACHINE="machine/qemux86-64" | ||
|
|
||
| rm -rf "$YOCTO_DIR" "$BOOTSTRAP_DIR" |
There was a problem hiding this comment.
Similarly, cleanup is through npm run clean. Let's not touch this workflow for this PR.
|
|
||
| trap cleanup EXIT | ||
|
|
||
| POKY_CONFIGURATION="poky-wrynose" |
There was a problem hiding this comment.
We need a commit-pinned revision for the layers. We don't want to accidentally download an updated version and break our pipelines. We may need to define our own bitbake-setup json with pinned versions.
There was a problem hiding this comment.
Handled with a pinned source-overrides.json fixture under integration-tests/fixtures/bitbake-setup/. The integration workspace now passes it to bitbake-setup with --source-overrides, so the fetched sources are pinned to explicit commits instead of branch heads.
|
|
||
| YOCTO_DIR="resources/poky" | ||
| RESOURCES_DIR="resources" | ||
| YOCTO_DIR="$RESOURCES_DIR/poky" |
There was a problem hiding this comment.
I don't think Yocto layers should be downloaded to resources/poky anymore. The bitbake-setup standard setup is to put them under <top_dir>/layers. let's keep it as close to possible to standard.
Feel free to correct me if I'm wrong, I'm still new with bitbake-setup.
| import fs from 'fs' | ||
|
|
||
| export const integrationBitbakeFolder = path.join(__dirname, '../../../../integration-tests/project-folder/sources/poky/bitbake') | ||
| export const integrationBitbakeFolder = path.join(__dirname, '../../../../integration-tests/project-folder/sources/poky/layers/bitbake') |
There was a problem hiding this comment.
There is a dedicated commit to update the test path expectations. These changes should be moved to "
test: update integration expectations for bitbake-setup layout"
| # integration tests also run inside a container where the repository is mounted | ||
| # at a different path, so keep these locations relative to the active build | ||
| # directory. | ||
| DL_DIR ?= "${TOPDIR}/../../.bitbake-setup-downloads" |
There was a problem hiding this comment.
This should be generated by bitbake-setup, can't it?
Note that in CI, the DL, HASHSERVE and SSTATE caches are in different locations that are provided through main.yml:
env:
# NFS Yocto cache directories on the self-hosted runner
DL_DIR: /var/cache/yocto/yocto-dldir
SSTATE_DIR: /var/cache/yocto/yocto-sstate
BB_ENV_PASSTHROUGH_ADDITIONS: "DL_DIR SSTATE_DIR"
BTW, can you add a commit to add BB_SIGNATURE_HANDLER=OEBasicHash?
This will fix this Wrynose CI warning:
[9502](https://github.com/yoctoproject/vscode-bitbake/actions/runs/28238811952/job/83660175776#step:13:19503)
12:50:40.466 [Debug] WARNING: Sstate directory is shared between several builds (it is set via SSTATE_DIR to /var/cache/yocto/yocto-sstate),
but hash equivalency database is inside this particular build directory /var/github/github-runner/actions-runner/vscodeBitbake/_work/vscode-bitbake/vscode-bitbake/integration-tests/project-folder/build.
This will prevent sstate reuse, and it is recommended to set the location for the database to a common path
via BB_HASHSERVE_DB_DIR, for example:
BB_HASHSERVE_DB_DIR = "${SSTATE_DIR}"
There was a problem hiding this comment.
I did not add BB_SIGNATURE_HANDLER=OEBasicHash in this rework because the main build configuration is now generated by bitbake-setup, and I wanted to avoid reintroducing manual config edits in this PR. I can handle that as a focused follow-up if you prefer.
|
|
||
| mkdir -p "$YOCTO_DIR/build-crops" | ||
| cp -R "$YOCTO_DIR/build/conf" "$YOCTO_DIR/build-crops/conf" | ||
| cat > "$YOCTO_DIR/build-crops/conf/bblayers.conf" <<'EOF' |
There was a problem hiding this comment.
Same remark as native tests environment: should be provided as a bitbake-setup config file.
Also avoid embedding files in scripts when avoidable. They are harder to maintain and develop.
| insertTextIntoEmbeddedLanguageDoc(embeddedLanguageDoc, 0, 0, getBashHeader(embeddedLanguageDoc.originalUri)) | ||
| } | ||
|
|
||
| const getOpenEmbeddedCoreMetaFolder = (pokyFolder: string): string => { |
There was a problem hiding this comment.
The extension always made the assumption that poky/ contained bitbake/. This is no longer standard with bitbake-setup. However, this was how most existing projects used to do it, and we don't want to break compatibility with those!
I propose to keep the old behavior as it was. We'll need a new mechanism for bitbake-setup layer structures. I could think of:
- adding a new extension setting:
pathToLayers. Even then, bitbake-setup exotic configs might allow defining different layer structures? - trying to automatically detect the setup based on the settings we have
Could you take a look at what bitbake-setup could result in, and what would be the safe and simple solution to support both the new and the old structures?
There was a problem hiding this comment.
I kept the legacy behavior as the fallback and added a narrow detection path for the standard bitbake-setup layout. The helper class lookup now checks the old poky/meta structure first, then layers/openembedded-core/meta, and only uses a candidate if the expected global classes exist. This avoids introducing a new setting in this PR while keeping compatibility with existing projects.
|
Thanks a lot for the detailed review! I’ll keep an eye on the fort while you’re away. |
30e5b05 to
4a87bbe
Compare
8c5fce1 to
c59af33
Compare
|
I reworked the branch to make the integration workspace follow the standard
The BitBake bootstrap is now kept under I also added a pinned The main build configuration is now generated by Local checks pass:
|
638a14d to
a073798
Compare
a073798 to
e591fb6
Compare
Summary
bitbake-setupusing the standard layout underintegration-tests/project-folder.bitbake-setupdefaults:integration-tests/project-folder/buildintegration-tests/project-folder/layersintegration-tests/project-folder/configresources/bitbakefor futurebitbake-setuptests.bitbake-setupsource overrides for the fetched layers.build-cropswrapper/config as dedicated fixtures for the container-mounted command-wrapper test.This follows the direction discussed in #530: first update the integration test workspace to use a
bitbake-setupgenerated layout, without adding any new UX.Testing
npm run fetch:pokybash -n scripts/fetch-poky.shbash -n scripts/update-ref.shnpm run compilenpm run lintgit diff --check