Skip to content

fix(rush): don't panic when cache beforeExecute fails #4852

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

Conversation

aramissennyeydd
Copy link
Contributor

Summary

Fixes #4831.

Details

This ended up being easier than I thought it would be, the issue was that afterExecuteOperation runs regardless of it beforeExecuteOperation threw. afterExecuteOperation expects the build cache terminal to still be open, and cleans up the terminal itself after execution. All we need to do is remove the double cleanup in beforeExecuteOperation

How it was tested

Tested locally with build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo.

Before

==[ FAILURE: 9 operations ]====================================================

--[ FAILURE: b (build) - shard 1/5 ]-------------------------[ 0.01 seconds ]--

Internal Error: Early return status should not be set: EXECUTING

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
Internal Error: Log writer was closed for /Users/aramis.sennyey/Projects/rushstack/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/b/rush-logs/b._phase_build_shard_1.cache.log

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

--[ FAILURE: b (build) - shard 2/5 ]-------------------------[ 0.00 seconds ]--

Internal Error: Early return status should not be set: EXECUTING

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
Internal Error: Log writer was closed for /Users/aramis.sennyey/Projects/rushstack/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/b/rush-logs/b._phase_build_shard_2.cache.log

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

--[ FAILURE: b (build) - shard 3/5 ]-------------------------[ 0.00 seconds ]--

Internal Error: Early return status should not be set: EXECUTING

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
Internal Error: Log writer was closed for /Users/aramis.sennyey/Projects/rushstack/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/b/rush-logs/b._phase_build_shard_3.cache.log

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

--[ FAILURE: b (build) - shard 4/5 ]-------------------------[ 0.00 seconds ]--

Internal Error: Early return status should not be set: EXECUTING

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
Internal Error: Log writer was closed for /Users/aramis.sennyey/Projects/rushstack/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/b/rush-logs/b._phase_build_shard_4.cache.log

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

--[ FAILURE: b (build) - shard 5/5 ]-------------------------[ 0.00 seconds ]--

Internal Error: Early return status should not be set: EXECUTING

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
Internal Error: Log writer was closed for /Users/aramis.sennyey/Projects/rushstack/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/b/rush-logs/b._phase_build_shard_5.cache.log

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

--[ FAILURE: a (build) - shard 1/4 ]-------------------------[ 0.00 seconds ]--

Internal Error: Early return status should not be set: EXECUTING

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
Internal Error: Log writer was closed for /Users/aramis.sennyey/Projects/rushstack/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/a/rush-logs/a._phase_build_shard_1.cache.log

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

--[ FAILURE: a (build) - shard 2/4 ]-------------------------[ 0.00 seconds ]--

Internal Error: Early return status should not be set: EXECUTING

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
Internal Error: Log writer was closed for /Users/aramis.sennyey/Projects/rushstack/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/a/rush-logs/a._phase_build_shard_2.cache.log

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

--[ FAILURE: a (build) - shard 3/4 ]-------------------------[ 0.00 seconds ]--

Internal Error: Early return status should not be set: EXECUTING

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
Internal Error: Log writer was closed for /Users/aramis.sennyey/Projects/rushstack/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/a/rush-logs/a._phase_build_shard_3.cache.log

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.

--[ FAILURE: a (build) - shard 4/4 ]-------------------------[ 0.00 seconds ]--

Internal Error: Early return status should not be set: EXECUTING

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
Internal Error: Log writer was closed for /Users/aramis.sennyey/Projects/rushstack/build-tests/rush-redis-cobuild-plugin-integration-test/sandbox/sharded-repo/projects/a/rush-logs/a._phase_build_shard_4.cache.log

You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.


Operations failed.

rush cobuild (0.18 seconds)

Error: An error occurred.
    at PhasedScriptAction._executeOperationsAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/scriptActions/PhasedScriptAction.js:642:19)
    at async PhasedScriptAction._runInitialPhasesAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/scriptActions/PhasedScriptAction.js:371:9)
    at async PhasedScriptAction.runAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/scriptActions/PhasedScriptAction.js:335:37)
    at async RushCommandLineParser.onExecute (/Users/aramis.sennyey/Projects/rushstack/libraries/ts-command-line/lib/providers/CommandLineParser.js:275:13)
    at async RushCommandLineParser._wrapOnExecuteAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/RushCommandLineParser.js:234:13)
    at async RushCommandLineParser.onExecute (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/RushCommandLineParser.js:182:13)
    at async RushCommandLineParser.executeWithoutErrorHandlingAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/ts-command-line/lib/providers/CommandLineParser.js:219:13)
    at async RushCommandLineParser.executeAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/ts-command-line/lib/providers/CommandLineParser.js:99:13)
    at async RushCommandLineParser.executeAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/RushCommandLineParser.js:168:16)
    at async RushCommandLineParser.execute (/Users/aramis.sennyey/Projects/rushstack/libraries/ts-command-line/lib/providers/CommandLineParser.js:142:16)

After

==[ FAILURE: 9 operations ]====================================================

--[ FAILURE: b (build) - shard 1/5 ]-------------------------[ 0.02 seconds ]--

Early return status should not be set: FAILURE

--[ FAILURE: b (build) - shard 2/5 ]-------------------------[ 0.01 seconds ]--

Early return status should not be set: FAILURE

--[ FAILURE: b (build) - shard 3/5 ]-------------------------[ 0.01 seconds ]--

Early return status should not be set: FAILURE

--[ FAILURE: b (build) - shard 4/5 ]-------------------------[ 0.01 seconds ]--

Early return status should not be set: FAILURE

--[ FAILURE: b (build) - shard 5/5 ]-------------------------[ 0.01 seconds ]--

Early return status should not be set: FAILURE

--[ FAILURE: a (build) - shard 1/4 ]-------------------------[ 0.01 seconds ]--

Early return status should not be set: FAILURE

--[ FAILURE: a (build) - shard 2/4 ]-------------------------[ 0.01 seconds ]--

Early return status should not be set: FAILURE

--[ FAILURE: a (build) - shard 3/4 ]-------------------------[ 0.01 seconds ]--

Early return status should not be set: FAILURE

--[ FAILURE: a (build) - shard 4/4 ]-------------------------[ 0.01 seconds ]--

Early return status should not be set: FAILURE


Operations failed.

rush cobuild (0.23 seconds)

Error: An error occurred.
    at PhasedScriptAction._executeOperationsAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/scriptActions/PhasedScriptAction.js:642:19)
    at async PhasedScriptAction._runInitialPhasesAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/scriptActions/PhasedScriptAction.js:371:9)
    at async PhasedScriptAction.runAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/scriptActions/PhasedScriptAction.js:335:37)
    at async RushCommandLineParser.onExecute (/Users/aramis.sennyey/Projects/rushstack/libraries/ts-command-line/lib/providers/CommandLineParser.js:275:13)
    at async RushCommandLineParser._wrapOnExecuteAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/RushCommandLineParser.js:234:13)
    at async RushCommandLineParser.onExecute (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/RushCommandLineParser.js:182:13)
    at async RushCommandLineParser.executeWithoutErrorHandlingAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/ts-command-line/lib/providers/CommandLineParser.js:219:13)
    at async RushCommandLineParser.executeAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/ts-command-line/lib/providers/CommandLineParser.js:99:13)
    at async RushCommandLineParser.executeAsync (/Users/aramis.sennyey/Projects/rushstack/libraries/rush-lib/lib-commonjs/cli/RushCommandLineParser.js:168:16)
    at async RushCommandLineParser.execute (/Users/aramis.sennyey/Projects/rushstack/libraries/ts-command-line/lib/providers/CommandLineParser.js:142:16)

Impacted documentation

None.

@dmichon-msft dmichon-msft merged commit e619556 into microsoft:main Jul 31, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

[rush] cobuild errors are not properly propagated.
2 participants