-
Notifications
You must be signed in to change notification settings - Fork 389
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
[build] Basic fixes and extentions to build scripting #1231
base: master
Are you sure you want to change the base?
Conversation
1. Fixed various syntax issues, including an unquoted variable in conditional test (Debug or Release log file name), superfluous backslashes, spaces between errorlevel tests and tested functions, MSBuild syntax consolidaiton, prefixing FOR do commands with @, etc. 2. Unwrapped nested IF statements to ensure no jumping out of loops or other unexpected behaviours. 3. Updated usage, including Win11 target and explanation regarding analysis builds (build.bat only). 4. Added analysis build specific variables CODEQL_FAILED and SDV_FAILED to init area (build.bat only). 5. Refactored fail code, removing return failure detection in favour of in-line failure detection. 6. Updated labels to use snake style notation. 7. Refactored end of build_arch function to avoide "goto :eof" and instead use ":build_arch_done" to ensure POPD occurs and ":build_arch_skip" to check for success before ending the local environment (build.bat only). 8. Do conditional (if exists) removal of sdv and codeql_db folders (build.bat only). 9. Additional commenting and stdout output (logging). 10. Remove superfluous newline spacing. 11. Removed packaging folder from build per PRs virtio-win#1209 and virtio-win#1224 (buildAll.bat only). 12. Consolidated exiting function (whether success or fail) to :leave (buildAll.bat only). Split from PR virtio-win#1212. .,ueeeeeu, e$$$$$P?$$$$$b :$$$$" '$$$$c $$$$ $$$$c $$$6 $$$$$ $$$F $$$$" $$$F $$$F $$$$ $$$F $$$$ J$$F .ccCCCCCCCCc,. ?$$$ $$$$$$e ,CCCCCCCCCCCCCCCCCCc :$$$ `$$$$$" CCCCCCCCCCCCCC" CCCCCC. `$$$. CCCCCCCCCCC" .,d.`CCCCCC. $$$t .,uuuuu,. <CCC . `"",$$$$$$L CCCCCC ?$$$ ,HHHHHHHHHHHHHb, CCC $$$$$$$$$P"""" `CCCCC `$$$ 4F"" .,uuuuuuu,,,,. `CC '=- "$$$="""$$r C><C `$$$, zuHF""`.,,,,,,. ""??HH `CC bue$:$$$$bd$$$ C ? C $$$$ -=='.ee???$eeeec,,,.`=. `C $$$$ $$P???$$$ C cC ?$$$ ,H"" .e$P"""?heeee,,."" .'P .cc-=<Cc, cC'CC' `$$$ HH jF $$$b,/"""cd$$..,,) \ dP". .,cCCCP u `$$$. .HHH H':F $$$du,$$$$ ' ";l CCCCCCCCCCCCC'.$$ $$$h HHHF H H "$$$$$F d$ 4$$ H ,z "?CCCCCCCCP J$$ :: $ ?$$$ HHH'jF.H % $P" ...'" u$ J' .d$$$$F . ....zd$P" :::d$ :$$$ HHH H HF %%,%%" %' dH j$$$$$$$$ ::: ::::: $$ ? HF %%%%%.%. " % JHf :: $$$$$$$$$. :::::::::::::::d$$ .::::::::::::: '%%%%%%%%%%/ H" ::::: $$$$$$$$$$ ::::::::::::::d$$$ :::'``````````'::: `%%%%%%%%% JH dH :::::: ?$$$$$$$$$ `:::::::::::: $$$$ ..:::::::::::::::. %%%%%%/', H" H","" `::: ?$$$$$$$$$" :::::::::::`$$$$$ ... . ::: : . `: `eeeee;".F -.H dHHHHc. $$$$$F"`.=" `:::::::` '?$$$$ ::::: .ze$eu . `: =uuuu/"z".H" HHHHHHHHHHe. "" e$$$$$$b :::: ee,. '$$ ' z$$$$$$$$$$$$$ `.zeed?"".dHF HHHHHHHHHHHHHH $$$$$beeem ': ec,"$$$$ ' : 4$$$ . $$$$?? beeeeeedHF"".HHHHHF"" _,,.. `$$$$cze= ':,,`"$$$$$$$ : $$$$$b,,d$F , .HHF""".,zeHHHHF" ,i!"` .,;i!!!i;. ?$bee` ::`""9$$$$$$$ : $$$$$$$$$$$L., c,,eeHHHHHHHHF ,i!' .;!!!!!!!!!!!!!!. . ::::""??$$$$$$$ J$$$$$??$,`'". .HHHHHHHHHHHH" ,!!'.i!!!!!!!!!!!!!!!!!! \ ::::: d$bc."??$ "$$$$$$h .; .HHHHHHHHHHHF" ,!!',! !!!!!!''''` '''<!!i ? :::: d$$$$$ :$ "$$$$$$$F uHHHHHHHHHHH" ,!! ,!! !!!" !i ::: $$$$$ $$$ """ "HHHHHHHHH ,!!',!!!! !" .d$$$$ezece$$$, ! ::: d$$$$$' ...: :::::::: 3HHHHH" ,!!',!!!!! d$$$$$$$$$$$$$$$t > ::: d$$$$$ :::: ::` .::::: HHHHF ,!!' !!!!!! 9$$P""""?$$$$$$$$" ! ; `:: $$$$$$ : ::: .::::::::: ?HH" ,!!! !!!!!!! 3$$$.``''$$$F - ; ! ! `: $$$$$$`:: :: .::::::::::: H" ,!!!'<!!!!!!!i $$$$$$$$$$ teeJ' . ! ! : d$$$$$$`:: ` .:::::::::::::: " ,!!!! <!!!!!!!! $$$$$$P??'?$$ ! !i ` d$$$$$$L:: ::::::::::: `<!!! !!!!!!!!' '$$u,"""" ,' . ; ! `!. d$$$$$$$:: .::::::: aeeee$$$$$$e <!!!!!!!' '.^$$$$$$F' ; !! !!, $$$$$$$$`: ::::::::::`""777d$$$$$$u !!!!!! ' $$ee...e% < , !! `!!i$$$$$$$L : ``````::`` d$$$$$ ?$$$b `!!!' , . $$$$$$$$ . . !! !!!,$$$$$$$ : eccec,. ,zd$$$$$$$$$$>$L; !' ; , """"""" ; \ `! !!!,?$$$$$ ` $$$$$$$$d$$$$$$$$$P""""` . . ' !!!!!!!!! . `; ` ` !, !!i"$$$$ ` $$$$$$$$$$$$$$$$$F i!!' ,' .. .. ``!!! ! `; \ ` `\`!!.$$$L >>>"""""""??$$$$k ==" !!' ' , , d$$" u":". !! ! \ `; ` i!i,`!!, ?$F $$$$UUU$$$$u,"?$$$ =" r ' $F4 ".$$LJ 3$L !!,` ', \ !!i,.`!i.`!.$ $$$$$$$$$$$ec. d$$$ f '" $$F4.$"zP"$$b."b !!,` '! . :!!!!!!i.`!i """```"=??he, ?$$$b ,i'! ! d$$$$$d$b$$$$$$F?$ `!='' ..... `!,!i ,,,, ,,, ::: $$$$ `!i 'i" $$$$$$$$$$$$$$$c`" d$$$$$$bc, "?$$$$$$$.!,`!i $$$' $$$ '::::: '$$$> !!!!! `?$$$$$$$$$$$$F d$$$$$$$$$$F,u.'$$$$$$c!i`! : .$$$"x ::::: $$$ i!!!!!, $. ``"""""" .,z$$$P"?$$$",ed$$$b $$$$$$i!!! $e $$$" $R ::::: 3$$ !!!!!!!,`$$bd"uer .dP"""?$$. ?y, "4$$$$$$,`$$$$Fi!!! " d$$$ :::::::: )$$ !!!!!!i `$$bc . "?bey,. `d$$e `$$$$F $PP"i!!!! d$$F $r :::::: $$$ )!!!!!! `$$$L".W. "?$by,`"d$$$$$$c $$$" .eeeeu '! J$$" : .:::: . """ !!!!!!!i. `??$ .,._ `"3$$$$$$$$$b,,,d$$$$$$$$c "$" ::::::' : !!!!!!!!!!!!i;;i! ueee. `"?$$$$$$$$$$$$$$$$$$$$$$$$$$$F :.::::::: `:: :: <!!!!!!!!!!!!> z$$$$$$$$$$$be..`'<<<??$$$$$$$$$$$$$$$F.i :::::::: : :: :: !!!!!!!!!!!':$$$$$$$$$$$$$$$$$$beeeeeee,. ```"`,i!!! :::::: ::: ::: : !!!!!!!!!' . ""??$$$$$$$$$$$$$$PF"""'` .,,;;ii!!!!!!!! ::::: ::: `:: :: `!!!!!!! !!!!!i,,,,... .....,,,;;;ii!!!!!!!!!!!!!!!!! ::: :: :::: :: :: !!!!!' ,!!!!!!!!!!!!",!!!!!!!!!!!!!!!!!,`!!!!!!!!!!!!! :` ':: :::: :: :: !!!!' !!!!!!!!!!!!! ,!!!!!!!!!!!!!!!!!!!i!!!!!!!!!!!!! .:: :: :::: :: :: !!!' !!!!!!!!!!!!'.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! :::: :: :::: :: :: !!' !!!!!!!!!!!!',!!!!''.,;;;;;,.`'''''''`!!!!!!!!!!!! :::: :' :::: `: `: !'.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!i;,,..`'<!!!!! ::: :' ::::: :: :: .!!!! .!!!!!!!i!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!i;;,, ' ::`.: .:''` .. . `` . ' , '!!!!i!!!!>:!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ...\..>\\.\\.\\\\ ,/ |, ''```''`<<''<'<<<<<<<!!!!!!!!!!!!!!!!!!!! `\>/`\\\>\%`%%"./'%..\=///,%//,,/', ,/'' ,/ , `'''''''''''''''''!!!!!!! //>;>;\.""./';./>.`\- |`/./'','./|'"/`\\</%/'//%','::::::::::::::::!!!!!!' \.:\'.'///'">>>`,`/'. '. ,` ,/',/',|%//<</,'<^< -=-<'\\'-::``,::'.!!!'` . /==>'/%.////;.//>>,/,;,.-.`\`,..\`<.\\=\\-^//=/<<\\%'- ' .,::` ..:' '`.::: '/'/''/'/>.''</>(\<|/%<%///>\`\%</>>\\%\\\>/\'\\\\< `.,'' ..::'`.:.::::'` /',/"><|,/','/'>,/,/'>/|/>\\`|"\|<``\`\"" \<```.,,'`` ..::::..:::: ::: ::::::::::::::::::::::...::::::::::::::::::::''` ...::::::::::::::: ::: ............................................. .:::::::::::::::::::: ::: ::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::: . Signed-off-by: benyamin-codez <[email protected]>
for /f "tokens=1 delims=_" %%T in ("%1") do ( | ||
set TARGET_PROJ_CONFIG=%%T | ||
) | ||
for /f "tokens=2 delims=_" %%T in ("%1") do ( | ||
set TARGET_PLATFORM=%%T | ||
) | ||
for /f "tokens=3 delims=_" %%T in ("%1") do ( | ||
set TAG=%%T | ||
) | ||
for /f "tokens=1 delims=_" %%T in ("%1") do @set TARGET_PROJ_CONFIG=%%T | ||
for /f "tokens=2 delims=_" %%T in ("%1") do @set TARGET_PLATFORM=%%T | ||
for /f "tokens=3 delims=_" %%T in ("%1") do @set TAG=%%T |
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.
I prefer the old format to definitely know what is in the loop. Similar to in C++ to have {}
in condition with one line action.
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.
I found this necessary to avoid loop jumps under certain conditions when I added the other features in PR #1212.
Usually adding the @
fixes that, but iirc, this wasn't sufficient in this case. The only other technique I'm aware of is to use the usebackq
option, but I don't think that works here due to the use of ("%1")
which is BUILD_SPEC
.
I think it has more to do with the first set of parentheses than the second...
...but it's also potentially because we are using %1
and not %var%
, !var!
or even %%var%%
...
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.
@YanVugenfirer @ybendito What do you think? Any suggestions?
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.
@kostyanf14 @YanVugenfirer @ybendito
I note my comments further below:
This is the one that usually resulted in loop jumps and / or
unknown label :split_target_tag
errors.
It is caused by a parenthesis being skipped when the console host compiles the for loop.
I further note it is possible that delims=_
could be the culprit following / during compilation.
Having said that, either of these might work:
set BUILD_INFO = %1
for /f "tokens=1,2,3 delims=_" %%i in ("%BUILD_INFO%") do @(
set TARGET_PROJ_CONFIG=%%i
set TARGET_PLATFORM=%%j
set TAG=%%k
)
for /f "tokens=1,2,3 delims=_" %%i in ("!BUILD_SPEC!") do @(
set TARGET_PROJ_CONFIG=%%i
set TARGET_PLATFORM=%%j
set TAG=%%k
)
Note: The second one ignores the positional parameter and uses the parent variable instead.
Having said all that, I am minded to reiterate that single-line FOR commands are much more reliable...
...at least in my experience. 8^d
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.
Or even better:
for /f "tokens=1,2,3 delims=_" %%i in ("%1") do @set TARGET_PROJ_CONFIG=%%i && set TARGET_PLATFORM=%%j && set TAG=%%k
for /f "tokens=1 delims=_" %%T in (%1) do @set TARGET=%%T | ||
for /f "tokens=2 delims=_" %%T in (%1) do @set TAG=_%%T |
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.
same here
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.
This is the one that usually resulted in loop jumps and / or unknown label :split_target_tag
errors.
It is caused by a parenthesis being skipped when the console host compiles the for loop.
Addendum to fdf1f44. 1. Refactor following review: EWDK and COMPAT DVL descriptions Signed-off-by: benyamin-codez <[email protected]>
Just concerns re |
Split from PR #1212.