rushstack icon indicating copy to clipboard operation
rushstack copied to clipboard

[api-extractor] Running CLI in parallel causes wrong config to be used

Open thomasballinger opened this issue 3 years ago • 0 comments

Summary

Running api-extractor in parallel seems to cause it to use the wrong config! Comparing the output of running two commands in parallel and in series, when run in parallel both api-extractor commands use the same config.

Repro steps

Create two api-extractor.json files, and a third that the other two inherit from (dunno if necessary). Run api-extractor on the command line on each using -c flag to specify the file to use. Notice (the --verbose flag helps) that one of the configs is used twice, the other not at all! This is consistent for me with just two invocations on the command line, but when run from a Python script it helped to run 5 or 6.

Here's the output I see from running first in series, then in parallel.

$ npx api-extractor run -c server-api-extractor.json --verbose; npx api-extractor run -c react-api-extractor.json --verbose

api-extractor 7.28.3  - https://api-extractor.com/

Analysis will use the bundled TypeScript version 4.6.4
The API report is up to date: temp/server-tmp.api.md
Writing package typings: /Users/foo/bar/dist/esm/server/server.d.ts
Writing package typings: /Users/foo/bar/dist/esm/server/server-internal.d.ts

API Extractor completed successfully

api-extractor 7.28.3  - https://api-extractor.com/

Analysis will use the bundled TypeScript version 4.6.4
The API report is up to date: temp/react-tmp.api.md
Writing package typings: /Users/foo/bar/dist/esm/react/react.d.ts
Writing package typings: /Users/foo/bar/dist/esm/react/react-internal.d.ts

API Extractor completed successfully

with the output of running the same commands in parallel:

$ npx api-extractor run -c server-api-extractor.json --verbose & npx api-extractor run -c react-api-extractor.json --verbose
[1] 75259

api-extractor 7.28.3  - https://api-extractor.com/


api-extractor 7.28.3  - https://api-extractor.com/

Analysis will use the bundled TypeScript version 4.6.4
Analysis will use the bundled TypeScript version 4.6.4
The API report is up to date: temp/react-tmp.api.md
Writing package typings: /Users/foo/bar/dist/esm/react/react.d.ts
The API report is up to date: temp/react-tmp.api.md
Writing package typings: /Users/foo/bar/dist/esm/react/react.d.ts
Writing package typings: /Users/foo/bar/dist/esm/react/react-internal.d.ts
Writing package typings: /Users/foo/bar/dist/esm/react/react-internal.d.ts

API Extractor completed successfully

API Extractor completed successfully
[1]  + done       npx api-extractor run -c server-api-extractor.json --verbose

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-extractor version? 7.28.3
Operating system? Mac
API Extractor scenario? reporting + rollup
Would you consider contributing a PR? Yes
TypeScript compiler version? 4.6.4
Node.js version (node -v)? v16.15.1

thomasballinger avatar Jul 06 '22 23:07 thomasballinger