Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14933] CLI: Builds where tiapp.xml sdk-version differs from selected SDK fail to properly fork in Windows

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2013-08-27T22:16:56.000+0000
Affected Version/sRelease 3.1.2
Fix Version/s2013 Sprint 18 Core, 2013 Sprint 18, Release 3.2.0
ComponentsCLI
Labelsqe-closed-3.2.0
ReporterChris Barber
AssigneeChris Barber
Created2013-08-21T20:05:11.000+0000
Updated2013-12-04T18:34:04.000+0000

Description

The CLI tries to strip the first argument if it's the actual "node" executable before parsing the args. The problem is on Windows the node executable can sometimes contain the .exe and the following line of code fails:
// cli.js (line 218)
args[0].slice(-4) === 'node' && args.shift();
This line needs to look like this:
args[0].replace(/\\/g, '/').split('/').pop() == process.execPath.replace(/\\/g, '/').split('/').pop().replace(/\.exe$/, '') && args.shift();

Comments

  1. Chris Barber 2013-08-27

    To test: 1) Find a Windows machine 2) Install the Titanium CLI 3.1.2 3) Download Titanium SDK 3.1.1.GA and 3.1.2.GA 4) Set Titanium SDK 3.1.2.GA the selected SDK (ti sdk select 3.1.2.GA) 5) Apply the PR fix to titanium/lib/cli.js 6) Create an app and set the app's to 3.1.1.GA 7) Build the app (ti build -p mobileweb)
  2. Chris Barber 2013-08-27

    Pull request: https://github.com/appcelerator/titanium/pull/54
  3. Samuel Dowse 2013-12-04

    Verified fixed on: Windows 7 Titanium Studio, build: 3.2.0.201311262027 Titanium SDK, build: 3.2.0.v20131127194046 CLI: 3.2.0-beta Alloy: 1.3.0-beta If tiapp.xml sdk differs from the selected sdk in CLI, then CLI will fork the correct SDK and build successfully.
    [INFO]  tiapp.xml <sdk-version> set to 3.2.0.v20131127194046, but current Titanium SDK set to 3.2.0.v20131203104847
       [INFO]  Forking correct SDK command: "C:\Program Files (x86)\nodejs\node.exe" "C:\Users\tester\AppData\Roaming\npm\node_modules\titanium\bin\titanium" "build" "--sdk" "3.2.0.v20131127194046" "--config-file" "C:\Users\tester\.titanium\config.json" "--
       platform" "mobileweb" "--project-dir" "C:\Users\tester\Documents\Titanium_Studio_Workspace\mobileweb" "--log-level" "trace" "--deploy-type" "development"
    Closing.

JSON Source