Bug 388180 - Error after all packages built successfully
Summary: Error after all packages built successfully
Status: RESOLVED FIXED
Alias: None
Product: kdesrc-build
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-23 19:53 UTC by Denis Kurz
Modified: 2017-12-24 00:26 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In: 18.01
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Denis Kurz 2017-12-23 19:53:30 UTC
I used kdesrc-build to build the kde-pim group in a fresh kdepim-docker container. See https://community.kde.org/KDE_PIM/Docker for details on this Neon-based image; I had to install libyaml-libyaml-perl inside the container manually.

After all 58 packages built successfully, I got the following (error?) message:

Encountered an error in the execution of the script.
The error reported was hash- or arrayref expected (not a simple scalar, use allow_nonref to allow this) at /home/neon/kdesrc-build/modules/ksb/BuildContext.pm line 829.
 at /usr/share/perl/5.22/JSON/PP.pm line 504.
	JSON::PP::encode_error("hash- or arrayref expected (not a simple scalar, use allow_no"...) called at /usr/share/perl/5.22/JSON/PP.pm line 289
	JSON::PP::PP_encode_json(JSON::PP=HASH(0x47577a0), undef) called at /usr/share/perl/5.22/JSON/PP.pm line 143
	JSON::PP::encode(JSON::PP=HASH(0x47577a0), undef) called at /home/neon/kdesrc-build/modules/ksb/BuildContext.pm line 829
	ksb::BuildContext::storePersistentOptions(ksb::BuildContext=HASH(0x26b2100)) called at /home/neon/kdesrc-build/modules/ksb/Application.pm line 740
	ksb::Application::finish(ksb::Application=HASH(0x3ef8b50), 0) called at ./kdesrc-build line 288
	eval {...} called at ./kdesrc-build line 271

Please submit a bug against kdesrc-build on https://bugs.kde.org/
Comment 1 Michael Pyne 2017-12-23 22:39:25 UTC
I bet this is related to a first-use bug, let me see if I can reproduce.  Thanks for the report as well!
Comment 2 Michael Pyne 2017-12-23 23:16:56 UTC
Git commit 25e7bfc26fbacbfeb3875e75df02fa9409571d4e by Michael Pyne.
Committed on 23/12/2017 at 23:13.
Pushed by mpyne into branch 'master'.

persistence: Fix regression in saving options.

The move to JSON storage of persistent opts break first-time users,
since the refactored code never actually gets around to setting a
persistent_options key in the build context object.

This seemed to work previously with Data::Dumper, but JSON::PP is not
happy with being asked to serialize an undef.  On the other hand I had
always thought that sub setPersistentOption would have 'autovivified'
the needed hash table, and the reporter's build process should have
resulted in many calls to setPersistentOption over the build.
FIXED-IN:18.01

M  +1    -1    modules/ksb/BuildContext.pm

https://commits.kde.org/kdesrc-build/25e7bfc26fbacbfeb3875e75df02fa9409571d4e
Comment 3 Michael Pyne 2017-12-24 00:26:59 UTC
Git commit b0f4b638c7cb4fa0033ddfb86d393a25f8c90eb8 by Michael Pyne.
Committed on 24/12/2017 at 00:26.
Pushed by mpyne into branch 'testing-restructure'.

test: Add unit test for bug 388180 first-use persistent options.

Fails without the bugfix, passes afterwards.

A  +53   -0    t/persistent-storage.t

https://commits.kde.org/kdesrc-build/b0f4b638c7cb4fa0033ddfb86d393a25f8c90eb8