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

Replace use of build-essential with constituent parts. #2096

Merged
merged 3 commits into from
Jan 2, 2025

Conversation

freakboy3742
Copy link
Member

@freakboy3742 freakboy3742 commented Dec 31, 2024

When building a system package on a Debian derivative, Briefcase checks for the build-essential meta-package as a pre-requisite. This ensures that gcc, g++, libc6-dev, make, and dpkg-dev are installed.

However, it is also possible to satisfy these requirements by installing those packages directly. This was done recently on GitHub Actions configurations, causing build failures (see beeware/toga#3051).

The immediate workaround is "just install the meta-package"; but installing a no-op package isn't a great option. This PR modifies the runtime check to look for the actual constituent packages.

The Dockerfiles will continue to install build-essential; but they will pass the system check because installing that meta-package will cause these constituent packages to be installed. However, we'll be able to verify an environment that doesn't have these packages installed; and the help message presented to the user will reference the meta-package, not the constituent packages.

Fixes beeware/toga#3051.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Copy link
Member

@rmartin16 rmartin16 left a comment

Choose a reason for hiding this comment

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

I found it isn't actually practical to test this. The dependencies for Toga ultimately require build-essential to be installed. So, one can't easily use apt to get a Debian system in to a state where Toga works but build-essential is not installed. Nonetheless, this works for me on jammy, noble, oracular, and even plucky.

@freakboy3742
Copy link
Member Author

I found it isn't actually practical to test this. The dependencies for Toga ultimately require build-essential to be installed. So, one can't easily use apt to get a Debian system in to a state where Toga works but build-essential is not installed.

Agreed that it's difficult to test - However, I'm not sure what you mean by this comment. Isn't that what Github Actions is doing (installing gcc et al, but not build-essential)?

@rmartin16
Copy link
Member

Yeah; thinking about it more, I was able to contrive such an environment. Notably, install toga-textual instead, remove system_requires, and use apt install --no-install-recommends dpkg-dev g++ gcc libc6-dev make to get the environment set up since build-essential is a recommended package of one them.

The GitHub runner image appears rather novel...seems like they are definitely cherry-picking packages to install.

@freakboy3742
Copy link
Member Author

Ok - in which case, I'll call this working and merge. Thanks for the extra manual validation.

@freakboy3742 freakboy3742 merged commit 76957a9 into beeware:main Jan 2, 2025
49 checks passed
@freakboy3742 freakboy3742 deleted the build-essential-base branch January 2, 2025 01:30
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.

Testbed failure in textual-linux
2 participants