centos8 rpm build with odd runtime deps

Bug #1886107 reported by Ryan Harper
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init (Ubuntu)
Undecided
Paride Legovini

Bug Description

% ./tools/run-container centos/8 --package --artifacts=.
...
% rpm -U cloud-init-20.2+89.g818da27a-1.el8.noarch.rpm
Command: rpm -U /tmp/cloud-init-20.2+89.g818da27a-1.el8.noarch.rpm
Exit code: 1
Reason: -
Stdout:
Stderr: error: Failed dependencies:
                 python3-devel is needed by cloud-init-20.2+89.g818da27a-1.el8.noarch
                 sudo is needed by cloud-init-20.2+89.g818da27a-1.el8.noarch

python3-devel has to be a build-dep;
sudo is require though.

Revision history for this message
Paride Legovini (paride) wrote :

Hi Ryan,

This happens because `tools/read-dependencies --distro` joins the 'requires' and 'build-requires' defined in pkg-deps.json, the file that specifies the distro-specific deps. See this line specifically:

https://github.com/canonical/cloud-init/blob/master/tools/read-dependencies#L227

This doesn't happen when building the .deb package because we let debhelper calculate the dependencies, and packages/bddeb doesn't need to touch the Depends: line.

In order to avoid the odd dependencies I don't see other way than making read-dependencies distinguish between build-deps and runtime-deps.

RFC: We could add --runtime-only-deps to read-dependencies. When this is specified the build-requires from pkg-deps.json won't be appended to the list of dependencies. Then packages/brpm will have to be taught about this, looks easy at first glance.

WDYT?

Changed in cloud-init (Ubuntu):
assignee: nobody → Paride Legovini (legovini)
status: New → Triaged
Revision history for this message
Ryan Harper (raharper) wrote :

I think we want two flags; keep the default behavior of all deps output: and then

--build-requires # print the build package requirements
--requires # print the runtime package requirements

Then brpm needs to be updated to call read-deps with those two flags, and adjust its build-requires and requires accordingly.

Revision history for this message
Dan Watkins (oddbloke) wrote :
Changed in cloud-init (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.4 KiB)

This bug was fixed in the package cloud-init - 20.3-0ubuntu1

---------------
cloud-init (20.3-0ubuntu1) groovy; urgency=medium

  * New upstream release.
    - Release 20.3 (#547) [James Falcon] (LP: #1892878)
    - tox: bump the pylint version to 2.6.0 in the default run (#544)
      [Paride Legovini]
    - Azure: Add netplan driver filter when using hv_netvsc driver (#539)
      [James Falcon] (LP: #1830740)
    - query: do not handle non-decodable non-gzipped content (#543)
    - DHCP sandboxing failing on noexec mounted /var/tmp (#521) [Eduardo Otubo]
    - Update the list of valid ssh keys. (#487)
      [Ole-Martin Bratteng] (LP: #1877869)
    - cmd: cloud-init query to handle compressed userdata (#516) (LP: #1889938)
    - Pushing cloud-init log to the KVP (#529) [Moustafa Moustafa]
    - Add Alpine Linux support. (#535) [dermotbradley]
    - Detect kernel version before swap file creation (#428) [Eduardo Otubo]
    - cli: add devel make-mime subcommand (#518)
    - user-data: only verify mime-types for TYPE_NEEDED and x-shellscript
      (#511) (LP: #1888822)
    - DataSourceOracle: retry twice (and document why we retry at all) (#536)
    - Refactor Azure report ready code (#468) [Johnson Shi]
    - tox.ini: pin correct version of httpretty in xenial{,-dev} envs (#531)
    - Support Oracle IMDSv2 API (#528) [James Falcon]
    - .travis.yml: run a doc build during CI (#534)
    - doc/rtd/topics/datasources/ovf.rst: fix doc8 errors (#533)
    - Fix 'Users and Groups' configuration documentation (#530) [sshedi]
    - cloudinit.distros: update docstrings of add_user and create_user (#527)
    - Fix headers for device types in network v2 docs (#532)
      [Caleb Xavier Berger]
    - Add AlexBaranowski as contributor (#508) [Aleksander Baranowski]
    - DataSourceOracle: refactor to use only OPC v1 endpoint (#493)
    - .github/workflows/stale.yml: s/Josh/Rick/ (#526)
    - Fix a typo in apt pipelining module (#525) [Xiao Liang]
    - test_util: parametrize devlist tests (#523) [James Falcon]
    - Recognize LABEL_FATBOOT labels (#513) [James Falcon] (LP: #1841466)
    - Handle additional identifier for SLES For HPC (#520) [Robert Schweikert]
    - Revert "test-requirements.txt: pin pytest to <6 (#512)" (#515)
    - test-requirements.txt: pin pytest to <6 (#512)
    - Add "tsanghan" as contributor (#504) [tsanghan]
    - fix brpm building (LP: #1886107)
    - Adding eandersson as a contributor (#502) [Erik Olof Gunnar Andersson]
    - azure: disable bouncing hostname when setting hostname fails (#494)
      [Anh Vo]
    - VMware: Support parsing DEFAULT-RUN-POST-CUST-SCRIPT (#441)
      [xiaofengw-vmware]
    - DataSourceAzure: Use ValueError when JSONDecodeError is not available
      (#490) [Anh Vo]
    - cc_ca_certs.py: fix blank line problem when removing CAs and adding
      new one (#483) [dermotbradley]
    - freebsd: py37-serial is now py37-pyserial (#492) [Gonéri Le Bouder]
    - ssh exit with non-zero status on disabled user (#472)
      [Eduardo Otubo] (LP: #1170059)
    - cloudinit: remove global disable of pylint W0107 and fix errors (#489)
    - networking: refactor wait_for_physdevs from cloudinit.net (#466)
      (LP: #1884...

Read more...

Changed in cloud-init (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers