Opened 2 years ago

Closed 2 years ago

#23557 closed task (fixed)

rbm should download again an input file if it is not matching the expected sha256sum

Reported by: boklm Owned by: boklm
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-rbm, TorBrowserTeam201709R
Cc: tbb-team Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

When an input file of type URL is already present in the out/ directory, we use it without downloading it again. This is a problem in the case of #23396 where we want to be able to use a new version of a file without changing its filename.

To solve this, rbm should download again a file when the existing file does not match the expected sha256sum.

Child Tickets

Change History (7)

comment:1 Changed 2 years ago by boklm

Keywords: TorBrowserTeam201709R added; TorBrowserTeam201709 removed
Status: assignedneeds_review

I created a branch bug_23557_v2 on my oniongit rbm repo, with a patch to fix that:
https://oniongit.eu/boklm/rbm/commits/bug_23557_v2

comment:2 Changed 2 years ago by gk

Keywords: TorBrowserTeam201709 added; TorBrowserTeam201709R removed
Status: needs_reviewneeds_revision

Hm, how is that supposed to work? I did the following:

1) Added

-  - URL: https://people.torproject.org/~mikeperry/mirrors/sources/msvcr100.dll
-    sha256sum: 1221a09484964a6f38af5e34ee292b9afefccb3dc6e55435fd3aaf7c235d9067
+  - URL: https://people.torproject.org/~gk/mirrors/sources/msvcr100.dll
+    sha256sum: 8793353461826fbd48f25ea8b835be204b758ce7510db2af631b28850355bd18

to my tor-browser-build instance.
2) I verified that the sha256sum value is "1221a09484964a6f38af5e34ee292b9afefccb3dc6e55435fd3aaf7c235d9067" for the msvcr100.dll file I have in out/firefox
3) I cloned rbm and applied the patch in this ticket
4) I did /path/to/cloned_rbm/rbm fetch in my tor-browser-build directory
5) I verified that the sha256sum value is still the same as in 2)

If I am doing something wrong, let me know and just put that ticket back in needs_review.

comment:3 in reply to:  2 Changed 2 years ago by boklm

Status: needs_revisionneeds_review

Replying to gk:

4) I did /path/to/cloned_rbm/rbm fetch in my tor-browser-build directory

The fetch command is only used for fetching new commits from git/hg, but it does not fetch the other types of files. To do that you have to start a new build.

So you need to run something like:

/path/to/cloned_rbm/rbm build release --target testbuild --target torbrowser-windows-i686

comment:4 Changed 2 years ago by boklm

To test the patch on a computer where doing a full build would take too much time, I created the file projects/bug_23557/config with this content:

# vim: filetype=yaml sw=2
version: 1

build: |
  #!/bin/sh
  echo ok
input_files:
  - URL: https://people.torproject.org/~boklm/tmp/msvcr100.dll
    sha256sum: 8793353461826fbd48f25ea8b835be204b758ce7510db2af631b28850355bd18

Then I ran:

/path/to/rbm build bug_23557

Checked the hash of the file in out/bug_23557/msvcr100.dll.

Updated the URL and hash of msvcr100.dll in projects/bug_23557/config, then ran again:

/path/to/rbm build bug_23557

Then checked that out/bug_23557/msvcr100.dll was changed.

comment:5 Changed 2 years ago by gk

Okay, added a discussion item.

comment:6 Changed 2 years ago by gk

Keywords: TorBrowserTeam201709R added; TorBrowserTeam201709 removed

comment:7 Changed 2 years ago by gk

Resolution: fixed
Status: needs_reviewclosed

Looks good. Applied to master (commit 236fcaac2012531330f21d2e9cce49a534a03b60) and I pushed a tor-browser-build commit (a27578e6fd0daf2f2133c6e179d968417bc3547d) to pick up the rbm changes.

Note: See TracTickets for help on using tickets.