Skip to content

Resolving wrong dependency for Alpine build #2137

@jessequinn

Description

@jessequinn

Using the following melange.yaml

package:
  name: nginx-njs-custom
  version: "1.29.1"
  epoch: 0
  description: HTTP and reverse proxy server (mainline version)
  copyright:
    - license: BSD-2-Clause
  target-architecture:
    - x86_64

vars:
  njs_version: "0.9.1"
  njs_version_commit: 4fd3ff98e413ede57c88456cf84b116a8382061a

environment:
  contents:
    repositories:
      - https://dl-cdn.alpinelinux.org/alpine/edge/main
      - https://dl-cdn.alpinelinux.org/alpine/edge/community
    packages:
      - alpine-baselayout-data
      - busybox
      - ca-certificates-bundle
      - build-base
      - automake
      - autoconf
      - brotli-dev
      - gd-dev
      - geoip-dev
      - libmaxminddb-dev
      - libxml2-dev
      - libxslt-dev
      - openssl-dev
      - pcre-dev
      - perl-dev
      - pkgconf
      - zeromq-dev
      - zlib-dev
      - luajit-dev
      - linux-headers

pipeline:
  - uses: git-checkout
    with:
      repository: https://github.com/nginx/nginx.git
      tag: release-${{package.version}}
      expected-commit: 0024724f2f77ac4fa0d7394e859608d6844a5914
      destination: nginx-mainline

  - uses: git-checkout
    with:
      repository: https://github.com/nginx/njs
      tag: ${{vars.njs_version}}
      expected-commit: ${{vars.njs_version_commit}}
      destination: njs

  - name: configure
    working-directory: nginx-mainline
    runs: |
      export LUAJIT_LIB="$(pkgconf --variable=libdir luajit)"
      export LUAJIT_INC="$(pkgconf --variable=includedir luajit)"

      ./configure \
          --prefix=/var/lib/nginx \
          --sbin-path=/usr/sbin/nginx \
          --modules-path=/var/lib/nginx/modules \
          --conf-path=/etc/nginx/nginx.conf \
          --pid-path=/run/nginx/nginx.pid \
          --lock-path=/run/nginx/nginx.lock \
          --http-client-body-temp-path=/var/lib/nginx/tmp/client_body \
          --http-proxy-temp-path=/var/lib/nginx/tmp/proxy \
          --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi \
          --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi \
          --http-scgi-temp-path=/var/lib/nginx/tmp/scgi \
          --with-perl_modules_path=/usr/lib/perl5/vendor_perl \
          \
          --user=nginx \
          --group=nginx \
          --with-threads \
          --with-file-aio \
          \
          --without-pcre2 \
          \
          --with-compat \
          \
          --with-http_ssl_module \
          --with-http_v2_module \
          --with-http_realip_module \
          --with-http_addition_module \
          --with-http_xslt_module=dynamic \
          --with-http_image_filter_module=dynamic \
          --with-http_geoip_module=dynamic \
          --with-http_sub_module \
          --with-http_dav_module \
          --with-http_flv_module \
          --with-http_mp4_module \
          --with-http_gunzip_module \
          --with-http_gzip_static_module \
          --with-http_auth_request_module \
          --with-http_random_index_module \
          --with-http_secure_link_module \
          --with-http_degradation_module \
          --with-http_slice_module \
          --with-http_stub_status_module \
          --with-http_perl_module=dynamic \
          --with-mail=dynamic \
          --with-mail_ssl_module \
          --with-stream \
          --with-stream_ssl_module \
          --with-stream_realip_module \
          --with-stream_geoip_module=dynamic \
          --with-stream_ssl_preread_module \
          \
          --add-dynamic-module=/home/build/njs/nginx

  - runs: |
      make DESTDIR=${{targets.destdir}} install

      # default error logs to standard error
      echo 'error_log  stderr  notice;' >> ${{targets.destdir}}/etc/nginx/nginx.conf

  - uses: strip

I receive the following error:

ERRO failed to build package: unable to build guest: unable to lock image configuration: resolving apk packages: for arch "amd64": solving "gd-dev" constraint: resolving "gd-dev-2.3.3-r10.apk" deps:
we already selected "freetype-dev=2.13.3-r0" which conflicts with "pc:freetype2>=9.8.3"

For whatever reason package-config is trying to grab the wrong package. Alpine freetype2 points to freetype-dev. Any information would be greatly appreciated.

melange version: 0.30.6

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions