Skip to content

scripts and tools: Upgrade gitian image before signing - #15766

Merged
laanwj merged 1 commit into
bitcoin:masterfrom
hebasto:20190407-gitian-upgrade-image
May 9, 2019
Merged

laanwj merged 1 commit into
bitcoin:masterfrom
hebasto:20190407-gitian-upgrade-image

Conversation

@hebasto

@hebasto hebasto commented Apr 7, 2019

Copy link
Copy Markdown
Member

The package upgrade in the Ubuntu repositories in the period between the building and the signing causes (particularly, using LXC) an error:

Creating package manifest
Could not download some packages, please run gbuild --upgrade

For example, the busybox-initramfs package was upgraded from 1:1.27.2-2ubuntu3.1 to 1:1.27.2-2ubuntu3.2 on 2019-03-06.

This PR forces gitian image upgrade for the --sign command.

Ref:
devrandom/gitian-builder/target-bin/grab-packages.sh

#!/bin/sh

# Get an installed package manifest

set -e

cd /var/cache/apt/archives

# make sure all packages with installed versions are downloaded
# (except for held packages, which may not be available for download)
dpkg-query -W -f '${Status}\t${Package}=${Version}\n' | grep -v ^hold | cut -f2- | xargs -n 50 apt-get install -q --reinstall -y -d > /tmp/download.log
grep "cannot be downloaded" /tmp/download.log && { echo Could not download some packages, please run gbuild --upgrade 1>&2 ; exit 1 ; }
sha256sum *.deb | sort --key 2

@laanwj

laanwj commented Apr 10, 2019

Copy link
Copy Markdown
Member

It's unfortunate that this is needed, as the upgrade step makes VM setup much slower, but I think it is, I've seen similar issues outside this script
utACK beda0da

@hebasto

hebasto commented Apr 19, 2019

Copy link
Copy Markdown
Member Author

@laanwj Thank you for your review.

It's unfortunate that this is needed, as the upgrade step makes VM setup much slower, but I think it is, I've seen similar issues outside this script

Since the current target image is reused (-i|--skip-image option), the upgrade step does not take much time (a dozen of seconds on my Core i3).

@hebasto

hebasto commented Apr 24, 2019

Copy link
Copy Markdown
Member Author

@ken2812221 would you mind reviewing this PR?

@fanquake

fanquake commented May 8, 2019

Copy link
Copy Markdown
Member

utACK beda0da

@laanwj
laanwj merged commit beda0da into bitcoin:master May 9, 2019
laanwj added a commit that referenced this pull request May 9, 2019
beda0da Upgrade gitian image before signing (Hennadii Stepanov)

Pull request description:

  The package upgrade in the Ubuntu repositories in the period between the building and the signing causes (particularly, using LXC) an error:
  ```
  Creating package manifest
  Could not download some packages, please run gbuild --upgrade
  ```

  For example, the [`busybox-initramfs`](https://packages.ubuntu.com/bionic/busybox-initramfs) package was [upgraded](http://changelogs.ubuntu.com/changelogs/pool/main/b/busybox/busybox_1.27.2-2ubuntu3.2/changelog) from `1:1.27.2-2ubuntu3.1` to `1:1.27.2-2ubuntu3.2` on 2019-03-06.

  This PR forces gitian image upgrade for the `--sign` command.

  Ref:
  [devrandom/gitian-builder/target-bin/grab-packages.sh](https://github.com/devrandom/gitian-builder/blob/04ab7c121842be8c5848b3de5076c8ded7761314/target-bin/grab-packages.sh)
  ```
  #!/bin/sh

  # Get an installed package manifest

  set -e

  cd /var/cache/apt/archives

  # make sure all packages with installed versions are downloaded
  # (except for held packages, which may not be available for download)
  dpkg-query -W -f '${Status}\t${Package}=${Version}\n' | grep -v ^hold | cut -f2- | xargs -n 50 apt-get install -q --reinstall -y -d > /tmp/download.log
  grep "cannot be downloaded" /tmp/download.log && { echo Could not download some packages, please run gbuild --upgrade 1>&2 ; exit 1 ; }
  sha256sum *.deb | sort --key 2
  ```

ACKs for commit beda0d:
  laanwj:
    utACK beda0da
  fanquake:
    utACK beda0da

Tree-SHA512: e2e3b3e3719e098d266ceec39bd69b950344a4eb2f43ae6ad3e696add70f743b363cc83676e339f7caa207d6478029869a8af01fe1f6d5690d2857003f7d8ce8
@hebasto
hebasto deleted the 20190407-gitian-upgrade-image branch May 9, 2019 17:31
UdjinM6 pushed a commit to UdjinM6/dash that referenced this pull request Sep 2, 2021
…igning

beda0da Upgrade gitian image before signing (Hennadii Stepanov)

Pull request description:

  The package upgrade in the Ubuntu repositories in the period between the building and the signing causes (particularly, using LXC) an error:
  ```
  Creating package manifest
  Could not download some packages, please run gbuild --upgrade
  ```

  For example, the [`busybox-initramfs`](https://packages.ubuntu.com/bionic/busybox-initramfs) package was [upgraded](http://changelogs.ubuntu.com/changelogs/pool/main/b/busybox/busybox_1.27.2-2ubuntu3.2/changelog) from `1:1.27.2-2ubuntu3.1` to `1:1.27.2-2ubuntu3.2` on 2019-03-06.

  This PR forces gitian image upgrade for the `--sign` command.

  Ref:
  [devrandom/gitian-builder/target-bin/grab-packages.sh](https://github.com/devrandom/gitian-builder/blob/04ab7c121842be8c5848b3de5076c8ded7761314/target-bin/grab-packages.sh)
  ```
  #!/bin/sh

  # Get an installed package manifest

  set -e

  cd /var/cache/apt/archives

  # make sure all packages with installed versions are downloaded
  # (except for held packages, which may not be available for download)
  dpkg-query -W -f '${Status}\t${Package}=${Version}\n' | grep -v ^hold | cut -f2- | xargs -n 50 apt-get install -q --reinstall -y -d > /tmp/download.log
  grep "cannot be downloaded" /tmp/download.log && { echo Could not download some packages, please run gbuild --upgrade 1>&2 ; exit 1 ; }
  sha256sum *.deb | sort --key 2
  ```

ACKs for commit beda0d:
  laanwj:
    utACK beda0da
  fanquake:
    utACK beda0da

Tree-SHA512: e2e3b3e3719e098d266ceec39bd69b950344a4eb2f43ae6ad3e696add70f743b363cc83676e339f7caa207d6478029869a8af01fe1f6d5690d2857003f7d8ce8
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants