Opened 2 years ago

Closed 23 months ago

Last modified 23 months ago

#24361 closed defect (fixed)

rbm gives an error if a build script contains a wide character

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

Description

When a build script contains a wide character, rbm fails with the following error:

Error: Template Error:
undef error - Wide character in null operation at input text line 1.

The reason is that in var/build_id, we call sha256 on the content of the build script, which is using the sha256_hex function, which doesn't support wide characters:
http://perldoc.perl.org/Digest/SHA.html#UNICODE-AND-SIDE-EFFECTS

We currently don't use any build script with wide character in tor-browser-build. However the file projects/tor-browser/RelativeLink/start-tor-browser does contain a wide character (curly quotes: ”), which is a problem if we want to use it as a template (for #21998).

Child Tickets

Change History (8)

comment:1 Changed 2 years ago by boklm

Keywords: TorBrowserTeam201712R added; TorBrowserTeam201712 removed
Status: newneeds_review

The branch bug_24361 in my git repo has a patch to fix this:
https://gitweb.torproject.org/user/boklm/rbm.git/commit/?h=bug_24361&id=134cad4e79471d7baa82f00b4a6e2d7f7d11868a

This change should not modify the sha256sum of build scripts which do not contain any wide character. I checked that the var/build_id value (which is doing a sha256 on the build script and all dependencies) reported by the following commands is identical with and without the patch:

./rbm/rbm showconf --target alpha --target torbrowser-linux-x86_64 tor-browser var/build_id
./rbm/rbm showconf --target alpha --target torbrowser-windows-x86_64 tor-browser var/build_id
./rbm/rbm showconf --target alpha --target torbrowser-osx-x86_64 tor-browser var/build_id

comment:2 Changed 23 months ago by boklm

Status: needs_reviewneeds_revision

This fix is not enough as we get an other error after that:

Wide character in syswrite at /usr/share/perl5/File/Slurp.pm line 506.

comment:3 in reply to:  2 ; Changed 23 months ago by boklm

Status: needs_revisionneeds_review

Replying to boklm:

This fix is not enough as we get an other error after that:

Wide character in syswrite at /usr/share/perl5/File/Slurp.pm line 506.

I added a second commit to branch bug_24361 fixing this error:
https://gitweb.torproject.org/user/boklm/rbm.git/commit/?h=bug_24361&id=8b6831b36becc697fc53e61cac058d18096ea4b9

After merging this commit, we will also need to update the README file in tor-browser-build to add Path::Tiny / libpath-tiny-perl to the list of dependencies, and removing File::Slurp / libfile-slurp-perl.

comment:4 Changed 23 months ago by boklm

Parent ID: #21998

comment:5 Changed 23 months ago by gk

Keywords: TorBrowserTeam201711R added; TorBrowserTeam201712R removed

comment:6 in reply to:  3 ; Changed 23 months ago by gk

Resolution: fixed
Status: needs_reviewclosed

Replying to boklm:

Replying to boklm:

This fix is not enough as we get an other error after that:

Wide character in syswrite at /usr/share/perl5/File/Slurp.pm line 506.

I added a second commit to branch bug_24361 fixing this error:
https://gitweb.torproject.org/user/boklm/rbm.git/commit/?h=bug_24361&id=8b6831b36becc697fc53e61cac058d18096ea4b9

Looks good. I merged your branch to master (commits 8b6831b36becc697fc53e61cac058d18096ea4b9 and 6406e0684a379d13188886f747ed57060925efaf).

After merging this commit, we will also need to update the README file in tor-browser-build to add Path::Tiny / libpath-tiny-perl to the list of dependencies, and removing File::Slurp / libfile-slurp-perl.

Done in commit a6d54303ad89af777a4994dc27d0ae90945f090c on master. I adapted main.yml as well.

comment:7 in reply to:  6 ; Changed 23 months ago by boklm

Replying to gk:


After merging this commit, we will also need to update the README file in tor-browser-build to add Path::Tiny / libpath-tiny-perl to the list of dependencies, and removing File::Slurp / libfile-slurp-perl.

Done in commit a6d54303ad89af777a4994dc27d0ae90945f090c on master. I adapted main.yml as well.

I fixed the package name (File::Tiny => Path::Tiny) in commit 39b88a7e8b03877bf478cafd1b72e9abc5694ca6.

comment:8 in reply to:  7 Changed 23 months ago by gk

Replying to boklm:

Replying to gk:


After merging this commit, we will also need to update the README file in tor-browser-build to add Path::Tiny / libpath-tiny-perl to the list of dependencies, and removing File::Slurp / libfile-slurp-perl.

Done in commit a6d54303ad89af777a4994dc27d0ae90945f090c on master. I adapted main.yml as well.

I fixed the package name (File::Tiny => Path::Tiny) in commit 39b88a7e8b03877bf478cafd1b72e9abc5694ca6.

Ugh, sorry. I applied a fixup to clean up the remaining read_file() in commit 5c89374df7957238a9565c0b938ee3f30f880438 the rbm repo and bumped the rbm revision in tor-browser-build in commit 57b65bcc24372b0d7eaff35bd8cf5089fd33b035. I hope we are finally done here now. :)

Note: See TracTickets for help on using tickets.