[libcamera-ci,RFC,v2,2/5] Add job to build deb package for libcamera
diff mbox series

Message ID 20260130160254.1770742-3-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • on-device-testing proof of concept
Related show

Commit Message

Barnabás Pőcze Jan. 30, 2026, 4:02 p.m. UTC
Add a job that builds a very specific deb package for testing
purposes for the given architectures.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

--
2.52.0

Comments

Jacopo Mondi Feb. 4, 2026, 9:27 a.m. UTC | #1
Hi Barnabás

On Fri, Jan 30, 2026 at 05:02:51PM +0100, Barnabás Pőcze wrote:
> Add a job that builds a very specific deb package for testing
> purposes for the given architectures.
>
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
>  gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
>
> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> index 6cc2026..66f4b5b 100644
> --- a/gitlab-ci.yml
> +++ b/gitlab-ci.yml
> @@ -320,6 +320,54 @@ build-package:cros:
>        - build/build.ninja
>        - libcamera-upstream-9999.tbz2
>
> +#
> +# Build and package libcamera for the purpose of running tests on a real device.
> +#
> +
> +build-deb-for-lc-compliance-testing:
> +  extends:
> +    - .fdo.distribution-image@debian
> +    - .libcamera-ci.debian:13
> +    - .libcamera-ci.scripts
> +  stage: build
> +  needs:
> +    - job: container-debian:13
> +      artifacts: false
> +  variables:
> +    BUILD_TYPE: debug
> +    MESON_OPTIONS: >-
> +      -D prefix=/usr
> +      -D debug=true
> +      -D optimization=2
> +      -D force_fallback_for="['gtest']"
> +      -D auto_features=disabled
> +      -D udev=enabled
> +      -D lc-compliance=enabled
> +      -D pipelines=rkisp1

Once we'll have more devices under test, this should probably build
all pipelines ?

> +  script:
> +    - echo "0.0.0-ci-build-$CI_COMMIT_SHA-job-$CI_JOB_ID-pipeline-$CI_PIPELINE_ID-project-$CI_PROJECT_PATH" > .tarball-version
> +    - $CI_PROJECT_DIR/.gitlab-ci/build-libcamera.sh
> +    - meson install -C build --destdir install
> +    - fpm -s dir -t deb
> +        -C build/install
> +        --architecture "$ARCH"
> +        --package libcamera.deb
> +        --name libcamera
> +        --description "$CI_COMMIT_SHA (job $CI_JOB_ID, pipeline $CI_PIPELINE_ID, project $CI_PROJECT_PATH)"
> +        --version "0.0.0"
> +  artifacts:
> +    when: always
> +    expire_in: 1 week
> +    paths:
> +      - build/meson-logs/
> +      - build/build.ninja
> +      - "*.deb"
> +  parallel:
> +    matrix:
> +      - ARCH:
> +        - arm64
> +
> +
>  # ------------------------------------------------------------------------------
>  # Lint stage - Run checkstyle.py and check merge suitability
>  # ------------------------------------------------------------------------------
> --
> 2.52.0
Barnabás Pőcze Feb. 4, 2026, 9:42 a.m. UTC | #2
2026. 02. 04. 10:27 keltezéssel, Jacopo Mondi írta:
> Hi Barnabás
> 
> On Fri, Jan 30, 2026 at 05:02:51PM +0100, Barnabás Pőcze wrote:
>> Add a job that builds a very specific deb package for testing
>> purposes for the given architectures.
>>
>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
>> ---
>>   gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 48 insertions(+)
>>
>> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
>> index 6cc2026..66f4b5b 100644
>> --- a/gitlab-ci.yml
>> +++ b/gitlab-ci.yml
>> @@ -320,6 +320,54 @@ build-package:cros:
>>         - build/build.ninja
>>         - libcamera-upstream-9999.tbz2
>>
>> +#
>> +# Build and package libcamera for the purpose of running tests on a real device.
>> +#
>> +
>> +build-deb-for-lc-compliance-testing:
>> +  extends:
>> +    - .fdo.distribution-image@debian
>> +    - .libcamera-ci.debian:13
>> +    - .libcamera-ci.scripts
>> +  stage: build
>> +  needs:
>> +    - job: container-debian:13
>> +      artifacts: false
>> +  variables:
>> +    BUILD_TYPE: debug
>> +    MESON_OPTIONS: >-
>> +      -D prefix=/usr
>> +      -D debug=true
>> +      -D optimization=2
>> +      -D force_fallback_for="['gtest']"
>> +      -D auto_features=disabled
>> +      -D udev=enabled
>> +      -D lc-compliance=enabled
>> +      -D pipelines=rkisp1
> 
> Once we'll have more devices under test, this should probably build
> all pipelines ?

Yes.


> 
>> +  script:
>> +    - echo "0.0.0-ci-build-$CI_COMMIT_SHA-job-$CI_JOB_ID-pipeline-$CI_PIPELINE_ID-project-$CI_PROJECT_PATH" > .tarball-version
>> +    - $CI_PROJECT_DIR/.gitlab-ci/build-libcamera.sh
>> +    - meson install -C build --destdir install
>> +    - fpm -s dir -t deb
>> +        -C build/install
>> +        --architecture "$ARCH"
>> +        --package libcamera.deb
>> +        --name libcamera
>> +        --description "$CI_COMMIT_SHA (job $CI_JOB_ID, pipeline $CI_PIPELINE_ID, project $CI_PROJECT_PATH)"
>> +        --version "0.0.0"
>> +  artifacts:
>> +    when: always
>> +    expire_in: 1 week
>> +    paths:
>> +      - build/meson-logs/
>> +      - build/build.ninja
>> +      - "*.deb"
>> +  parallel:
>> +    matrix:
>> +      - ARCH:
>> +        - arm64
>> +
>> +
>>   # ------------------------------------------------------------------------------
>>   # Lint stage - Run checkstyle.py and check merge suitability
>>   # ------------------------------------------------------------------------------
>> --
>> 2.52.0
Jacopo Mondi Feb. 5, 2026, 10:58 a.m. UTC | #3
Hi Barnabás

On Wed, Feb 04, 2026 at 10:42:55AM +0100, Barnabás Pőcze wrote:
> 2026. 02. 04. 10:27 keltezéssel, Jacopo Mondi írta:
> > Hi Barnabás
> >
> > On Fri, Jan 30, 2026 at 05:02:51PM +0100, Barnabás Pőcze wrote:
> > > Add a job that builds a very specific deb package for testing
> > > purposes for the given architectures.
> > >
> > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> > > ---
> > >   gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
> > >   1 file changed, 48 insertions(+)
> > >
> > > diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> > > index 6cc2026..66f4b5b 100644
> > > --- a/gitlab-ci.yml
> > > +++ b/gitlab-ci.yml
> > > @@ -320,6 +320,54 @@ build-package:cros:
> > >         - build/build.ninja
> > >         - libcamera-upstream-9999.tbz2
> > >
> > > +#
> > > +# Build and package libcamera for the purpose of running tests on a real device.
> > > +#
> > > +
> > > +build-deb-for-lc-compliance-testing:
> > > +  extends:
> > > +    - .fdo.distribution-image@debian
> > > +    - .libcamera-ci.debian:13
> > > +    - .libcamera-ci.scripts
> > > +  stage: build
> > > +  needs:
> > > +    - job: container-debian:13
> > > +      artifacts: false
> > > +  variables:
> > > +    BUILD_TYPE: debug
> > > +    MESON_OPTIONS: >-
> > > +      -D prefix=/usr
> > > +      -D debug=true
> > > +      -D optimization=2
> > > +      -D force_fallback_for="['gtest']"
> > > +      -D auto_features=disabled
> > > +      -D udev=enabled
> > > +      -D lc-compliance=enabled
> > > +      -D pipelines=rkisp1
> >
> > Once we'll have more devices under test, this should probably build
> > all pipelines ?
>
> Yes.
>

This was more a "should we do it right away" question

>
> >
> > > +  script:
> > > +    - echo "0.0.0-ci-build-$CI_COMMIT_SHA-job-$CI_JOB_ID-pipeline-$CI_PIPELINE_ID-project-$CI_PROJECT_PATH" > .tarball-version
> > > +    - $CI_PROJECT_DIR/.gitlab-ci/build-libcamera.sh
> > > +    - meson install -C build --destdir install
> > > +    - fpm -s dir -t deb
> > > +        -C build/install
> > > +        --architecture "$ARCH"
> > > +        --package libcamera.deb
> > > +        --name libcamera
> > > +        --description "$CI_COMMIT_SHA (job $CI_JOB_ID, pipeline $CI_PIPELINE_ID, project $CI_PROJECT_PATH)"
> > > +        --version "0.0.0"
> > > +  artifacts:
> > > +    when: always
> > > +    expire_in: 1 week
> > > +    paths:
> > > +      - build/meson-logs/
> > > +      - build/build.ninja
> > > +      - "*.deb"
> > > +  parallel:
> > > +    matrix:
> > > +      - ARCH:
> > > +        - arm64
> > > +
> > > +
> > >   # ------------------------------------------------------------------------------
> > >   # Lint stage - Run checkstyle.py and check merge suitability
> > >   # ------------------------------------------------------------------------------
> > > --
> > > 2.52.0
>
Barnabás Pőcze Feb. 5, 2026, 11:02 a.m. UTC | #4
2026. 02. 05. 11:58 keltezéssel, Jacopo Mondi írta:
> Hi Barnabás
> 
> On Wed, Feb 04, 2026 at 10:42:55AM +0100, Barnabás Pőcze wrote:
>> 2026. 02. 04. 10:27 keltezéssel, Jacopo Mondi írta:
>>> Hi Barnabás
>>>
>>> On Fri, Jan 30, 2026 at 05:02:51PM +0100, Barnabás Pőcze wrote:
>>>> Add a job that builds a very specific deb package for testing
>>>> purposes for the given architectures.
>>>>
>>>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
>>>> ---
>>>>    gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
>>>>    1 file changed, 48 insertions(+)
>>>>
>>>> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
>>>> index 6cc2026..66f4b5b 100644
>>>> --- a/gitlab-ci.yml
>>>> +++ b/gitlab-ci.yml
>>>> @@ -320,6 +320,54 @@ build-package:cros:
>>>>          - build/build.ninja
>>>>          - libcamera-upstream-9999.tbz2
>>>>
>>>> +#
>>>> +# Build and package libcamera for the purpose of running tests on a real device.
>>>> +#
>>>> +
>>>> +build-deb-for-lc-compliance-testing:
>>>> +  extends:
>>>> +    - .fdo.distribution-image@debian
>>>> +    - .libcamera-ci.debian:13
>>>> +    - .libcamera-ci.scripts
>>>> +  stage: build
>>>> +  needs:
>>>> +    - job: container-debian:13
>>>> +      artifacts: false
>>>> +  variables:
>>>> +    BUILD_TYPE: debug
>>>> +    MESON_OPTIONS: >-
>>>> +      -D prefix=/usr
>>>> +      -D debug=true
>>>> +      -D optimization=2
>>>> +      -D force_fallback_for="['gtest']"
>>>> +      -D auto_features=disabled
>>>> +      -D udev=enabled
>>>> +      -D lc-compliance=enabled
>>>> +      -D pipelines=rkisp1
>>>
>>> Once we'll have more devices under test, this should probably build
>>> all pipelines ?
>>
>> Yes.
>>
> 
> This was more a "should we do it right away" question

If it is not restricted, then meson picks up dependencies from the build environment
that are not present in the root file system image. I have submitted multiple changes
related to that, those would need to be merged before pipelines=auto or pipelines=all
can be set.


> 
>>
>>>
>>>> +  script:
>>>> +    - echo "0.0.0-ci-build-$CI_COMMIT_SHA-job-$CI_JOB_ID-pipeline-$CI_PIPELINE_ID-project-$CI_PROJECT_PATH" > .tarball-version
>>>> +    - $CI_PROJECT_DIR/.gitlab-ci/build-libcamera.sh
>>>> +    - meson install -C build --destdir install
>>>> +    - fpm -s dir -t deb
>>>> +        -C build/install
>>>> +        --architecture "$ARCH"
>>>> +        --package libcamera.deb
>>>> +        --name libcamera
>>>> +        --description "$CI_COMMIT_SHA (job $CI_JOB_ID, pipeline $CI_PIPELINE_ID, project $CI_PROJECT_PATH)"
>>>> +        --version "0.0.0"
>>>> +  artifacts:
>>>> +    when: always
>>>> +    expire_in: 1 week
>>>> +    paths:
>>>> +      - build/meson-logs/
>>>> +      - build/build.ninja
>>>> +      - "*.deb"
>>>> +  parallel:
>>>> +    matrix:
>>>> +      - ARCH:
>>>> +        - arm64
>>>> +
>>>> +
>>>>    # ------------------------------------------------------------------------------
>>>>    # Lint stage - Run checkstyle.py and check merge suitability
>>>>    # ------------------------------------------------------------------------------
>>>> --
>>>> 2.52.0
>>
Barnabás Pőcze Feb. 9, 2026, 12:16 p.m. UTC | #5
2026. 02. 05. 14:03 keltezéssel, Laurent Pinchart írta:
> Hi Barnabás,
> 
> Thank you for the patch.
> 
> On Fri, Jan 30, 2026 at 05:02:51PM +0100, Barnabás Pőcze wrote:
>> Add a job that builds a very specific deb package for testing
>> purposes for the given architectures.
>>
>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
>> ---
>>   gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
>>   1 file changed, 48 insertions(+)
>>
>> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
>> index 6cc2026..66f4b5b 100644
>> --- a/gitlab-ci.yml
>> +++ b/gitlab-ci.yml
>> @@ -320,6 +320,54 @@ build-package:cros:
>>         - build/build.ninja
>>         - libcamera-upstream-9999.tbz2
>>
>> +#
>> +# Build and package libcamera for the purpose of running tests on a real device.
>> +#
>> +
>> +build-deb-for-lc-compliance-testing:
>> +  extends:
>> +    - .fdo.distribution-image@debian
>> +    - .libcamera-ci.debian:13
>> +    - .libcamera-ci.scripts
>> +  stage: build
>> +  needs:
>> +    - job: container-debian:13
>> +      artifacts: false
>> +  variables:
>> +    BUILD_TYPE: debug
>> +    MESON_OPTIONS: >-
>> +      -D prefix=/usr
>> +      -D debug=true
>> +      -D optimization=2
>> +      -D force_fallback_for="['gtest']"
>> +      -D auto_features=disabled
>> +      -D udev=enabled
>> +      -D lc-compliance=enabled
>> +      -D pipelines=rkisp1
>> +  script:
>> +    - echo "0.0.0-ci-build-$CI_COMMIT_SHA-job-$CI_JOB_ID-pipeline-$CI_PIPELINE_ID-project-$CI_PROJECT_PATH" > .tarball-version
> 
> I suppose using the correct version number instead of 0.0.0 may be
> difficult.

I tried using `utils/gen-version.sh`, but due to `GIT_DEPTH: 1` that won't
find any tags. So I guess it would have to be extracted it from meson.build:

   meson rewrite kwargs info project / | jq -r '.kwargs."project#/".version'

But this of course requires that a string literal is present in meson.build
and not something like `version : run_command(...)`. This is currently
the case.

Presumably we could also add support for a file whose contents are appended
to the version string. Similarly to CONFIG_LOCALVERSION of linux. That would
remove the need for such "hacks".

Thoughts?

> 
>> +    - $CI_PROJECT_DIR/.gitlab-ci/build-libcamera.sh
>> +    - meson install -C build --destdir install
>> +    - fpm -s dir -t deb
>> +        -C build/install
>> +        --architecture "$ARCH"
>> +        --package libcamera.deb
>> +        --name libcamera
>> +        --description "$CI_COMMIT_SHA (job $CI_JOB_ID, pipeline $CI_PIPELINE_ID, project $CI_PROJECT_PATH)"
>> +        --version "0.0.0"
> 
> I'd like to move this to a shell script in .gitlab-ci/, to keep the yaml
> file easier to read. Using scripts has also an advantage during
> development: you can push a new version of the script and re-run the job
> in an existing pipeline without running a new pipeline. It shortens the
> development cycles.

Done.


> 
>> +  artifacts:
>> +    when: always
>> +    expire_in: 1 week
>> +    paths:
>> +      - build/meson-logs/
>> +      - build/build.ninja
>> +      - "*.deb"
>> +  parallel:
>> +    matrix:
>> +      - ARCH:
>> +        - arm64
>> +
>> +
>>   # ------------------------------------------------------------------------------
>>   # Lint stage - Run checkstyle.py and check merge suitability
>>   # ------------------------------------------------------------------------------
>
Laurent Pinchart Feb. 9, 2026, 10:04 p.m. UTC | #6
On Mon, Feb 09, 2026 at 01:16:14PM +0100, Barnabás Pőcze wrote:
> 2026. 02. 05. 14:03 keltezéssel, Laurent Pinchart írta:
> > On Fri, Jan 30, 2026 at 05:02:51PM +0100, Barnabás Pőcze wrote:
> >> Add a job that builds a very specific deb package for testing
> >> purposes for the given architectures.
> >>
> >> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> >> ---
> >>   gitlab-ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
> >>   1 file changed, 48 insertions(+)
> >>
> >> diff --git a/gitlab-ci.yml b/gitlab-ci.yml
> >> index 6cc2026..66f4b5b 100644
> >> --- a/gitlab-ci.yml
> >> +++ b/gitlab-ci.yml
> >> @@ -320,6 +320,54 @@ build-package:cros:
> >>         - build/build.ninja
> >>         - libcamera-upstream-9999.tbz2
> >>
> >> +#
> >> +# Build and package libcamera for the purpose of running tests on a real device.
> >> +#
> >> +
> >> +build-deb-for-lc-compliance-testing:
> >> +  extends:
> >> +    - .fdo.distribution-image@debian
> >> +    - .libcamera-ci.debian:13
> >> +    - .libcamera-ci.scripts
> >> +  stage: build
> >> +  needs:
> >> +    - job: container-debian:13
> >> +      artifacts: false
> >> +  variables:
> >> +    BUILD_TYPE: debug
> >> +    MESON_OPTIONS: >-
> >> +      -D prefix=/usr
> >> +      -D debug=true
> >> +      -D optimization=2
> >> +      -D force_fallback_for="['gtest']"
> >> +      -D auto_features=disabled
> >> +      -D udev=enabled
> >> +      -D lc-compliance=enabled
> >> +      -D pipelines=rkisp1
> >> +  script:
> >> +    - echo "0.0.0-ci-build-$CI_COMMIT_SHA-job-$CI_JOB_ID-pipeline-$CI_PIPELINE_ID-project-$CI_PROJECT_PATH" > .tarball-version
> > 
> > I suppose using the correct version number instead of 0.0.0 may be
> > difficult.
> 
> I tried using `utils/gen-version.sh`, but due to `GIT_DEPTH: 1` that won't
> find any tags. So I guess it would have to be extracted it from meson.build:
> 
>    meson rewrite kwargs info project / | jq -r '.kwargs."project#/".version'
> 
> But this of course requires that a string literal is present in meson.build
> and not something like `version : run_command(...)`. This is currently
> the case.
> 
> Presumably we could also add support for a file whose contents are appended
> to the version string. Similarly to CONFIG_LOCALVERSION of linux. That would
> remove the need for such "hacks".
> 
> Thoughts?

I'd say it's probably not worth the effort as we have the commit's SHA1.

> >> +    - $CI_PROJECT_DIR/.gitlab-ci/build-libcamera.sh
> >> +    - meson install -C build --destdir install
> >> +    - fpm -s dir -t deb
> >> +        -C build/install
> >> +        --architecture "$ARCH"
> >> +        --package libcamera.deb
> >> +        --name libcamera
> >> +        --description "$CI_COMMIT_SHA (job $CI_JOB_ID, pipeline $CI_PIPELINE_ID, project $CI_PROJECT_PATH)"
> >> +        --version "0.0.0"
> > 
> > I'd like to move this to a shell script in .gitlab-ci/, to keep the yaml
> > file easier to read. Using scripts has also an advantage during
> > development: you can push a new version of the script and re-run the job
> > in an existing pipeline without running a new pipeline. It shortens the
> > development cycles.
> 
> Done.
> 
> >> +  artifacts:
> >> +    when: always
> >> +    expire_in: 1 week
> >> +    paths:
> >> +      - build/meson-logs/
> >> +      - build/build.ninja
> >> +      - "*.deb"
> >> +  parallel:
> >> +    matrix:
> >> +      - ARCH:
> >> +        - arm64
> >> +
> >> +
> >>   # ------------------------------------------------------------------------------
> >>   # Lint stage - Run checkstyle.py and check merge suitability
> >>   # ------------------------------------------------------------------------------

Patch
diff mbox series

diff --git a/gitlab-ci.yml b/gitlab-ci.yml
index 6cc2026..66f4b5b 100644
--- a/gitlab-ci.yml
+++ b/gitlab-ci.yml
@@ -320,6 +320,54 @@  build-package:cros:
       - build/build.ninja
       - libcamera-upstream-9999.tbz2

+#
+# Build and package libcamera for the purpose of running tests on a real device.
+#
+
+build-deb-for-lc-compliance-testing:
+  extends:
+    - .fdo.distribution-image@debian
+    - .libcamera-ci.debian:13
+    - .libcamera-ci.scripts
+  stage: build
+  needs:
+    - job: container-debian:13
+      artifacts: false
+  variables:
+    BUILD_TYPE: debug
+    MESON_OPTIONS: >-
+      -D prefix=/usr
+      -D debug=true
+      -D optimization=2
+      -D force_fallback_for="['gtest']"
+      -D auto_features=disabled
+      -D udev=enabled
+      -D lc-compliance=enabled
+      -D pipelines=rkisp1
+  script:
+    - echo "0.0.0-ci-build-$CI_COMMIT_SHA-job-$CI_JOB_ID-pipeline-$CI_PIPELINE_ID-project-$CI_PROJECT_PATH" > .tarball-version
+    - $CI_PROJECT_DIR/.gitlab-ci/build-libcamera.sh
+    - meson install -C build --destdir install
+    - fpm -s dir -t deb
+        -C build/install
+        --architecture "$ARCH"
+        --package libcamera.deb
+        --name libcamera
+        --description "$CI_COMMIT_SHA (job $CI_JOB_ID, pipeline $CI_PIPELINE_ID, project $CI_PROJECT_PATH)"
+        --version "0.0.0"
+  artifacts:
+    when: always
+    expire_in: 1 week
+    paths:
+      - build/meson-logs/
+      - build/build.ninja
+      - "*.deb"
+  parallel:
+    matrix:
+      - ARCH:
+        - arm64
+
+
 # ------------------------------------------------------------------------------
 # Lint stage - Run checkstyle.py and check merge suitability
 # ------------------------------------------------------------------------------