Skip to content

Add feature: yoctoproject.org/bitbake#231

Merged
sebst merged 8 commits intomainfrom
copilot/add-yoctoproject-bitbake-feature
Mar 26, 2026
Merged

Add feature: yoctoproject.org/bitbake#231
sebst merged 8 commits intomainfrom
copilot/add-yoctoproject-bitbake-feature

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

Adds a new devcontainer feature to install BitBake, the Python-based task execution engine at the core of the Yocto Project build system.

New files

  • src/yoctoproject.org-bitbake/devcontainer-feature.json — id yoctoproject.org-bitbake, v1.0.0, version option (default latest)
  • src/yoctoproject.org-bitbake/install.sh — curl method; queries the GitHub API for the latest yocto-X.Y.Z tag on openembedded/bitbake, downloads the archive, extracts to /opt/bitbake, creates wrapper scripts in /usr/local/bin; installs python3 as a dependency and creates a python → python3 symlink when needed
  • src/yoctoproject.org-bitbake/NOTES.md — feature documentation
  • test/yoctoproject.org-bitbake/test.sh — validates bitbake --version exits 0 and contains "BitBake"

Updated

  • README.md — new row inserted alphabetically between yakitrak/notesmd-cli and yq

Install approach

BitBake ships no compiled binaries — its bin/ scripts use a relative sys.path insertion to find lib/. The tarball is extracted to /opt/bitbake, preserving that relationship. Rather than symlinking bin/* into /usr/local/bin (which causes Python to resolve __file__ incorrectly), small shell wrapper scripts are written to /usr/local/bin that invoke the real scripts by absolute path (exec "/opt/bitbake/bin/bitbake" "$@"), so Python correctly resolves the lib/ directory.

The source is the openembedded/bitbake GitHub repository (tags in the form yocto-X.Y.Z, e.g. yocto-5.3.2). The Yocto Project downloads page (downloads.yoctoproject.org/releases/bitbake/) only hosts Python 2-era versions (≤ 1.14.0) and is not used.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add feature yoctoproject.org/bitbake (id yoctoproject.org-bitbake)</issue_title>
<issue_description>https://downloads.yoctoproject.org/releases/bitbake/</issue_description>

Comments on the Issue (you are @copilot in this section)


⌨️ Start Copilot coding agent tasks without leaving your editor — available in VS Code, Visual Studio, JetBrains IDEs and Eclipse.

@sebst sebst marked this pull request as ready for review March 26, 2026 17:03
Copilot AI changed the title [WIP] Add feature yoctoproject.org/bitbake Add feature: yoctoproject.org/bitbake Mar 26, 2026
Copilot AI requested a review from sebst March 26, 2026 17:04
Copy link
Copy Markdown
Member

@sebst sebst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests fail

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 26, 2026

tests fail

Fixed in 50657c6. The failure was env: 'python': No such file or directory — older bitbake releases use #!/usr/bin/env python in their shebang. The install now creates a python → python3 symlink when python is not already present.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • downloads.yoctoproject.org
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from sebst March 26, 2026 17:09
Copy link
Copy Markdown
Member

@sebst sebst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests fail

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 26, 2026

tests fail

Fixed in 85d2bc5. The root cause was that symlinking bitbake into /usr/local/bin caused Python to see __file__ as /usr/local/bin/bitbake, so its os.path.dirname(os.path.dirname(__file__)) logic pointed to /usr/local/lib instead of /opt/bitbake/lib, resulting in ModuleNotFoundError: No module named 'bb'. The fix replaces the symlinks with small shell wrapper scripts that invoke the real scripts by their absolute path (exec "/opt/bitbake/bin/bitbake" "$@"), so Python correctly resolves the lib directory.

Copilot AI requested a review from sebst March 26, 2026 17:15
Copy link
Copy Markdown
Member

@sebst sebst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests fail

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 26, 2026

tests fail

Fixed in 3a666f7. Two issues needed to coexist: the wrapper scripts (instead of symlinks) so Python resolves lib/ relative to /opt/bitbake/bin/bitbake, and the python → python3 symlink for older bitbake releases whose shebang still uses #!/usr/bin/env python. The previous commit accidentally dropped the symlink fix — this commit restores both.

Copilot AI requested a review from sebst March 26, 2026 17:22
Copy link
Copy Markdown
Member

@sebst sebst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests still fail

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 26, 2026

tests still fail

Fixed in c7fe7cb. The root cause was the download source: https://downloads.yoctoproject.org/releases/bitbake/ only hosts Python 2-era versions (up to 1.14.0, which uses from commands import getstatusoutput — a Python 2 module removed in Python 3). The install now downloads from https://github.com/openembedded/bitbake using the yocto-X.Y.Z release tags (e.g. yocto-5.3.2), where modern Python 3 compatible BitBake releases live.

Copilot AI requested a review from sebst March 26, 2026 17:33
Copy link
Copy Markdown
Member

@sebst sebst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolve merge conflicts

…ect-bitbake-feature

# Conflicts:
#	README.md

Co-authored-by: sebst <592313+sebst@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 26, 2026

resolve merge conflicts

Resolved in 352ee5e. The only conflict was in README.md — main had added a yoctoproject.org row in the same area where our yoctoproject.org/bitbake row was. Both rows are now kept in alphabetical order.

Copilot AI requested a review from sebst March 26, 2026 17:37
Copy link
Copy Markdown
Member

@sebst sebst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests fail

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 26, 2026

tests fail

Fixed in e42fc78. The install was missing locale setup — bitbake requires en_US.UTF-8 to be available. Added apt_get_checkinstall python3 locales, echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen, and locale-gen to match how the yoctoproject.org feature handles it.

Copilot AI requested a review from sebst March 26, 2026 17:43
@sebst sebst merged commit acca49c into main Mar 26, 2026
7 checks passed
@sebst sebst deleted the copilot/add-yoctoproject-bitbake-feature branch March 26, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add feature yoctoproject.org/bitbake (id yoctoproject.org-bitbake)

2 participants