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

npm translator chokes on certain dependency #323

Closed
1 of 6 tasks
RandomByte opened this issue Jun 23, 2018 · 1 comment
Closed
1 of 6 tasks

npm translator chokes on certain dependency #323

RandomByte opened this issue Jun 23, 2018 · 1 comment
Labels
bug Something isn't working module/ui5-project Related to the UI5 Project module

Comments

@RandomByte
Copy link
Member

Expected Behavior

The ui5 tree command should present the projects dependency tree

Current Behavior

If the package.json contains a dependency to ui5-schemas (and possibly others), ui5 tree never returns and needs to be killed manually.

Steps to reproduce the issue

  1. git clone -b ui5-tooling https://github.com/SAP/openui5-sample-app.git
  2. npm install ui5-schemas
  3. ui5 tree

Context

  • OS/Platform: macOS 10.13.5
  • Node.js Version: v10.2.0
  • npm Version: 6.1.0
  • Browser (if relevant): {...}
  • Other information: {...}

Affected components

Stack trace/log output

❯ ui5 tree --verbose                       
verb normalizer:normalizer Building dependency tree...
verb normalizer:translators:npm Analyzing openui5-sample-app ([...]/openui5-sample-app) (depenency of nothing - root project)
verb normalizer:translators:npm Analyzing ui5-schemas ([...]/openui5-sample-app/node_modules/ui5-schemas) (depenency of openui5-sample-app)
verb normalizer:translators:npm Analyzing @openui5/themelib_sap_belize ([...]/openui5-sample-app/node_modules/@openui5/themelib_sap_belize) (depenency of openui5-sample-app)
verb normalizer:translators:npm Analyzing @openui5/sap.ui.core ([...]/openui5-sample-app/node_modules/@openui5/sap.ui.core) (depenency of openui5-sample-app)
verb normalizer:translators:npm Analyzing @openui5/sap.m ([...]/openui5-sample-app/node_modules/@openui5/sap.m) (depenency of openui5-sample-app)
verb normalizer:translators:npm Analyzing fs-extra ([...]/openui5-sample-app/node_modules/fs-extra) (depenency of ui5-schemas)
verb normalizer:translators:npm Analyzing request ([...]/openui5-sample-app/node_modules/request) (depenency of ui5-schemas)
verb normalizer:translators:npm Analyzing minilog ([...]/openui5-sample-app/node_modules/minilog) (depenency of ui5-schemas)
verb normalizer:translators:npm Analyzing xml2js ([...]/openui5-sample-app/node_modules/xml2js) (depenency of ui5-schemas)
verb normalizer:translators:npm Analyzing yargs ([...]/openui5-sample-app/node_modules/yargs) (depenency of ui5-schemas)
verb normalizer:translators:npm Analyzing @openui5/sap.ui.unified ([...]/openui5-sample-app/node_modules/@openui5/sap.ui.unified) (depenency of @openui5/sap.m)
verb normalizer:translators:npm Analyzing graceful-fs ([...]/openui5-sample-app/node_modules/graceful-fs) (depenency of fs-extra)
verb normalizer:translators:npm Analyzing aws-sign2 ([...]/openui5-sample-app/node_modules/aws-sign2) (depenency of request)
verb normalizer:translators:npm Analyzing jsonfile ([...]/openui5-sample-app/node_modules/jsonfile) (depenency of fs-extra)
verb normalizer:translators:npm Analyzing universalify ([...]/openui5-sample-app/node_modules/universalify) (depenency of fs-extra)
verb normalizer:translators:npm Analyzing aws4 ([...]/openui5-sample-app/node_modules/aws4) (depenency of request)
verb normalizer:translators:npm Analyzing combined-stream ([...]/openui5-sample-app/node_modules/combined-stream) (depenency of request)
verb normalizer:translators:npm Analyzing caseless ([...]/openui5-sample-app/node_modules/caseless) (depenency of request)
verb normalizer:translators:npm Analyzing extend ([...]/openui5-sample-app/node_modules/extend) (depenency of request)
verb normalizer:translators:npm Analyzing forever-agent ([...]/openui5-sample-app/node_modules/forever-agent) (depenency of request)
verb normalizer:translators:npm Analyzing form-data ([...]/openui5-sample-app/node_modules/form-data) (depenency of request)
verb normalizer:translators:npm Analyzing har-validator ([...]/openui5-sample-app/node_modules/har-validator) (depenency of request)
verb normalizer:translators:npm Analyzing http-signature ([...]/openui5-sample-app/node_modules/http-signature) (depenency of request)
verb normalizer:translators:npm Analyzing is-typedarray ([...]/openui5-sample-app/node_modules/is-typedarray) (depenency of request)
verb normalizer:translators:npm Analyzing isstream ([...]/openui5-sample-app/node_modules/isstream) (depenency of request)
verb normalizer:translators:npm Analyzing mime-types ([...]/openui5-sample-app/node_modules/mime-types) (depenency of request)
verb normalizer:translators:npm Analyzing oauth-sign ([...]/openui5-sample-app/node_modules/oauth-sign) (depenency of request)
verb normalizer:translators:npm Analyzing json-stringify-safe ([...]/openui5-sample-app/node_modules/json-stringify-safe) (depenency of request)
verb normalizer:translators:npm Analyzing performance-now ([...]/openui5-sample-app/node_modules/performance-now) (depenency of request)
verb normalizer:translators:npm Analyzing qs ([...]/openui5-sample-app/node_modules/qs) (depenency of request)
verb normalizer:translators:npm Analyzing tough-cookie ([...]/openui5-sample-app/node_modules/tough-cookie) (depenency of request)
verb normalizer:translators:npm Analyzing safe-buffer ([...]/openui5-sample-app/node_modules/safe-buffer) (depenency of request)
verb normalizer:translators:npm Analyzing tunnel-agent ([...]/openui5-sample-app/node_modules/tunnel-agent) (depenency of request)
verb normalizer:translators:npm Analyzing uuid ([...]/openui5-sample-app/node_modules/uuid) (depenency of request)
verb normalizer:translators:npm Analyzing microee ([...]/openui5-sample-app/node_modules/microee) (depenency of minilog)
verb normalizer:translators:npm Analyzing sax ([...]/openui5-sample-app/node_modules/sax) (depenency of xml2js)
verb normalizer:translators:npm Analyzing xmlbuilder ([...]/openui5-sample-app/node_modules/xmlbuilder) (depenency of xml2js)
verb normalizer:translators:npm Analyzing camelcase ([...]/openui5-sample-app/node_modules/camelcase) (depenency of yargs)
verb normalizer:translators:npm Analyzing decamelize ([...]/openui5-sample-app/node_modules/decamelize) (depenency of yargs)
verb normalizer:translators:npm Analyzing get-caller-file ([...]/openui5-sample-app/node_modules/get-caller-file) (depenency of yargs)
verb normalizer:translators:npm Analyzing cliui ([...]/openui5-sample-app/node_modules/cliui) (depenency of yargs)
verb normalizer:translators:npm Analyzing os-locale ([...]/openui5-sample-app/node_modules/os-locale) (depenency of yargs)
verb normalizer:translators:npm Analyzing require-directory ([...]/openui5-sample-app/node_modules/require-directory) (depenency of yargs)
verb normalizer:translators:npm Analyzing require-main-filename ([...]/openui5-sample-app/node_modules/require-main-filename) (depenency of yargs)
verb normalizer:translators:npm Analyzing read-pkg-up ([...]/openui5-sample-app/node_modules/read-pkg-up) (depenency of yargs)
verb normalizer:translators:npm Analyzing set-blocking ([...]/openui5-sample-app/node_modules/set-blocking) (depenency of yargs)
verb normalizer:translators:npm Analyzing string-width ([...]/openui5-sample-app/node_modules/string-width) (depenency of yargs)
verb normalizer:translators:npm Analyzing y18n ([...]/openui5-sample-app/node_modules/y18n) (depenency of yargs)
verb normalizer:translators:npm Analyzing which-module ([...]/openui5-sample-app/node_modules/which-module) (depenency of yargs)
verb normalizer:translators:npm Analyzing yargs-parser ([...]/openui5-sample-app/node_modules/yargs-parser) (depenency of yargs)
verb normalizer:translators:npm Analyzing string-width ([...]/openui5-sample-app/node_modules/cliui/node_modules/string-width) (depenency of cliui)
verb normalizer:translators:npm Analyzing is-fullwidth-code-point ([...]/openui5-sample-app/node_modules/string-width/node_modules/is-fullwidth-code-point) (depenency of string-width)
verb normalizer:translators:npm Analyzing strip-ansi ([...]/openui5-sample-app/node_modules/string-width/node_modules/strip-ansi) (depenency of string-width)
verb normalizer:translators:npm Analyzing asynckit ([...]/openui5-sample-app/node_modules/asynckit) (depenency of form-data)
verb normalizer:translators:npm Analyzing delayed-stream ([...]/openui5-sample-app/node_modules/delayed-stream) (depenency of combined-stream)
verb normalizer:translators:npm Analyzing ajv ([...]/openui5-sample-app/node_modules/ajv) (depenency of har-validator)
verb normalizer:translators:npm Analyzing assert-plus ([...]/openui5-sample-app/node_modules/assert-plus) (depenency of http-signature)
verb normalizer:translators:npm Analyzing har-schema ([...]/openui5-sample-app/node_modules/har-schema) (depenency of har-validator)
verb normalizer:translators:npm Analyzing sshpk ([...]/openui5-sample-app/node_modules/sshpk) (depenency of http-signature)
verb normalizer:translators:npm Analyzing jsprim ([...]/openui5-sample-app/node_modules/jsprim) (depenency of http-signature)
verb normalizer:translators:npm Analyzing mime-db ([...]/openui5-sample-app/node_modules/mime-db) (depenency of mime-types)
verb normalizer:translators:npm Analyzing strip-ansi ([...]/openui5-sample-app/node_modules/strip-ansi) (depenency of cliui)
verb normalizer:translators:npm Analyzing punycode ([...]/openui5-sample-app/node_modules/punycode) (depenency of tough-cookie)
verb normalizer:translators:npm Analyzing execa ([...]/openui5-sample-app/node_modules/execa) (depenency of os-locale)
verb normalizer:translators:npm Analyzing wrap-ansi ([...]/openui5-sample-app/node_modules/wrap-ansi) (depenency of cliui)
verb normalizer:translators:npm Analyzing lcid ([...]/openui5-sample-app/node_modules/lcid) (depenency of os-locale)
verb normalizer:translators:npm Analyzing mem ([...]/openui5-sample-app/node_modules/mem) (depenency of os-locale)
verb normalizer:translators:npm Analyzing find-up ([...]/openui5-sample-app/node_modules/find-up) (depenency of read-pkg-up)
verb normalizer:translators:npm Analyzing read-pkg ([...]/openui5-sample-app/node_modules/read-pkg) (depenency of read-pkg-up)
verb normalizer:translators:npm Analyzing string-width ([...]/openui5-sample-app/node_modules/wrap-ansi/node_modules/string-width) (depenency of wrap-ansi)
verb normalizer:translators:npm Analyzing ansi-regex ([...]/openui5-sample-app/node_modules/string-width/node_modules/ansi-regex) (depenency of strip-ansi)
verb normalizer:translators:npm Analyzing fast-deep-equal ([...]/openui5-sample-app/node_modules/fast-deep-equal) (depenency of ajv)
verb normalizer:translators:npm Analyzing json-schema-traverse ([...]/openui5-sample-app/node_modules/json-schema-traverse) (depenency of ajv)
verb normalizer:translators:npm Analyzing co ([...]/openui5-sample-app/node_modules/co) (depenency of ajv)
verb normalizer:translators:npm Analyzing fast-json-stable-stringify ([...]/openui5-sample-app/node_modules/fast-json-stable-stringify) (depenency of ajv)
verb normalizer:translators:npm Analyzing asn1 ([...]/openui5-sample-app/node_modules/asn1) (depenency of sshpk)
verb normalizer:translators:npm Analyzing bcrypt-pbkdf ([...]/openui5-sample-app/node_modules/bcrypt-pbkdf) (depenency of sshpk)
verb normalizer:translators:npm Analyzing dashdash ([...]/openui5-sample-app/node_modules/dashdash) (depenency of sshpk)
verb normalizer:translators:npm Analyzing ecc-jsbn ([...]/openui5-sample-app/node_modules/ecc-jsbn) (depenency of sshpk)
verb normalizer:translators:npm Analyzing safer-buffer ([...]/openui5-sample-app/node_modules/safer-buffer) (depenency of sshpk)
verb normalizer:translators:npm Analyzing jsbn ([...]/openui5-sample-app/node_modules/jsbn) (depenency of sshpk)
verb normalizer:translators:npm Analyzing tweetnacl ([...]/openui5-sample-app/node_modules/tweetnacl) (depenency of sshpk)
verb normalizer:translators:npm Analyzing getpass ([...]/openui5-sample-app/node_modules/getpass) (depenency of sshpk)
verb normalizer:translators:npm Analyzing extsprintf ([...]/openui5-sample-app/node_modules/extsprintf) (depenency of jsprim)
verb normalizer:translators:npm Analyzing json-schema ([...]/openui5-sample-app/node_modules/json-schema) (depenency of jsprim)
verb normalizer:translators:npm Analyzing verror ([...]/openui5-sample-app/node_modules/verror) (depenency of jsprim)
verb normalizer:translators:npm Analyzing ansi-regex ([...]/openui5-sample-app/node_modules/ansi-regex) (depenency of strip-ansi)
verb normalizer:translators:npm Analyzing cross-spawn ([...]/openui5-sample-app/node_modules/cross-spawn) (depenency of execa)
verb normalizer:translators:npm Analyzing is-stream ([...]/openui5-sample-app/node_modules/is-stream) (depenency of execa)
verb normalizer:translators:npm Analyzing get-stream ([...]/openui5-sample-app/node_modules/get-stream) (depenency of execa)
verb normalizer:translators:npm Analyzing p-finally ([...]/openui5-sample-app/node_modules/p-finally) (depenency of execa)
verb normalizer:translators:npm Analyzing npm-run-path ([...]/openui5-sample-app/node_modules/npm-run-path) (depenency of execa)
verb normalizer:translators:npm Analyzing signal-exit ([...]/openui5-sample-app/node_modules/signal-exit) (depenency of execa)
verb normalizer:translators:npm Analyzing strip-eof ([...]/openui5-sample-app/node_modules/strip-eof) (depenency of execa)
verb normalizer:translators:npm Analyzing invert-kv ([...]/openui5-sample-app/node_modules/invert-kv) (depenency of lcid)
verb normalizer:translators:npm Analyzing mimic-fn ([...]/openui5-sample-app/node_modules/mimic-fn) (depenency of mem)
verb normalizer:translators:npm Analyzing locate-path ([...]/openui5-sample-app/node_modules/locate-path) (depenency of find-up)
verb normalizer:translators:npm Analyzing path-type ([...]/openui5-sample-app/node_modules/path-type) (depenency of read-pkg)
verb normalizer:translators:npm Analyzing load-json-file ([...]/openui5-sample-app/node_modules/load-json-file) (depenency of read-pkg)
verb normalizer:translators:npm Analyzing normalize-package-data ([...]/openui5-sample-app/node_modules/normalize-package-data) (depenency of read-pkg)
verb normalizer:translators:npm Analyzing is-fullwidth-code-point ([...]/openui5-sample-app/node_modules/is-fullwidth-code-point) (depenency of string-width)
verb normalizer:translators:npm Analyzing code-point-at ([...]/openui5-sample-app/node_modules/code-point-at) (depenency of string-width)
verb normalizer:translators:npm Analyzing lru-cache ([...]/openui5-sample-app/node_modules/lru-cache) (depenency of cross-spawn)
verb normalizer:translators:npm Analyzing shebang-command ([...]/openui5-sample-app/node_modules/shebang-command) (depenency of cross-spawn)
verb normalizer:translators:npm Analyzing core-util-is ([...]/openui5-sample-app/node_modules/core-util-is) (depenency of verror)
verb normalizer:translators:npm Analyzing path-key ([...]/openui5-sample-app/node_modules/path-key) (depenency of npm-run-path)
verb normalizer:translators:npm Analyzing which ([...]/openui5-sample-app/node_modules/which) (depenency of cross-spawn)
verb normalizer:translators:npm Analyzing p-locate ([...]/openui5-sample-app/node_modules/p-locate) (depenency of locate-path)
verb normalizer:translators:npm Analyzing path-exists ([...]/openui5-sample-app/node_modules/path-exists) (depenency of locate-path)
verb normalizer:translators:npm Analyzing pify ([...]/openui5-sample-app/node_modules/pify) (depenency of path-type)
verb normalizer:translators:npm Analyzing strip-bom ([...]/openui5-sample-app/node_modules/strip-bom) (depenency of load-json-file)
verb normalizer:translators:npm Analyzing parse-json ([...]/openui5-sample-app/node_modules/parse-json) (depenency of load-json-file)
verb normalizer:translators:npm Analyzing hosted-git-info ([...]/openui5-sample-app/node_modules/hosted-git-info) (depenency of normalize-package-data)
verb normalizer:translators:npm Analyzing is-builtin-module ([...]/openui5-sample-app/node_modules/is-builtin-module) (depenency of normalize-package-data)
verb normalizer:translators:npm Analyzing validate-npm-package-license ([...]/openui5-sample-app/node_modules/validate-npm-package-license) (depenency of normalize-package-data)
verb normalizer:translators:npm Analyzing semver ([...]/openui5-sample-app/node_modules/semver) (depenency of normalize-package-data)
verb normalizer:translators:npm Analyzing number-is-nan ([...]/openui5-sample-app/node_modules/number-is-nan) (depenency of is-fullwidth-code-point)
verb normalizer:translators:npm Analyzing pseudomap ([...]/openui5-sample-app/node_modules/pseudomap) (depenency of lru-cache)
verb normalizer:translators:npm Analyzing yallist ([...]/openui5-sample-app/node_modules/yallist) (depenency of lru-cache)
verb normalizer:translators:npm Analyzing shebang-regex ([...]/openui5-sample-app/node_modules/shebang-regex) (depenency of shebang-command)
verb normalizer:translators:npm Analyzing isexe ([...]/openui5-sample-app/node_modules/isexe) (depenency of which)
verb normalizer:translators:npm Analyzing p-limit ([...]/openui5-sample-app/node_modules/p-limit) (depenency of p-locate)
verb normalizer:translators:npm Analyzing error-ex ([...]/openui5-sample-app/node_modules/error-ex) (depenency of parse-json)
verb normalizer:translators:npm Analyzing builtin-modules ([...]/openui5-sample-app/node_modules/builtin-modules) (depenency of is-builtin-module)
verb normalizer:translators:npm Analyzing spdx-correct ([...]/openui5-sample-app/node_modules/spdx-correct) (depenency of validate-npm-package-license)
verb normalizer:translators:npm Analyzing spdx-expression-parse ([...]/openui5-sample-app/node_modules/spdx-expression-parse) (depenency of validate-npm-package-license)
verb normalizer:translators:npm Analyzing p-try ([...]/openui5-sample-app/node_modules/p-try) (depenency of p-limit)
verb normalizer:translators:npm Analyzing is-arrayish ([...]/openui5-sample-app/node_modules/is-arrayish) (depenency of error-ex)
verb normalizer:translators:npm Analyzing spdx-license-ids ([...]/openui5-sample-app/node_modules/spdx-license-ids) (depenency of spdx-correct)
verb normalizer:translators:npm Analyzing spdx-exceptions ([...]/openui5-sample-app/node_modules/spdx-exceptions) (depenency of spdx-expression-parse)
verb normalizer:translators:npm [PERF] Consider defining UI5-dependencies in the package.json files of the relevant modules from the following list to improve npm translator execution time: openui5-sample-app, ui5-schemas, @openui5/themelib_sap_belize, @openui5/sap.ui.core, @openui5/sap.m, fs-extra, request, minilog, xml2js, yargs, @openui5/sap.ui.unified, graceful-fs, aws-sign2, jsonfile, universalify, aws4, combined-stream, caseless, extend, forever-agent, form-data, har-validator, http-signature, is-typedarray, isstream, mime-types, oauth-sign, json-stringify-safe, performance-now, qs, tough-cookie, safe-buffer, tunnel-agent, uuid, microee, sax, xmlbuilder, camelcase, decamelize, get-caller-file, cliui, os-locale, require-directory, require-main-filename, read-pkg-up, set-blocking, string-width, y18n, which-module, yargs-parser, string-width, is-fullwidth-code-point, strip-ansi, asynckit, delayed-stream, ajv, assert-plus, har-schema, sshpk, jsprim, mime-db, strip-ansi, punycode, execa, wrap-ansi, lcid, mem, find-up, read-pkg, string-width, ansi-regex, fast-deep-equal, json-schema-traverse, co, fast-json-stable-stringify, asn1, bcrypt-pbkdf, dashdash, ecc-jsbn, safer-buffer, jsbn, tweetnacl, getpass, extsprintf, json-schema, verror, ansi-regex, cross-spawn, is-stream, get-stream, p-finally, npm-run-path, signal-exit, strip-eof, invert-kv, mimic-fn, locate-path, path-type, load-json-file, normalize-package-data, is-fullwidth-code-point, code-point-at, lru-cache, shebang-command, core-util-is, path-key, which, p-locate, path-exists, pify, strip-bom, parse-json, hosted-git-info, is-builtin-module, validate-npm-package-license, semver, number-is-nan, pseudomap, yallist, shebang-regex, isexe, p-limit, error-ex, builtin-modules, spdx-correct, spdx-expression-parse, p-try, is-arrayish, spdx-license-ids, spdx-exceptions
verb normalizer:translators:npm Built tree:
verb normalizer:translators:npm { id: 'openui5-sample-app',
verb normalizer:translators:npm   version: '0.2.0',
verb normalizer:translators:npm   path: '[...]/openui5-sample-app',
verb normalizer:translators:npm   dependencies:
verb normalizer:translators:npm    [ { id: '@openui5/sap.m',
verb normalizer:translators:npm        version: '1.56.2',
verb normalizer:translators:npm        path:
verb normalizer:translators:npm         '[...]/openui5-sample-app/node_modules/@openui5/sap.m',
verb normalizer:translators:npm        dependencies: [Array] },
verb normalizer:translators:npm      { id: '@openui5/sap.ui.core',
verb normalizer:translators:npm        version: '1.56.2',
verb normalizer:translators:npm        path:
verb normalizer:translators:npm         '[...]/openui5-sample-app/node_modules/@openui5/sap.ui.core',
verb normalizer:translators:npm        dependencies: [] },
verb normalizer:translators:npm      { id: '@openui5/themelib_sap_belize',
verb normalizer:translators:npm        version: '1.56.2',
verb normalizer:translators:npm        path:
verb normalizer:translators:npm         '[...]/openui5-sample-app/node_modules/@openui5/themelib_sap_belize',
verb normalizer:translators:npm        dependencies: [] },
verb normalizer:translators:npm      { id: 'ui5-schemas',
verb normalizer:translators:npm        version: '0.3.1',
verb normalizer:translators:npm        path:
verb normalizer:translators:npm         '[...]/openui5-sample-app/node_modules/ui5-schemas',
verb normalizer:translators:npm        dependencies: [Array] } ] }
@codeworrior
Copy link
Member

The prcoessPendingDeps method of the npm translator seems not to be prepared to handle cyclic npm dependencies.

But ui5-schema depends on request which forms a direct dependency cycle with form-data (at least in the versions used).

SAP/ui5-project#15 fixes this. A more advanced fix could add some book keeping and print an indicator in the tree whenever a cycle is detected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module/ui5-project Related to the UI5 Project module
Projects
None yet
Development

No branches or pull requests

2 participants