Opened 8 years ago

Closed 8 years ago

#13377 closed defect (fixed)

Build fails when layer name for a module has no matching prefix in 1.7

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

Description

In 1.6, it is possible to do something like this in the build profile and end up with a working build:

layers: [ { name: "../foo/base.js", resourceName: "foo.base", dependencies: [ "foo.base" ] } ],
prefixes: [ [ "foo", "../../foo" ] ]

In 1.6- this causes foo.base to move from dojo/../foo/base.js in the src directory to dojo/../../foo/base.js in the build directory.

1.7 builder fails here in the module ID resolution step; I don’t have this code to test and reduce myself at the moment, but looking at the builder code it seems that it probably fails because it is trying to resolve the module ID from the name property, but can’t because there is no prefix that matches the first part of the path in prefixes (and of course you can’t have multiple prefixes to the same package since it gets turned into a hash map).

Cc rmurphey for more info/reductions/whatever.

Change History (4)

comment:1 Changed 8 years ago by Rawld Gill

Cc: rmurphey Rawld Gill added; rmurphey rcgill removed
Status: newassigned

comment:2 Changed 8 years ago by Nick Fenwick

Some more detailed information. I just debugged to this point with the 1.7.0b5 beta.

It fails in v1xProfiles.js filenameToMid(filename), where it's comparing the calculated path to the module against known prefix maps.

If your dojo is in /home/neek/dojo for example, and a profile like:

dependencies = { layers: [
 { name: '../mydijits/mydijitslayer.js", resourceName: "mydijits.layer", dependencies: [ ... ] }
],
prefixes: [
.. normal dijit,dojox ..
 [ "mydijits", "../../mydijits" ]
]

(because your mydijits development code is outside your dojo source tree) then the prefix path (prefixMap in v1xProfiles.js) is calculated as /home/neek/mydijits. When calling filenameToMid this is compared against the computePath() output for the layer, which is /home/neek/dojo/mydijits/mydijits.layer.js, and the two don't match.

I wonder if 1.7 will support out-of-sdk module code, or if we will be forced to move our custom modules inside the sdk directory just for the sake of the build system? (or of course there's some trivial fix that I'm missing). I'm moving back to 1.6.1, I have work to do :)

comment:3 Changed 8 years ago by Rawld Gill

Milestone: tbd1.7

comment:4 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: assignedclosed

The v1.7 build system can consume input from any location and write processed results to any location. See build tutorial at dojo campus for details.

The v1.6 transformation algorithm had a bug (#14010) that caused the prefixes vector to be interpreted improperly in some circumstances; this was the root cause of this ticket.

Note: See TracTickets for help on using tickets.