Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): when building module test project, unzip via spawn to avoid max buffer error #12091

Merged
merged 3 commits into from Sep 18, 2020

Conversation

sgtcoolguy
Copy link
Contributor

@sgtcoolguy sgtcoolguy commented Sep 16, 2020

JIRA: https://jira.appcelerator.org/browse/TIMOB-28142

Description:
Found when trying to build and test ti.barcode. Using exec to unzip a module zip file causes node to barf with a stdout maxBuffer overflow. I changed it to use spawn and basically pipe stderr/stdout to the logger to avoid the issue and flow through the output.

Copy link
Contributor

@vijaysingh-axway vijaysingh-axway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@build
Copy link
Contributor

build commented Sep 16, 2020

Fails
🚫 Tests have failed, see below for more information.
Warnings
⚠️ This PR has milestone set to 9.2.0, but the version defined in package.json is 9.3.0 Please either: - Update the milestone on the PR - Update the version in package.json - Hold the PR to be merged later after a release and version bump on this branch
⚠️

iphone/cli/commands/_buildModule.js#L16 - iphone/cli/commands/_buildModule.js line 16 – 'exec' is assigned a value but never used. (no-unused-vars)

Messages
📖 👍 Hey!, You deleted more code than you added. That's awesome!
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖 ❌ 4 tests have failed There are 4 tests failing and 739 skipped out of 8337 total tests.

Tests:

ClassnameNameTimeError
test.handleBuildworks2.022
Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-12091/build/lib/test/test-test.js)
ios.iphone.Titanium.UI.iOS.CollisionBehavior.exampleworks (14.0)15.001
Error: timeout of 15000ms exceeded
file:///Users/build/Library/Developer/CoreSimulator/Devices/0BA89FD6-590B-4E1C-A92C-C7071914B3F8/data/Containers/Bundle/Application/7C372E6C-8662-42FA-9D66-5A302A1E4087/mocha.app/ti-mocha.js:4326:27
ios.macos.Titanium.UI.iOS.CollisionBehavior.exampleworks (10.15.5)15.025
Error: timeout of 15000ms exceeded
file:///Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-12091/tmp/mocha/build/iphone/build/Products/Debug-maccatalyst/mocha.app/Contents/Resources/ti-mocha.js:4326:27
ios.macos.Titanium.UI.View.borderRadius corners1 value with shadow effect (10.15.5)0.073
Error: expected 'Ti.UI.View' view to match snapshot image: snapshots/borderRadiusWithShadow30px.png
fail@file:///Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-12091/tmp/mocha/build/iphone/build/Products/Debug-maccatalyst/mocha.app/Contents/Resources/node_modules/should/cjs/should.js:275:23
value@file:///Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-12091/tmp/mocha/build/iphone/build/Products/Debug-maccatalyst/mocha.app/Contents/Resources/node_modules/should/cjs/should.js:356:23
postlayout@file:///Users/build/jenkins/workspace/ium-sdk_titanium_mobile_PR-12091/tmp/mocha/build/iphone/build/Products/Debug-maccatalyst/mocha.app/Contents/Resources/ti.ui.view.test.js:1232:39

Generated by 🚫 dangerJS against d98c849

@lokeshchdhry
Copy link
Contributor

@sgtcoolguy , I am getting error when I try to run a module:

[INFO]  Writing module zip: /Users/lchoudhary/Desktop/testmod/ios/dist/com.app.testmod-iphone-1.0.0.zip
[DEBUG] Staging module project at /var/folders/pk/g7g95bbj4gl4j07mr_frrn44t9wxx4/T/ti-ios-module-build-2020816-89588-109zirb.jhwf
[DEBUG] Running: titanium create --id com.app.testmod -n testmod -t app -u localhost -d /var/folders/pk/g7g95bbj4gl4j07mr_frrn44t9wxx4/T/ti-ios-module-build-2020816-89588-109zirb.jhwf -p ios --force --no-prompt --no-progress-bars --no-colors
2020-09-16T22:13:39.933Z | ERROR  | An uncaught exception was thrown!
spawn titanium ENOENT
2020-09-16T22:13:39.933Z | ERROR  | spawn titanium ENOENT
2020-09-16T22:13:39.933Z | TRACE  | Error: spawn titanium ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
  appc:run signal received exit code: 1 , sending to ChildProcess {
  _events: [Object: null prototype] { close: [Function] },
  _eventsCount: 1,
  _maxListeners: undefined,
  _closesNeeded: 1,
  _closesGot: 1,
  connected: false,
  signalCode: null,
  exitCode: 1,
  killed: false,
  spawnfile: '/usr/local/bin/node',
  _handle: null,
  spawnargs: [
    '/usr/local/bin/node',
    '/Users/lchoudhary/.appcelerator/install/8.1.1/package/bin/appc',
    'run',
    '-p',
    'ios',
    '-l',
    'trace'
  ],
  pid: 89588,
  stdin: null,
  stdout: null,
  stderr: null,
  stdio: [ null, null, null ]
}

@sgtcoolguy
Copy link
Contributor Author

@lokeshchdhry The module build invokes the titanium CLI when you don't specify --build-only. It calls it to create a project, copies the module into it and then calls it to build the app. I suspect it assumes a global titanium CLI is on your PATH. So when invoked through the Appc CLI without a global titanium CLI install, it likely fails as above. That's how it's always worked, so I'm not sure if there's a way we can detect when the module build is being "wrapped" by an Appc CLI command and somehow point at the bundled titanium cli inside that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants