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

[Bug]: Build Scripts will run when no suitable environment is detected. Add 'BinLog' option to build-*.cmd #1475

Closed
giduac opened this issue May 22, 2024 · 17 comments
Labels
bug Something isn't working fixed This issue has been fixed.
Milestone

Comments

@giduac
Copy link
Contributor

giduac commented May 22, 2024

Describe the bug PR 1476
When no suitable environment is detected by the build scripts will still try to run.

Excerpt from build-nightly.cmd.

@echo off

if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin" goto vs17prev
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" goto vs17ent
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Professional\MSBuild\Current\Bin" goto vs17pro
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin" goto vs17com
if exist "%ProgramFiles%\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin" goto vs17build

echo "Unable to detect suitable environment. Check if VS 2022 is installed."

pause

:vs17prev
set msbuildpath=%ProgramFiles%\Microsoft Visual Studio\2022\Preview\MSBuild\Current\Bin
goto build

Proposed solution:

Add a goto exitbatch statement after pause.
Add the :exitbatch label at the end of the file.

Add the "/bl" parameter to the msbuild line of build-nightly.cmd

"%msbuildpath%\msbuild.exe" -t:%targets% nightly.proj /fl /flp:logfile=build.log /bl

This will output, next to the build.log, a msbuild.binlog that can be viewed/examined with "MSBuild Binary and Structured Log Viewer".

@giduac giduac added the bug Something isn't working label May 22, 2024
@giduac
Copy link
Contributor Author

giduac commented May 22, 2024

Hi @Wagnerp,
Please assign to me.
TY!

@PWagner1 PWagner1 assigned PWagner1 and giduac and unassigned PWagner1 May 22, 2024
@PWagner1 PWagner1 added the under investigation This bug/issue is currently under investigation. label May 22, 2024
@PWagner1 PWagner1 added this to the Version 90 milestone May 22, 2024
@PWagner1
Copy link
Contributor

Hi @Wagnerp, Please assign to me. TY!

Hi @giduac

Done, you might want to bump the version up. Currently it's 1.9.

@giduac
Copy link
Contributor Author

giduac commented May 22, 2024

@Wagnerp
Where is the version located and what would the next version number be?
Then I'll add it to the PR.

@PWagner1
Copy link
Contributor

@Wagnerp Where is the version located and what would the next version number be? Then I'll add it to the PR.

Hi @giduac

It's on line 9 of the batch file.

@giduac
Copy link
Contributor Author

giduac commented May 22, 2024

@Wagnerp Where is the version located and what would the next version number be? Then I'll add it to the PR.

Hi @giduac

It's on line 9 of the batch file.

Got it, I'll make it 2.0

@giduac giduac changed the title [Bug]: Build Scripts will run when no suitable environment is detected. | Add BinLog to option to build-nightly.cmd [Bug]: Build Scripts will run when no suitable environment is detected. | Add BinLog option to build-nightly.cmd May 22, 2024
@giduac giduac closed this as completed May 23, 2024
@PWagner1 PWagner1 changed the title [Bug]: Build Scripts will run when no suitable environment is detected. | Add BinLog option to build-nightly.cmd [Bug]: Build Scripts will run when no suitable environment is detected. Add 'BinLog' option to build-*.cmd May 24, 2024
@giduac
Copy link
Contributor Author

giduac commented May 25, 2024

Hi @Wagnerp ,

May be another interesting switch to use with msbuild.
This one removes unnecessary output:

 /consoleloggerparameters:Summary /verbosity:quiet

More info here

@PWagner1
Copy link
Contributor

Hi @Wagnerp ,

May be another interesting switch to use with msbuild. This one removes unnecessary output:

 /consoleloggerparameters:Summary /verbosity:quiet

More info here

Hi @giduac

That does lower the verbosity a lot! I wonder if we can also package the binaries into zip files for distribution?

@giduac
Copy link
Contributor Author

giduac commented May 25, 2024

@Wagnerp
I was thinking about a Windows frontend for building. But needs a decent redirection of the msbuild console output into the app. Adding compression could be a part, etc....

@giduac
Copy link
Contributor Author

giduac commented May 25, 2024

@Wagnerp
For zipping you can use 7zip.
It's free and has a command line zipper: 7z.exe
That can be scripted.

@PWagner1
Copy link
Contributor

@Wagnerp For zipping you can use 7zip. It's free and has a command line zipper: 7z.exe That can be scripted.

Hi @giduac

If you want to take a shot at this, then go ahead. The zip file should contain all DLL & XML files as laid out in the bin directory. As for the file name, I think it should be Standard_Toolkit-<#BUILD-VERSION#>-<#DATE#>-<alpha/beta/stable>.zip. Thoughts @giduac & @Smurf-IV?

@giduac
Copy link
Contributor Author

giduac commented May 26, 2024

@Wagnerp For zipping you can use 7zip. It's free and has a command line zipper: 7z.exe That can be scripted.

Hi @giduac

If you want to take a shot at this, then go ahead. The zip file should contain all DLL & XML files as laid out in the bin directory. As for the file name, I think it should be Standard_Toolkit-<#BUILD-VERSION#>-<#DATE#>-<alpha/beta/stable>.zip. Thoughts @giduac & @Smurf-IV?
@Wagnerp
What is the use of these zips as you can get all builds from Nuget?

@PWagner1
Copy link
Contributor

@Wagnerp For zipping you can use 7zip. It's free and has a command line zipper: 7z.exe That can be scripted.

Hi @giduac
If you want to take a shot at this, then go ahead. The zip file should contain all DLL & XML files as laid out in the bin directory. As for the file name, I think it should be Standard_Toolkit-<#BUILD-VERSION#>-<#DATE#>-<alpha/beta/stable>.zip. Thoughts @giduac & @Smurf-IV?
@Wagnerp
What is the use of these zips as you can get all builds from Nuget?

@giduac Another way to distribute builds, via WinGet?

@Smurf-IV
Copy link
Member

Why is zipping Needed ?
That's what the nuget is for !
If a developer has done the building, then adding the reference to the project will also still work ? (That's how the samples do their thing)

@giduac
Copy link
Contributor Author

giduac commented May 26, 2024

@Wagnerp For zipping you can use 7zip. It's free and has a command line zipper: 7z.exe That can be scripted.

Hi @giduac
If you want to take a shot at this, then go ahead. The zip file should contain all DLL & XML files as laid out in the bin directory. As for the file name, I think it should be Standard_Toolkit-<#BUILD-VERSION#>-<#DATE#>-<alpha/beta/stable>.zip. Thoughts @giduac & @Smurf-IV?
@Wagnerp
What is the use of these zips as you can get all builds from Nuget?

@giduac Another way to distribute builds, via WinGet?
@Wagnerp
And winget is integratable with VStudio ?

@giduac
Copy link
Contributor Author

giduac commented May 26, 2024

@Wagnerp
I've been fiddling a bit with a windows frontend for creating builds.
It's pretty simple atm. But building works fine and the msbuild screen output is redirected into the program and can be handled.
Looks interesting and promising....

@PWagner1
Copy link
Contributor

@Wagnerp I've been fiddling a bit with a windows frontend for creating builds. It's pretty simple atm. But building works fine and the msbuild screen output is redirected into the program and can be handled. Looks interesting and promising....

Hi @giduac

I've been wondering for some time now whether to create a app to batch upload nugets. At the moment it's done by batch files, but I can't integrate it into the build system, as it would expose the API key to everyone.

@giduac
Copy link
Contributor Author

giduac commented May 26, 2024

@Wagnerp I've been fiddling a bit with a windows frontend for creating builds. It's pretty simple atm. But building works fine and the msbuild screen output is redirected into the program and can be handled. Looks interesting and promising....

Hi @giduac

I've been wondering for some time now whether to create a app to batch upload nugets. At the moment it's done by batch files, but I can't integrate it into the build system, as it would expose the API key to everyone.
So that's done kind of manually.

That front end can have an option for that which would only work if an API key is available in a certain location or so...
Or run those batch files in the background...

@PWagner1 PWagner1 removed the under investigation This bug/issue is currently under investigation. label Jun 11, 2024
@PWagner1 PWagner1 added the fixed This issue has been fixed. label Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed This issue has been fixed.
Projects
None yet
Development

No branches or pull requests

3 participants