Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27866] CLI: ti clean with a forked SDK and --project-dir option exits with GracefulShutdown error

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2021-02-11T12:09:53.000+0000
Affected Version/sRelease 9.0.0
Fix Version/stitanium 5.3.0
ComponentsCLI
Labelsn/a
ReporterEwan Harris
AssigneeEwan Harris
Created2020-04-27T17:16:28.000+0000
Updated2021-02-11T12:10:00.000+0000

Description

*I'm still trying to figure this one out, but I think the title is the main bits at play*

Description

When calling clean like so ti clean --project-dir <path> and the tiapp SDK version and selected SDK version do not match I'm seeing the CLI log an uncaughtError exception that appears to be due to the throw new cli.GracefulShutdown(); (I believe). My current theories are as follows (update: both of these are wrong) : * Some form of dependency update causing the instanceof check [here](https://github.com/appcelerator/titanium/blob/6a41ba410e51a7a3388e4d71c76508d89cac9836/lib/cli.js#L513) to fail because of how JS works with that kinda thing * Possibly the async.js upgrade borking? Maybe it changed how throw works?

Steps to reproduce

1. Change your selected SDK (ti sdk select) and your tiapp SDK 2. Run ti clean --project-dir <path>

Actual

CLI errors after attempting to fork

Expected

Fork should occur successfully and CLI should not error out

Comments

  1. Ewan Harris 2020-04-27

    logs
       $titanium clean --project-dir /Users/awam/git/testing_apps/kitchensink-v2
        [INFO]   tiapp.xml <sdk-version> set to  8.3.0.GA , but current Titanium SDK set to  8.3.2
        [INFO]   Forking correct SDK command:  "/Users/awam/.nvm/versions/node/v12.16.2/bin/node" "/Users/awam/git/titanium/bin/titanium" "clean" "--sdk" "8.3.0.GA" "--project-dir" "/Users/awam/git/testing_apps/kitchensink-v2"
       
        [LiveView]  [GracefulShutdown [Error]]
        [DEBUG]  Detecting plugins in  /Users/awam/git/testing_apps/kitchensink-v2/plugins
        [DEBUG]  Detected plugin:  ti.alloy  @  /Users/awam/git/testing_apps/kitchensink-v2/plugins/ti.alloy
        [DEBUG]  Looking for Titanium plugin id= ti.alloy  version= 1.0
        [INFO]   Found Titanium plugin id= ti.alloy  version= 1.0
        [DEBUG]  Deleting all platform build directories
       [DEBUG] Resources directory of /Users/awam/git/testing_apps/kitchensink-v2/app has been emptied
       [INFO]  Project cleaned successfully in 45ms
       
  2. Ewan Harris 2020-04-29

    This one was bugging me today so I took a look. I believe it's due to TIMOB-23247 (forking in ti clean never existed before this) and needs to be fixed by copying the build.config hook in tisdk3fixes in titanium to a clean.config hook
  3. Ewan Harris 2020-10-19

    PR: https://github.com/appcelerator/titanium/pull/402

JSON Source