-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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 Ilasm Round Trip script by adding retry logic #46765
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,13 +109,37 @@ then | |
echo EXECUTION OF ILDASM - FAILED $ERRORLEVEL | ||
exit 1 | ||
fi | ||
if [ ! -f "$(DisassemblyName)" ] | ||
then | ||
echo "EXECUTION OF ILDASM - FAILED $(DisassemblyName) is missing" | ||
exit 1 | ||
fi | ||
|
||
ilasm_count=1 | ||
while true | ||
do | ||
echo "$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName) | ||
"$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName) | ||
ERRORLEVEL=$? | ||
if [ $ERRORLEVEL -eq 0 ] | ||
then | ||
break | ||
fi | ||
|
||
echo EXECUTION $ilasm_count OF ILASM - FAILED with $ERRORLEVEL | ||
|
||
if [ $ilasm_count -eq 3 ] | ||
then | ||
break | ||
fi | ||
|
||
((ilasm_count++)) | ||
echo Trying again | ||
sleep 10 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like |
||
done | ||
|
||
echo "$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName) | ||
"$CORE_ROOT/ilasm" -output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName) | ||
ERRORLEVEL=$? | ||
if [ $ERRORLEVEL -ne 0 ] | ||
then | ||
echo EXECUTION OF ILASM - FAILED $ERRORLEVEL | ||
exit 1 | ||
fi | ||
fi | ||
|
@@ -163,14 +187,29 @@ IF NOT DEFINED DoLink ( | |
IF DEFINED RunningIlasmRoundTrip ( | ||
ECHO %CORE_ROOT%\ildasm.exe /raweh /out=$(DisassemblyName) $(InputAssemblyName) | ||
%CORE_ROOT%\ildasm.exe /raweh /out=$(DisassemblyName) $(InputAssemblyName) | ||
|
||
IF NOT "!ERRORLEVEL!"=="0" ( | ||
ECHO EXECUTION OF ILDASM - FAILED !ERRORLEVEL! | ||
Exit /b 1 | ||
) | ||
IF NOT EXIST $(DisassemblyName) ( | ||
ECHO EXECUTION OF ILDASM - FAILED $(DisassemblyName) is missing | ||
Exit /b 1 | ||
) | ||
|
||
set ilasm_count=1 | ||
:Try_ilasm | ||
ECHO %CORE_ROOT%\ilasm.exe /output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName) | ||
%CORE_ROOT%\ilasm.exe /output=$(TargetAssemblyName) $(_IlasmSwitches) $(DisassemblyName) | ||
IF NOT "!ERRORLEVEL!"=="0" ( | ||
ECHO EXECUTION OF ILASM - FAILED !ERRORLEVEL! | ||
ECHO EXECUTION OF ILASM - Try !ilasm_count! FAILED with status !ERRORLEVEL! | ||
IF !ilasm_count! LEQ 3 ( | ||
ECHO Trying again | ||
set /A ilasm_count=ilasm_count+1 | ||
timeout /t 10 /nobreak | ||
goto :Try_ilasm | ||
) | ||
ECHO EXECUTION OF ILASM - FAILED | ||
Exit /b 1 | ||
) | ||
) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this should be a
>=
instead of==
? (is that-ge
?)