Bug 291357 - Can't use string as an ARRAY ref while "strict refs" in use at ./kdesrc-build line 336.
Summary: Can't use string as an ARRAY ref while "strict refs" in use at ./kdesrc-build...
Status: RESOLVED FIXED
Alias: None
Product: kdesrc-build
Classification: Developer tools
Component: general (show other bugs)
Version: Git
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Michael Pyne
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-12 11:06 UTC by David Faure
Modified: 2012-01-13 00:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Faure 2012-01-12 11:06:44 UTC
Version:           git (using Devel) 
OS:                Linux

 * Downloading projects.kde.org project database...
Script started processing at Thu Jan 12 12:03:54 2012
        Downloading KDE Project module metadata...
Updating kde-build-metadata
<<<  Build Process  >>>
Building cmake-git (1/20)
Encountered an error in the execution of the script.
The error reported was Can't use string ("/d/qt/4/qt-for-trunk/lib/pkgconf"...) as an ARRAY ref while "strict refs" in use at ./kdesrc-build line 336.

Please submit a bug against kdesrc-build on http://bugs.kde.org/
Your logs are saved in /d/kde/src/5/log/2012-01-12-02


Reproducible: Didn't try

Steps to Reproduce:
Here's my kdesrc-buildrc file:
http://www.davidfaure.fr/2011/kdesrc-buildrc

(this is for compiling kdelibs-frameworks).

The file hasn't changed recently, though, but kdesrc-build has ;-)

In my shell's environment, $PKG_CONFIG_PATH is set to /d/qt/4/qt-for-trunk/lib/pkgconfig, if that matters (seems to be what the error is about).


Actual Results:  
Perl error.

Expected Results:  
No error :)
Comment 1 Thijs 2012-01-12 14:37:22 UTC
Saw the same. Seems commit bcf81c3aff8b7dd400f4594e264e4a97a38142a6 did the damage; adding a 
no strict 'refs';
in the header repaired it for me.
Comment 2 Michael Pyne 2012-01-12 22:10:26 UTC
Looking into it now...
Comment 3 Michael Pyne 2012-01-13 00:54:41 UTC
Git commit 2f7db9bb6ba84984118773c96440e76982fe6820 by Michael Pyne.
Committed on 12/01/2012 at 23:57.
Pushed by mpyne into branch 'master'.

Auto-dereference list refs only if really refs.

This allows single-elements lists to not be guessed as a list reference
in list_has, which helps with bug 291357... but still doesn't explain
why old code that used list_has didn't have the same issue.

I have included a test case which fails and is likely related to the
reason though, so hopefully won't be hard to pin down from here.

M  +6    -1    kdesrc-build
M  +7    -0    kdesrc-build-test.pl

http://commits.kde.org/kdesrc-build/2f7db9bb6ba84984118773c96440e76982fe6820
Comment 4 Michael Pyne 2012-01-13 00:54:41 UTC
Git commit 631eca3a64f2508a3db13860881d9cfd98a4276d by Michael Pyne.
Committed on 13/01/2012 at 00:03.
Pushed by mpyne into branch 'master'.

Don't double-add function args to environment.

Although dumber than I thought the bug would be, it at least was easy to
find.

The reason list_has() accepted the prior code was that it seemed to be
getting called with a @curList of 0 entries instead of 1 entry (when
there was no existing environment variable set).

I'm still not entirely sure but I believe that was caused by the bug
fixed by this commit, where the environment variable name would end up
prepended to the value. If there was no value assigned it would just
assign a value with 1 entry, which would have tripped the bug when used
later.

Please let me know if this is fixed, I've tried to add a few more
testcases which all pass at this point.

M  +1    -1    kdesrc-build
M  +15   -1    kdesrc-build-test.pl

http://commits.kde.org/kdesrc-build/631eca3a64f2508a3db13860881d9cfd98a4276d