Git Product home page Git Product logo

action-debian-package's Introduction

Build Debian package GitHub Action

An action that builds a Debian package from source in a Docker container.

Usage

See action.yml file in this repository for available options.

- name: Build Debian package
  uses: dawidd6/action-debian-package@v1

action-debian-package's People

Contributors

dawidd6 avatar dependabot-preview[bot] avatar dependabot[bot] avatar ennorehling avatar nantiferov avatar sebkuzminsky avatar waja avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

action-debian-package's Issues

Broken build on Ubuntu 14.04 (trusty)

Hello,

Thank you for this GitHub action, it's pretty easy and nice to use ๐Ÿ˜Š.

I know that this OS is quite outdated, but I tried to build deb package for Ubuntu 14.04 (trusty) with your action and got error at Install build dependencies stage. It seems that apt-get in old Ubuntu is unable to detect that it's a local package and wants to find information about package in deb-src repos.

Install build dependencies
  /usr/bin/docker exec package_name apt-get build-dep -yq -t trusty /home/runner/work/dir/dir/package_name
  Reading package lists...
  Building dependency tree...
  Reading state information...
  E: You must put some 'source' URIs in your sources.list

Seems that there is no other way to force to apt-get to just read local DEBIAN/control.

I tested it locally and I think that could be kinda fixed just by skipping this step. dpkg-buildpackage is building package successfully cause I don't have much build-time dependencies and they're installed during previous step apt-get install -yq -t trusty dpkg-dev debhelper devscripts.
Or parsing of Build-Depends could be added to action.

The same package build is successful for Ubuntu 16.04/18.04.

I can prepare PR with skipping apt-get build-dep step for Ubuntu 14.04.

Let caller pass in extra options to `docker create`

The "normal" way to run Github Actions in docker is to use jobs.<job_id>.container. This lets the user pass extra args to docker create using jobs.<job_id>.container.options. We in the LinuxCNC project use this to enable some extra capabilities we need for testing inside the container: https://github.com/LinuxCNC/linuxcnc/blob/master/.github/workflows/ci.yml#L66-L75.

But the Github ubuntu-* runners do not have qemu-user-static installed, so you can only run docker containers of the native CPU architecture.

I really want to use action-debian-package because it installs qemu-user-static, so it supports building on different CPU architectures. But it doesn't support options, so our test suite can't run.

This issue is a feature request: please add a way for the user to specify extra options to docker create.

pwd doesn't look like a git repository ..

I'm getting this error message when building a Debian packages for my project.

Run dawidd6/[email protected]
> Get image name
> Print details
> Create container
> Start container
> Prepare environment
> Update packages list
> Install development packages
> Trust this git repo
> Install build dependencies
v Create tarball
  /usr/bin/docker exec csmapfx git-deborig HEAD
  pwd doesn't look like a git repository ..
  Error: The process '/usr/bin/docker' failed with exit code 128

The full job log in question is here:
https://github.com/ennorehling/csmapfx/actions/runs/3719532423/jobs/6308448425

output package file name?

It would be nice if this action had a (documented) output for the filename of the package that was built, for use in later steps.

QEMU package not found

This line:

            await exec.exec("wget", ["http://mirrors.kernel.org/ubuntu/pool/universe/q/qemu/qemu-user-static_5.2+dfsg-9ubuntu2_amd64.deb", "-O", "/tmp/qemu.deb"])

produces this error:

  HTTP request sent, awaiting response... 301 Moved Permanently
  Location: http://mirrors.edge.kernel.org/ubuntu/pool/universe/q/qemu/qemu-user-static_5.2+dfsg-9ubuntu2_amd64.deb [following]
  --2022-08-27 12:57:56--  http://mirrors.edge.kernel.org/ubuntu/pool/universe/q/qemu/qemu-user-static_5.2+dfsg-9ubuntu2_amd64.deb
  Resolving mirrors.edge.kernel.org (mirrors.edge.kernel.org)... 147.75.199.223, 2604:1380:45d1:ec00::1
  Connecting to mirrors.edge.kernel.org (mirrors.edge.kernel.org)|147.75.199.223|:80... connected.
  HTTP request sent, awaiting response... 404 Not Found
  2022-08-27 12:57:56 ERROR 404: Not Found.

That hard-coded 5.2 version of the package isn't there, only 4.2 and 6.2 exist at http://mirrors.edge.kernel.org/ubuntu/pool/universe/q/qemu/

Creating tarballs has troubles with symlinks

Hi there,

while trying this on https://github.com/waja/imapsync, I've spotted issues with symlinks which point to not existing locations:

Inside the tarball:

waja@packaging:/tmp/imapsync-1.945$ ls -la | grep ^l
lrwxrwxrwx  1 waja waja     18 Nov  8 16:40 dist -> imapsync-1.945ist2
lrwxrwxrwx  1 waja waja     34 Nov  8 16:40 FAQ -> imapsync-1.945AQ.d/FAQ.General.txt
lrwxrwxrwx  1 waja waja     38 Nov  8 16:40 INSTALL -> imapsync-1.945NSTALL.d/INSTALL.ANY.txt
lrwxrwxrwx  1 waja waja     19 Nov  8 16:40 README.txt -> imapsync-1.945EADME

Origin directory:

waja@packaging:/tmp/imapsync (github_ci)$ ls -la | grep ^l
lrwxrwxrwx  1 waja waja     21 Jul 16 17:23 FAQ -> FAQ.d/FAQ.General.txt
lrwxrwxrwx  1 waja waja     25 Jul 16 17:23 INSTALL -> INSTALL.d/INSTALL.ANY.txt
lrwxrwxrwx  1 waja waja      6 Jul 16 17:23 README.txt -> README
lrwxrwxrwx  1 waja waja      5 Jul 16 17:23 dist -> dist2

Thanks and with kind regard, Jan.

Workaround for Raspberry Pi self-hosted runner

This issue isn't really within the scope of this repo to fix, but I wanted to document my experience in case anyone else has the same issue.

I'm running this action on a self-hosted Raspberry Pi runner with the standard Raspberry Pi OS based on Debian Buster. I was running into an issue that the debian:unstable Docker container couldn't run apt update due to GPG issues:

/usr/bin/docker exec kel-agent apt-get update
  Get:1 http://deb.debian.org/debian unstable InRelease [150 kB]
  Err:1 http://deb.debian.org/debian unstable InRelease
    At least one invalid signature was encountered.
  Reading package lists...
  W: GPG error: http://deb.debian.org/debian unstable InRelease: At least one invalid signature was encountered.
  E: The repository 'http://deb.debian.org/debian unstable InRelease' is not signed.
  Error: The process '/usr/bin/docker' failed with exit code 100

I found a solution in Ask Ubuntu; there's a patched version of libseccomp2 that hasn't made it to Debian production release yet, but installing it from unstable in the Raspberry Pi OS host will solve the issue and allow the Docker container to run apt update.

Hopefully this won't be a problem for long.

`apt-get install -t ${DIST}` fails to resolve package dependencies in some situations

Hi there, first of all thanks for this super useful action.

We of the LinuxCNC project use this action to verify our mesaflash debian package. Unfortunately, lately it's been failing due to a problem with apt's dependency resolver.

The problem is due to the current set of packages available in debian's package archive, in combination with the action's use of apt-get's "-t ${DISTRO}" argument. The problem is easily reproducible in a local docker container.

start a debian:bullseye container

$ docker run --tty --interactive debian:bullseye bash

apt-get update

root@9dc7d19b5bf7:/# apt-get update
Get:1 http://deb.debian.org/debian bullseye InRelease [116 kB]
Get:2 http://deb.debian.org/debian-security bullseye-security InRelease [48.4 kB]
Get:3 http://deb.debian.org/debian bullseye-updates InRelease [44.1 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 Packages [8184 kB]
Get:5 http://deb.debian.org/debian-security bullseye-security/main amd64 Packages [194 kB]
Get:6 http://deb.debian.org/debian bullseye-updates/main amd64 Packages [14.6 kB]
Fetched 8600 kB in 4s (2283 kB/s)
Reading package lists... Done

The state of libtool

Note that libtool depends on libc6-dev.

root@9dc7d19b5bf7:/# apt-cache show libtool
Package: libtool
Version: 2.4.6-15
Installed-Size: 1198
Maintainer: Alastair McKinstry <[email protected]>
Architecture: all
Depends: gcc | c-compiler, cpp, libc6-dev | libc-dev, file, autotools-dev
Recommends: libltdl-dev
Suggests: libtool-doc, autoconf (>> 2.50), automaken, gfortran | fortran95-compiler, gcj-jdk
Conflicts: autoconf (<= 2.12), automake (<= 1.3), libtool1.4
Description: Generic library support script
Description-md5: 40ea3da4a4ea75419ad95742898b3e52
Multi-Arch: foreign
Homepage: https://www.gnu.org/software/libtool/
Tag: devel::buildtools, devel::lang:c, devel::lang:c++, devel::lang:fortran,
 devel::lang:java, devel::library, implemented-in::c,
 implemented-in::java, implemented-in::shell, interface::commandline,
 role::devel-lib, role::program, scope::utility, suite::gnu
Section: devel
Priority: optional
Filename: pool/main/libt/libtool/libtool_2.4.6-15_all.deb
Size: 513428
MD5sum: 788c07aacc71775beabe81a67a3ca67f
SHA256: 557c52ba883e442504044d2329c0343c75b8df2073b440793c75651ccf4d3fe1

The state of libc6-dev

Note that there are two versions available, one in bullseye and one in bullseye-updates.

root@9dc7d19b5bf7:/# apt-cache policy libc6-dev
libc6-dev:
  Installed: (none)
  Candidate: 2.31-13+deb11u5
  Version table:
     2.31-13+deb11u5 500
        500 http://deb.debian.org/debian bullseye-updates/main amd64 Packages
     2.31-13+deb11u4 500
        500 http://deb.debian.org/debian bullseye/main amd64 Packages

Installing libtool from bullseye (like action-debian-package does) fails

root@9dc7d19b5bf7:/# apt-get install -t bullseye libtool
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 libtool : Depends: libc6-dev but it is not installable or
                    libc-dev
E: Unable to correct problems, you have held broken packages.

It works with -t bullseye-updates

root@9dc7d19b5bf7:/# apt-get install -t bullseye-updates libtool 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  autoconf automake autotools-dev binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-10 file
  fontconfig-config fonts-dejavu-core gcc gcc-10 libasan6 libatomic1 libbinutils libbrotli1 libbsd0
  libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdeflate0 libexpat1
  libfontconfig1 libfreetype6 libgcc-10-dev libgd3 libgdbm-compat4 libgdbm6 libgomp1 libisl23 libitm1
  libjbig0 libjpeg62-turbo liblsan0 libltdl-dev libltdl7 libmagic-mgc libmagic1 libmd0 libmpc3 libmpfr6
  libnsl-dev libperl5.32 libpng16-16 libquadmath0 libsigsegv2 libtiff5 libtirpc-dev libtsan0 libubsan1
  libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev m4 manpages
  manpages-dev netbase perl perl-modules-5.32 sensible-utils ucf 
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc gettext binutils-doc cpp-doc gcc-10-locales gcc-multilib
  make flex bison gdb gcc-doc gcc-10-multilib gcc-10-doc glibc-doc libgd-tools gdbm-l10n libtool-doc
  gfortran | fortran95-compiler gcj-jdk m4-doc man-browser perl-doc libterm-readline-gnu-perl
  | libterm-readline-perl-perl libtap-harness-archive-perl
The following NEW packages will be installed:
  autoconf automake autotools-dev binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-10 file
  fontconfig-config fonts-dejavu-core gcc gcc-10 libasan6 libatomic1 libbinutils libbrotli1 libbsd0
  libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdeflate0 libexpat1
  libfontconfig1 libfreetype6 libgcc-10-dev libgd3 libgdbm-compat4 libgdbm6 libgomp1 libisl23 libitm1
  libjbig0 libjpeg62-turbo liblsan0 libltdl-dev libltdl7 libmagic-mgc libmagic1 libmd0 libmpc3 libmpfr6
  libnsl-dev libperl5.32 libpng16-16 libquadmath0 libsigsegv2 libtiff5 libtirpc-dev libtool libtsan0
  libubsan1 libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev m4 manpages
  manpages-dev netbase perl perl-modules-5.32 sensible-utils ucf 
0 upgraded, 72 newly installed, 0 to remove and 1 not upgraded.
Need to get 65.5 MB of archives.
After this operation, 255 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

And it works if I omit -t entirely

root@9dc7d19b5bf7:/# apt-get install libtool
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  autoconf automake autotools-dev binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-10 file
  fontconfig-config fonts-dejavu-core gcc gcc-10 libasan6 libatomic1 libbinutils libbrotli1 libbsd0
  libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdeflate0 libexpat1
  libfontconfig1 libfreetype6 libgcc-10-dev libgd3 libgdbm-compat4 libgdbm6 libgomp1 libisl23 libitm1
  libjbig0 libjpeg62-turbo liblsan0 libltdl-dev libltdl7 libmagic-mgc libmagic1 libmd0 libmpc3 libmpfr6
  libnsl-dev libperl5.32 libpng16-16 libquadmath0 libsigsegv2 libtiff5 libtirpc-dev libtsan0 libubsan1
  libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev m4 manpages
  manpages-dev netbase perl perl-modules-5.32 sensible-utils ucf 
Suggested packages:
  autoconf-archive gnu-standards autoconf-doc gettext binutils-doc cpp-doc gcc-10-locales gcc-multilib
  make flex bison gdb gcc-doc gcc-10-multilib gcc-10-doc glibc-doc libgd-tools gdbm-l10n libtool-doc
  gfortran | fortran95-compiler gcj-jdk m4-doc man-browser perl-doc libterm-readline-gnu-perl
  | libterm-readline-perl-perl libtap-harness-archive-perl
The following NEW packages will be installed:
  autoconf automake autotools-dev binutils binutils-common binutils-x86-64-linux-gnu cpp cpp-10 file
  fontconfig-config fonts-dejavu-core gcc gcc-10 libasan6 libatomic1 libbinutils libbrotli1 libbsd0
  libc-dev-bin libc-devtools libc6-dev libcc1-0 libcrypt-dev libctf-nobfd0 libctf0 libdeflate0 libexpat1
  libfontconfig1 libfreetype6 libgcc-10-dev libgd3 libgdbm-compat4 libgdbm6 libgomp1 libisl23 libitm1
  libjbig0 libjpeg62-turbo liblsan0 libltdl-dev libltdl7 libmagic-mgc libmagic1 libmd0 libmpc3 libmpfr6
  libnsl-dev libperl5.32 libpng16-16 libquadmath0 libsigsegv2 libtiff5 libtirpc-dev libtool libtsan0
  libubsan1 libwebp6 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxpm4 linux-libc-dev m4 manpages
  manpages-dev netbase perl perl-modules-5.32 sensible-utils ucf 
0 upgraded, 72 newly installed, 0 to remove and 1 not upgraded.
Need to get 65.5 MB of archives.
After this operation, 255 MB of additional disk space will be used.
Do you want to continue? [Y/n] n
Abort.

What's going on here?

The problem is that the debian:bullseye container was built with bullseye-updates enabled, so the installed version of libc6 is the one from bullseye-updates:

root@f31d136f7345:/# apt-cache policy libc6
libc6:
  Installed: 2.31-13+deb11u5
  Candidate: 2.31-13+deb11u5
  Version table:
 *** 2.31-13+deb11u5 500
        500 http://deb.debian.org/debian bullseye-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.31-13+deb11u4 500
        500 http://deb.debian.org/debian bullseye/main amd64 Packages

All libc6-dev packages have a versioned dependency on the matching libc6, so the older libc6-dev in bullseye won't install with the newer libc6 from bullseye-updates:

root@f31d136f7345:/# apt-cache show libc6-dev
Package: libc6-dev   
Source: glibc
Version: 2.31-13+deb11u5
Installed-Size: 14507
Maintainer: GNU Libc Maintainers <[email protected]>
Architecture: amd64
Provides: libc-dev
Depends: libc6 (= 2.31-13+deb11u5), libc-dev-bin (= 2.31-13+deb11u5), linux-libc-dev, libcrypt-dev, libnsl
-dev
Suggests: glibc-doc, manpages-dev
Conflicts: libc0.1-dev, libc0.3-dev, libc6.1-dev
Breaks: libc6-dev-amd64-cross (<< 2.31~), libgcc-10-dev (<< 10-20200321-1~), libgcc-7-dev (<< 7.5.0-6~), l
ibgcc-8-dev (<< 8.4.0-2~), libgcc-9-dev (<< 9.3.0-5~), libperl5.26 (<< 5.26.1-3), python3.7 (<< 3.7.7-1+b1
), python3.8 (<< 3.8.2-1+b1)
Description: GNU C Library: Development Libraries and Header Files
Description-md5: 1bbdc717d9acdb44db940928d570e749
Multi-Arch: same
Homepage: https://www.gnu.org/software/libc/libc.html
Build-Essential: yes
Tag: devel::lang:c, devel::library, implemented-in::c, role::devel-lib,
 suite::gnu
Section: libdevel
Priority: optional
Filename: pool/main/g/glibc/libc6-dev_2.31-13+deb11u5_amd64.deb
Size: 2359020
SHA256: eb2cb7cf94d0513aea5b0ab5463b11e75c7a94121604b3f3eda0a7128ea28bc6

Package: libc6-dev
Source: glibc
Version: 2.31-13+deb11u4
Installed-Size: 14508
Maintainer: GNU Libc Maintainers <[email protected]>
Architecture: amd64
Provides: libc-dev
Depends: libc6 (= 2.31-13+deb11u4), libc-dev-bin (= 2.31-13+deb11u4), linux-libc-dev, libcrypt-dev, libnsl
-dev
Suggests: glibc-doc, manpages-dev
Conflicts: libc0.1-dev, libc0.3-dev, libc6.1-dev
Breaks: libc6-dev-amd64-cross (<< 2.31~), libgcc-10-dev (<< 10-20200321-1~), libgcc-7-dev (<< 7.5.0-6~), l
ibgcc-8-dev (<< 8.4.0-2~), libgcc-9-dev (<< 9.3.0-5~), libperl5.26 (<< 5.26.1-3), python3.7 (<< 3.7.7-1+b1
), python3.8 (<< 3.8.2-1+b1)
Description: GNU C Library: Development Libraries and Header Files
Description-md5: 1bbdc717d9acdb44db940928d570e749
Multi-Arch: same
Homepage: https://www.gnu.org/software/libc/libc.html
Build-Essential: yes
Tag: devel::lang:c, devel::library, implemented-in::c, role::devel-lib,
 suite::gnu
Section: libdevel
Priority: optional
Filename: pool/main/g/glibc/libc6-dev_2.31-13+deb11u4_amd64.deb
Size: 2359752
MD5sum: 5dedeee9aa95d29dce351acfbd439aad
SHA256: 5f368eb89d102ccd23529a02fb17aaa1c15e7612506e22ef0c559b71f5049a91

What to do?

My initial reaction is to simply remove -t from the apt-get command line and let the package dependency resolver pick the package versions it wants from among the available options (as determined by the apt sources lists).
I see that you added -t in commit e535e3a specifically to support backports. But is the -t really needed in that situation? Maybe I'm missing something about how the rest of the action is set up (I didn't look too closely), but it seems to me that as long as the apt sources are set up correctly, apt's package dependency resolver will pick the correct package version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.