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

[Build] Failed to build isc dhcp #13281

Closed
Junchao-Mellanox opened this issue Jan 6, 2023 · 1 comment · Fixed by #13288
Closed

[Build] Failed to build isc dhcp #13281

Junchao-Mellanox opened this issue Jan 6, 2023 · 1 comment · Fixed by #13288
Labels

Comments

@Junchao-Mellanox
Copy link
Collaborator

Junchao-Mellanox commented Jan 6, 2023

Description

Build failed due to

16:51:17  make[1]: Entering directory '/sonic/src/isc-dhcp'
16:51:17  # Remove any stale files
16:51:17  rm -rf ./isc-dhcp-4.4.1
16:51:17  # Get isc-dhcp release, debian files
16:51:17  dget http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1-2.3.dsc
16:51:17  pushd ./isc-dhcp-4.4.1
16:51:17  # Create a git repository here for stg to apply patches
16:51:17  git init
16:51:17  git add -f *
16:51:17  git commit -qm "initial commit"
16:51:17  # Apply patches
16:51:17  stg init
16:51:17  stg import -s ../patch/series
16:51:17  # Build source and Debian packages
16:51:17  dpkg-buildpackage -rfakeroot -b -us -uc -j30 --admindir /sonic/dpkg/tmp.lJosSFVurg
16:51:17  popd
16:51:17  # Move the newly-built .deb packages to the destination directory
16:51:17  mv isc-dhcp-relay-dbgsym_4.4.1-2.3_amd64.deb isc-dhcp-relay_4.4.1-2.3_amd64.deb /sonic/target/debs/bullseye/
16:51:17  dget: retrieving http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1-2.3.dsc
16:51:17  get_url_version http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1-2.3.dsc failed
16:51:17  dget: curl isc-dhcp_4.4.1-2.3.dsc http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1-2.3.dsc failed

The root cause is that isc-dhcp_4.4.1-2.3.dsc is no longer available.

Steps to reproduce the issue:

Build sonic

Describe the results you received:

dget: curl isc-dhcp_4.4.1-2.3.dsc http://deb.debian.org/debian/pool/main/i/isc-dhcp/isc-dhcp_4.4.1-2.3.dsc failed

Describe the results you expected:

No error

Output of show version:

(paste your output here)

Output of show techsupport:

(paste your output here or download and attach the file here )

Additional information you deem important (e.g. issue happens only occasionally):

@guillaumelambert
Copy link
Contributor

I proposed a PR for this at
#13288

@lguohan lguohan linked a pull request Jan 8, 2023 that will close this issue
guillaumelambert added a commit to guillaumelambert/sonic-buildimage that referenced this issue Jan 13, 2023
- create an a apt alternate configuration directory during 'make init'
- use 'apt-get source' instead of dget in makefiles
- adapt packages versions accordingly in rules/XX.mk files

SONiC images compilation is currently designed to be performed with a
non-root user under Ubuntu systems.
As a result, there is no guarantee that debian repos are declared in
/etc/apt/sources.list on the Ubuntu host system used.
Although for this reason 'apt-get source' can not be directly used
(out of the box) to that purpose, the build process recompiles packages
for various GNU+Linux Debian distributions.
And the packages sources used are retrieved from more or less official
repositories since the current solution in SONiC is to use dget and URLs
from various locations.
As discussed in the following URL
https://serverfault.com/questions/447457/use-apt-get-source-on-a-debian-repo-without-using-etc-apt-source-list
this is the simplest solution but it has several drawbacks from a
maintenance and security standpoint, for example :
* maintaining manually these URLS since they can be removed by external
  sites owners
sonic-net#13281
* potential loose authentication of packages sources
sonic-net#13302

A more complex solution is prosposed (on the same URL) and adress these
drawbacks by using an alternate apt configuration directory that is writable
by non-root user. It allows here to:
* identify packages sources with official Debian Keyring GPG signatures
* use 'apt-get source <pkgsrc_name>' to retrieve packages without maintaining
  several specific URLs
* in a next step use 'apt-cache showsrc <pkgsrc_name>' to retrieve a
  list of available versions to ckeck packages availability during the
  'make init' phase

Signed-off-by: Guillaume Lambert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants