Opened 8 years ago

Closed 8 years ago

#13679 closed defect (fixed)

Using deprecated profileFile argument causes error

Reported by: xMartin Owned by: Rawld Gill
Priority: high Milestone: 1.7
Component: BuildSystem Version: 1.7.0b1
Keywords: Cc:
Blocked By: Blocking:

Description

In the build script, using the deprecated argument profileFile (seems to be a more versatile profile now) causes an error (see below). Problem seems to be a call to a log method that needs an array as second argument which is not given in this case.

I'm using trunk.

elm:buildscripts martin$ ./build.sh action=release releaseDir=../../../../release/ profileFile=../../../../conf-build/ajaxclient.profile.js cssOptimize=comments
running under node.js

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
TypeError: Cannot read property 'length' of undefined
    at build/messages:125:17
    at Object.log (build/messages:153:61)
    at build/buildControl:128:9
    at Array.forEach (native)
    at build/buildControl:103:27
    at /Volumes/excentos/Code/BSH-dojo_1.7/WebContent/ajaxclient/dojo/dojo.js:922:43
    at /Volumes/excentos/Code/BSH-dojo_1.7/WebContent/ajaxclient/dojo/dojo.js:1011:5
    at /Volumes/excentos/Code/BSH-dojo_1.7/WebContent/ajaxclient/dojo/dojo.js:1002:12
    at /Volumes/excentos/Code/BSH-dojo_1.7/WebContent/ajaxclient/dojo/dojo.js:681:5
    at /Volumes/excentos/Code/BSH-dojo_1.7/WebContent/ajaxclient/dojo/dojo.js:697:13

Change History (7)

comment:1 Changed 8 years ago by Nick Fenwick

I just ran into this also, trying 1.7.0b5. Adding an extra log before the failing line in messages.js shows more information:

The new line:

console.log("xxx item ", item, " item 1 ", item[1]);

The build output:

     [exec] running under node.js
     [exec] xxx item  [ 1,
     [exec]   208,
     [exec]   'inputDeprecatedProfileFile',
     [exec]   'The "profileFile" switch has been deprecated; user "profile" instead.',
     [exec]   [ undefined ] ]  item 1  208
     [exec] 
     [exec] node.js:183
     [exec]         throw e; // process.nextTick error, or 'error' event on first tick

It is the getArgs(args) bit in this line that's causing the error:

console.log(getPrefix(item[1]) + " " + item[3] + " " + getArgs(args));

It's trivial to reproduce this failing behaviour by telling teh build.sh script to use standard.profile.js via the profileFile option:

[neek buildscripts (develop)]$ ./build.sh profileFile=profiles/standard action=release
running under node.js
xxx item  [ 1,
  208,
  'inputDeprecatedProfileFile',
  'The "profileFile" switch has been deprecated; user "profile" instead.',
  [ undefined ] ]  item 1  208

node.js:183
        throw e; // process.nextTick error, or 'error' event on first tick

I'm not going to debug further, can someone who knows the new build system please fix this erroneous output for the deprecated profileFile switch?

The help.txt file still mentions profileFile, as DEPRECATED. Is profileFile actually supported any more, or is the build supposed to fail if profileFile is supplied?

comment:2 Changed 8 years ago by Kenneth G. Franqueiro

Priority: normalhigh
severity: normalblocker

comment:3 Changed 8 years ago by Rawld Gill

Status: newassigned
Version: 1.7.0b1

comment:4 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed

In [26633]:

removed cruft; improved msg machinery; ensure directories created for reports; added debug dump; fixes #13679; refs #12673; !strict

comment:5 Changed 8 years ago by ben hockey

Resolution: fixed
Status: closedreopened

http://bugs.dojotoolkit.org/browser/dojo/util/trunk/build/buildControl.js?rev=26633#L257 is as follows:

if(packageJson.directories.lib && !pack.location){

some package.json files (including the one in dijit) don't have a directories property. this causes TypeError: Cannot read property 'lib' of undefined to be thrown when doing a build.

afaik, directories is not required is it?

comment:6 Changed 8 years ago by ben hockey

i'm also getting an extra error that i wasn't previously getting before r26633

running under node.js
error(337) Missing or empty package.json file at location specified by package flag. filename: /homes/staff/ben/svn/dojo/util/buildscripts/package.json

let me know if you need more info about how i'm executing a build.

Last edited 8 years ago by ben hockey (previous) (diff)

comment:7 in reply to:  6 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: reopenedclosed

Replying to neonstalwart:

i'm also getting an extra error that i wasn't previously getting before r26633

running under node.js
error(337) Missing or empty package.json file at location specified by package flag. filename: /homes/staff/ben/svn/dojo/util/buildscripts/package.json

Sorry. Introduced an error in [26634], fixed in [26644].

Note: See TracTickets for help on using tickets.