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

How to enable "backports" for a given release name? #9

Open
sarnold opened this issue Apr 10, 2024 · 4 comments
Open

How to enable "backports" for a given release name? #9

sarnold opened this issue Apr 10, 2024 · 4 comments

Comments

@sarnold
Copy link

sarnold commented Apr 10, 2024

Eg, how would I build a package for bookworm and enable bookworm backports? I'm trying to build a python package that uses hatchling which is fairly new. Thanks for any feedback (and thanks for this action!).

The current version of my workflow is here.

@jtdor
Copy link
Owner

jtdor commented Apr 12, 2024

Hi @sarnold.

First of all (this would be the easiest solution): For “hatchling”, I only found python3-hatchling, which seems to already be available in bookworm, not bookworm-backports. Is this the package you are looking for?

If not, about using backports or any other additional repository:
Currently (more on that at the end), there is no “high level” way to include additional repositories, like e.g. sbuild has it. But fortunately, since the action utilizes Docker containers, you can customize a number of things if required (This is not necessarily intended, but a side-effect of using Docker containers):

In your case, you could pass one of debian:stable-backports or debian:bookworm-backports to the action’s docker-image parameter. These images have backports readily added to their sources.list, as the name suggests.

Since backports by default have a low priority, you might (maybe try the above first) be required to additionally adjust priorities (this is the not so handy part). For that, you could place a small Dockerfile in your Git repo and use it for the package build. As an example:

FROM debian:bookworm-backports

RUN printf '\
Package: package-from-backports another-package-from-backports \n\
Pin: release o=Debian Backports \n\
Pin-Priority: 500 \n\
' >/etc/apt/preferences

Then use this Dockerfile with the docker-image parameter:

docker-image: repo/path/to/Dockerfile

See the corresponding test as an example.

Coming back to using additional APT repositories in general: I have a dormant branch about adding such a feature. There was also a recent PR by @leonheldattoradex about the idea—which I unfortunately totally did not find time and missed to reply to (sorry, @leonheldattoradex). I will take your question and @leonheldattoradex’s PR as a hint that using additional repos is a nice-to-have feature and look into it soon, hopefully next week :-)

@ofek
Copy link

ofek commented Apr 13, 2024

FYI I have a section in the installation docs that shows Hatchling availability in distros https://hatch.pypa.io/dev/install/#build-system-availability

@jwarnier
Copy link

jwarnier commented Jul 9, 2024

It is my understanding that you could just use https://github.com/jtdor/build-deb-action?tab=readme-ov-file#extra-repos to set the backports repo, and then use something like apt-opts: -t bookworm-backports to use it.

@jwarnier
Copy link

jwarnier commented Jul 9, 2024

BTW, this actually not an issue, but rather a discussion, so could also be turned into one, as you did before, @jtdor.

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

No branches or pull requests

4 participants