Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 915174 - Dotnet sdk verbosity build
Summary: Dotnet sdk verbosity build
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Lowest enhancement
Assignee: dotnet project
URL:
Whiteboard:
Keywords: EBUILD, PATCH
Depends on:
Blocks:
 
Reported: 2023-10-04 13:51 UTC by Kyle Rabago
Modified: 2023-10-23 14:35 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Example patch of the Directory.Build.targets file to set it up for verbose syntax printing (verbose.patch,1.77 KB, patch)
2023-10-04 13:51 UTC, Kyle Rabago
Details | Diff
tarball of verbosity patches (needed for logging to work) (dotnet-sdkbuildpatches.tar.gz,3.27 KB, application/gzip)
2023-10-05 16:32 UTC, Kyle Rabago
Details
Updated tarball with all patches (dotnet-sdkbuildpatches.tar.gz,3.32 KB, application/gzip)
2023-10-05 16:56 UTC, Kyle Rabago
Details
Script to apply patches (absolute paths as of now, change where needed to make it work with portage) (patch.sh,4.67 KB, application/x-shellscript)
2023-10-06 17:47 UTC, Kyle Rabago
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle Rabago 2023-10-04 13:51:31 UTC
Created attachment 872129 [details, diff]
Example patch of the Directory.Build.targets file to set it up for verbose syntax printing

Simply put in order to get the dotnet-sdk bundle to fully build verbosely and too log to emerge log, alot of "hacking" of the xmls used as configs for msbuild/build.sh must be done, as so far all I have is a patch of the general config for true false  <LogVerbosityOptOut>false</LogVerbosityOptOut> for this opiton found in the repo projects sub folder for each .proj file, this determines which syntax will be used for implenting the correct syntax for verbose options set in the Directory.Build.targets file (see patch above to correctly setup this file). However while this is a general method, some of the projects found in this bundle, ie the runtime use a Innerbuild command which does not listen to our verbosity due to looking for a completely different file for its config in terms of build options. Overall after changing the Directory target file (see patch) most will work verbosely however some cannont use the true option syntax (-v) and require the other syntax which is only applied when LogVerbosityOptOut is set to false in the individual proj files (ie roslyn needs this or it fails its build). Therefore, we will not be able to fully make each build verbose as some of the builds dont only use the Directory targets file as config (see innerbuild), of which if we tried to hack the file they use would cause issues as they also look for a file which is globally used in the build (we cant set it due to causing conflicts after the runtime build). Therefore in total this bug is to leave a space for verbose patches/hacks to get this ebuild printing more output as it works through all of the projects included in the bundle.
Comment 1 Kyle Rabago 2023-10-04 13:52:15 UTC
(In reply to Kyle Rabago from comment #0)
> Created attachment 872129 [details, diff] [details, diff]
> Example patch of the Directory.Build.targets file to set it up for verbose
> syntax printing
> 
> Simply put in order to get the dotnet-sdk bundle to fully build verbosely
> and too log to emerge log, alot of "hacking" of the xmls used as configs for
> msbuild/build.sh must be done, as so far all I have is a patch of the
> general config for true false 
> <LogVerbosityOptOut>false</LogVerbosityOptOut> for this opiton found in the
> repo projects sub folder for each .proj file, this determines which syntax
> will be used for implenting the correct syntax for verbose options set in
> the Directory.Build.targets file (see patch above to correctly setup this
> file). However while this is a general method, some of the projects found in
> this bundle, ie the runtime use a Innerbuild command which does not listen
> to our verbosity due to looking for a completely different file for its
> config in terms of build options. Overall after changing the Directory
> target file (see patch) most will work verbosely however some cannont use
> the true option syntax (-v) and require the other syntax which is only
> applied when LogVerbosityOptOut is set to false in the individual proj files
> (ie roslyn needs this or it fails its build). Therefore, we will not be able
> to fully make each build verbose as some of the builds dont only use the
> Directory targets file as config (see innerbuild), of which if we tried to
> hack the file they use would cause issues as they also look for a file which
> is globally used in the build (we cant set it due to causing conflicts after
> the runtime build). Therefore in total this bug is to leave a space for
> verbose patches/hacks to get this ebuild printing more output as it works
> through all of the projects included in the bundle.

Also included in this is the use of args to create a build log that can be set as our emerge log so we can have something for the user to use as a debug for failing builds/etc
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-04 13:56:03 UTC
(please use some whitespace if you can for big comments)

I'm not one of the dotnet people right now, but how is this different from bug 915113 for the purpose of triaging/titling/...?
Comment 3 Kyle Rabago 2023-10-04 13:58:59 UTC
(In reply to Sam James from comment #2)
> (please use some whitespace if you can for big comments)
> 
> I'm not one of the dotnet people right now, but how is this different from
> bug 915113 for the purpose of triaging/titling/...?

I just wanted to clean up that bug post since it had alot and now that I know that in order to change this build to make it more verbose/loggable we have to make patches and such I wanted a clean place to start, my bad on the whitespaces I am really new to working with bugzilla
Comment 4 Kyle Rabago 2023-10-04 14:00:30 UTC
(In reply to Sam James from comment #2)
> (please use some whitespace if you can for big comments)
> 
> I'm not one of the dotnet people right now, but how is this different from
> bug 915113 for the purpose of triaging/titling/...?

Sorry if this seems a duplicate just wanted a clean place to start with working with patches and "hacks" of the build (once again I am really new to using bugzilla)
Comment 5 Maciej Barć gentoo-dev 2023-10-04 14:02:01 UTC
Thanks a lot for the patch Kyle!
Comment 6 Kyle Rabago 2023-10-04 14:02:54 UTC
(In reply to Maciej Barć from comment #5)
> Thanks a lot for the patch Kyle!

No worries I am working on testing the build, will upload patches required for the .proj files when build succeeds for v8.0, Thanks as well Maciej!
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-10-04 14:06:32 UTC
(In reply to Kyle Rabago from comment #3)
> (In reply to Sam James from comment #2)
> > (please use some whitespace if you can for big comments)
> > 
> > I'm not one of the dotnet people right now, but how is this different from
> > bug 915113 for the purpose of triaging/titling/...?
> 
> I just wanted to clean up that bug post since it had alot and now that I
> know that in order to change this build to make it more verbose/loggable we
> have to make patches and such I wanted a clean place to start, my bad on the
> whitespaces I am really new to working with bugzilla

no worries at all - not a telling off :)
Comment 8 Kyle Rabago 2023-10-04 14:09:12 UTC
(In reply to Sam James from comment #7)
> (In reply to Kyle Rabago from comment #3)
> > (In reply to Sam James from comment #2)
> > > (please use some whitespace if you can for big comments)
> > > 
> > > I'm not one of the dotnet people right now, but how is this different from
> > > bug 915113 for the purpose of triaging/titling/...?
> > 
> > I just wanted to clean up that bug post since it had alot and now that I
> > know that in order to change this build to make it more verbose/loggable we
> > have to make patches and such I wanted a clean place to start, my bad on the
> > whitespaces I am really new to working with bugzilla
> 
> no worries at all - not a telling off :)

Thanks you all for working with/on Gentoo by the way, really love this community and learning from it/contributing to it!
Comment 9 Kyle Rabago 2023-10-04 14:12:15 UTC
Other than these changes the only other part of this build that I guess you could say could be made more verbose is the whole Innerbuild thing, as it is really being a pain, as editing the config file for innerbuild may work for say the runtime but it will break on other projects so yeah, would be really nice if we found a way to just tell each build to use the normal level of verbosity like a variable or something but msbuild/and such are very confusing in terms of finding where variables are made in such a big project/bundle of projects
Comment 10 Kyle Rabago 2023-10-04 14:14:38 UTC
https://git.alpinelinux.org/aports/commit/?id=95d5a315a7a1b8676f7c0546e8249421ed412f9d intresting link by the way of the alpine linux team in terms of building this same sorta package and how they edited their proj/target files
Comment 11 Kyle Rabago 2023-10-04 14:23:56 UTC
A major question I must know is do we want the verbosity to be set to normal the entire time or have it be set to detailed for all, as detailed can be a big jump in terms of output than normal
Comment 12 Maciej Barć gentoo-dev 2023-10-04 14:25:08 UTC
Anything more then normal will produce too much logs.
Comment 13 Kyle Rabago 2023-10-04 14:25:42 UTC
(In reply to Kyle Rabago from comment #11)
> A major question I must know is do we want the verbosity to be set to normal
> the entire time or have it be set to detailed for all, as detailed can be a
> big jump in terms of output than normal

or we can even set it by project if we want, I think I have figured out a way to do this even, specfically on fsharp as its normal output is very minimal and does not show much while its detailed output is much more verbose and shows phases, etc
Comment 14 Kyle Rabago 2023-10-04 14:27:35 UTC
(In reply to Maciej Barć from comment #12)
> Anything more then normal will produce too much logs.

got it!
Comment 15 Kyle Rabago 2023-10-04 14:36:56 UTC
Just as a question maricej is there any advantage to creating mutiple ebuilds for each project over having them be one big source just wondering
Comment 16 Kyle Rabago 2023-10-04 16:06:33 UTC
Wow I actually got it to finally finish a build time to keep on testing though until I can get it to build without any errors
Comment 17 Kyle Rabago 2023-10-04 16:14:50 UTC
Wow I am also so blind, we still need to edit the directory targets file but we instead of setting verbosity there we can just pass it as an argument to each build.sh script, how did I not think of this earlier!
Comment 18 Kyle Rabago 2023-10-04 16:32:02 UTC
testing now if this is the case we may be almost perfect with version 8!!!
Comment 19 Kyle Rabago 2023-10-04 17:01:07 UTC
(In reply to Kyle Rabago from comment #18)
> testing now if this is the case we may be almost perfect with version 8!!!

As it turns out messing with the source-build-externals and refernce packages to get the verbosity of the nuget pkgs being built is a no go as I ran into errors however I will keep trying to fix this!
Comment 20 Kyle Rabago 2023-10-04 19:09:04 UTC
Offically have v8 building with all edits needed for a fully automated build, will work on patches (need to make one for each build.sh used) and such later (already have logging working)
Comment 21 Kyle Rabago 2023-10-05 14:33:43 UTC
In terms of the patches needed, a specific script will be needed to cd into each src 

projects directory (the one that contains the build.sh) and then patch it according to 

said name of the project (ie runtime.build.sh.patch will need to be patched in the runtime 

dir since each patch applies to a file of the same name build.sh. this script will most 

likely need to be ran after unpacking the tarball in the ebuild before anything else is 

ran as once its run, we can then use the src_build/top level build.sh to create our emerge 

log. Speaking of which at the start of every time you run this ebuild we need to make sure 

we delete our old logs as the size of them is very big (we could also delete it at the end 

of each build since its not needed unless it fails) to save space. Lemme know if you have 

a way to apply this script idea and can send me a script to then place in the patches.       

once again thanks to everyone working on this its been a great learning experience!
Comment 22 Kyle Rabago 2023-10-05 14:34:24 UTC
(In reply to Kyle Rabago from comment #21)
> In terms of the patches needed, a specific script will be needed to cd into
> each src 
> 
> projects directory (the one that contains the build.sh) and then patch it
> according to 
> 
> said name of the project (ie runtime.build.sh.patch will need to be patched
> in the runtime 
> 
> dir since each patch applies to a file of the same name build.sh. this
> script will most 
> 
> likely need to be ran after unpacking the tarball in the ebuild before
> anything else is 
> 
> ran as once its run, we can then use the src_build/top level build.sh to
> create our emerge 
> 
> log. Speaking of which at the start of every time you run this ebuild we
> need to make sure 
> 
> we delete our old logs as the size of them is very big (we could also delete
> it at the end 
> 
> of each build since its not needed unless it fails) to save space. Lemme
> know if you have 
> 
> a way to apply this script idea and can send me a script to then place in
> the patches.       
> 
> once again thanks to everyone working on this its been a great learning
> experience!

sorry if whitespacing is bad not sure how to format this correctly (tried to put some space between each comment)
Comment 23 Kyle Rabago 2023-10-05 14:39:16 UTC
In terms of the patches needed, a specific script will be needed to cd into each src   projects directory (the one that contains the build.sh) and then patch it according to said name of the project (ie runtime.build.sh.patch will need to be patched in the runtime dir since each patch applies to a file of the same name build.sh. this script will most likely need to be ran after unpacking the tarball in the ebuild before anything else is ran as once its run, we can then use the src_build/top level build.sh to create our emerge log. Speaking of which at the start of every time you run this ebuild we need to make sure we delete our old logs as the size of them is very big (we could also delete it at the end of each build since its not needed unless it fails) to save space. Lemme know if you have a way to apply this script idea and can send me a script to then place in the patches. once again thanks to everyone working on this its been a great learning experience! this should be a bit better sorry
Comment 24 Maciej Barć gentoo-dev 2023-10-05 15:33:17 UTC
Are you sure a script is needed?
Can we not use some Directory.Build.props file?
Comment 25 Kyle Rabago 2023-10-05 15:40:41 UTC
(In reply to Maciej Barć from comment #24)
> Are you sure a script is needed?
> Can we not use some Directory.Build.props file?

no because of the way we add the verbosity flag is on each build.sh for each one of the projects (runtime,sdk,msbuild,etc) therefore we need to patch each one seperately as its the only way to make each build work as we need, I am working on the patches right now will upload them as a tarball (each patch is named for what it needs to be applied to ie fsharpbuildsh.patch, etc)
Comment 26 Kyle Rabago 2023-10-05 16:32:15 UTC
Created attachment 872191 [details]
tarball of verbosity patches (needed for logging to work)

This is a tarball for all the patches needed and also includes the Directory.Build.targets so old attachment is obsolete, lemme know what you think
Comment 27 Kyle Rabago 2023-10-05 16:32:56 UTC
(In reply to Kyle Rabago from comment #26)
> Created attachment 872191 [details]
> tarball of verbosity patches (needed for logging to work)
> 
> This is a tarball for all the patches needed and also includes the
> Directory.Build.targets so old attachment is obsolete, lemme know what you
> think 

Once you apply all the patches it should work for version 8
Comment 28 Kyle Rabago 2023-10-05 16:36:29 UTC
(In reply to Kyle Rabago from comment #27)
> (In reply to Kyle Rabago from comment #26)
> > Created attachment 872191 [details]
> > tarball of verbosity patches (needed for logging to work)
> > 
> > This is a tarball for all the patches needed and also includes the
> > Directory.Build.targets so old attachment is obsolete, lemme know what you
> > think 
> 
> Once you apply all the patches it should work for version 8

Also make sure you add the correct -flp to the top level build.sh to get the log as well!
Comment 29 Maciej Barć gentoo-dev 2023-10-05 16:39:14 UTC
(In reply to Kyle Rabago from comment #28)
> 
> Also make sure you add the correct -flp to the top level build.sh to get the
> log as well!

I do not think I understand.

If you could provide a (as complete as is possible right now) ebuild how you see it that would help a lot.
Comment 30 Maciej Barć gentoo-dev 2023-10-05 16:46:47 UTC
I'm pretty sure "normal" verbosity is too verbose, that still shows all the compiler switches and file access checks.

"CoreCompile:" is probably the "worst" offender. Not surprised you wnated to delete log files then they would have been extremely big.

And to test just how verbose "normal" is:

> mkdir Tst
> cd Tst
> dotnet new console
> dotnet build --verbosity normal
Comment 31 Kyle Rabago 2023-10-05 16:50:02 UTC
(In reply to Maciej Barć from comment #30)
> I'm pretty sure "normal" verbosity is too verbose, that still shows all the
> compiler switches and file access checks.
> 
> "CoreCompile:" is probably the "worst" offender. Not surprised you wnated to
> delete log files then they would have been extremely big.
> 
> And to test just how verbose "normal" is:
> 
> > mkdir Tst
> > cd Tst
> > dotnet new console
> > dotnet build --verbosity normal

what you can do is have the log be minimal verbosity
-flp:logfile=MyProjectOutput.log;verbosity=minimal
Comment 32 Kyle Rabago 2023-10-05 16:50:22 UTC
(In reply to Kyle Rabago from comment #31)
> (In reply to Maciej Barć from comment #30)
> > I'm pretty sure "normal" verbosity is too verbose, that still shows all the
> > compiler switches and file access checks.
> > 
> > "CoreCompile:" is probably the "worst" offender. Not surprised you wnated to
> > delete log files then they would have been extremely big.
> > 
> > And to test just how verbose "normal" is:
> > 
> > > mkdir Tst
> > > cd Tst
> > > dotnet new console
> > > dotnet build --verbosity normal
> 
> what you can do is have the log be minimal verbosity
> -flp:logfile=MyProjectOutput.log;verbosity=minimal

if the stdout is verbose normal thats fine just have the log be minimal
Comment 33 Kyle Rabago 2023-10-05 16:52:49 UTC
(In reply to Kyle Rabago from comment #32)
> (In reply to Kyle Rabago from comment #31)
> > (In reply to Maciej Barć from comment #30)
> > > I'm pretty sure "normal" verbosity is too verbose, that still shows all the
> > > compiler switches and file access checks.
> > > 
> > > "CoreCompile:" is probably the "worst" offender. Not surprised you wnated to
> > > delete log files then they would have been extremely big.
> > > 
> > > And to test just how verbose "normal" is:
> > > 
> > > > mkdir Tst
> > > > cd Tst
> > > > dotnet new console
> > > > dotnet build --verbosity normal
> > 
> > what you can do is have the log be minimal verbosity
> > -flp:logfile=MyProjectOutput.log;verbosity=minimal
> 
> if the stdout is verbose normal thats fine just have the log be minimal

also forgot one patch will add new attach one sec
Comment 34 Kyle Rabago 2023-10-05 16:56:07 UTC
Created attachment 872192 [details]
Updated tarball with all patches

Updated with one more needed patch
Comment 35 Kyle Rabago 2023-10-05 17:13:20 UTC
(In reply to Maciej Barć from comment #30)
> I'm pretty sure "normal" verbosity is too verbose, that still shows all the
> compiler switches and file access checks.
> 
> "CoreCompile:" is probably the "worst" offender. Not surprised you wnated to
> delete log files then they would have been extremely big.
> 
> And to test just how verbose "normal" is:
> 
> > mkdir Tst
> > cd Tst
> > dotnet new console
> > dotnet build --verbosity normal

I see now hmm I say we just leave it as normal and delete the log after the build/before the build too (since its only needed for debugging a failed build)
Comment 36 Kyle Rabago 2023-10-05 17:15:45 UTC
(In reply to Kyle Rabago from comment #35)
> (In reply to Maciej Barć from comment #30)
> > I'm pretty sure "normal" verbosity is too verbose, that still shows all the
> > compiler switches and file access checks.
> > 
> > "CoreCompile:" is probably the "worst" offender. Not surprised you wnated to
> > delete log files then they would have been extremely big.
> > 
> > And to test just how verbose "normal" is:
> > 
> > > mkdir Tst
> > > cd Tst
> > > dotnet new console
> > > dotnet build --verbosity normal
> 
> I see now hmm I say we just leave it as normal and delete the log after the
> build/before the build too (since its only needed for debugging a failed
> build)

besides being more verbose is always better in my book, esepecially with such a massive source like this bundle
Comment 37 Kyle Rabago 2023-10-05 17:32:38 UTC
(In reply to Kyle Rabago from comment #36)
> (In reply to Kyle Rabago from comment #35)
> > (In reply to Maciej Barć from comment #30)
> > > I'm pretty sure "normal" verbosity is too verbose, that still shows all the
> > > compiler switches and file access checks.
> > > 
> > > "CoreCompile:" is probably the "worst" offender. Not surprised you wnated to
> > > delete log files then they would have been extremely big.
> > > 
> > > And to test just how verbose "normal" is:
> > > 
> > > > mkdir Tst
> > > > cd Tst
> > > > dotnet new console
> > > > dotnet build --verbosity normal
> > 
> > I see now hmm I say we just leave it as normal and delete the log after the
> > build/before the build too (since its only needed for debugging a failed
> > build)
> 
> besides being more verbose is always better in my book, esepecially with
> such a massive source like this bundle

also the only part of this build that I cant get to fully work is the building of the source built externals as it would require a ton more of unessary patches so those build very minimally
Comment 38 Kyle Rabago 2023-10-05 17:39:59 UTC
(In reply to Kyle Rabago from comment #37)
> (In reply to Kyle Rabago from comment #36)
> > (In reply to Kyle Rabago from comment #35)
> > > (In reply to Maciej Barć from comment #30)
> > > > I'm pretty sure "normal" verbosity is too verbose, that still shows all the
> > > > compiler switches and file access checks.
> > > > 
> > > > "CoreCompile:" is probably the "worst" offender. Not surprised you wnated to
> > > > delete log files then they would have been extremely big.
> > > > 
> > > > And to test just how verbose "normal" is:
> > > > 
> > > > > mkdir Tst
> > > > > cd Tst
> > > > > dotnet new console
> > > > > dotnet build --verbosity normal
> > > 
> > > I see now hmm I say we just leave it as normal and delete the log after the
> > > build/before the build too (since its only needed for debugging a failed
> > > build)
> > 
> > besides being more verbose is always better in my book, esepecially with
> > such a massive source like this bundle
> 
> also the only part of this build that I cant get to fully work is the
> building of the source built externals as it would require a ton more of
> unessary patches so those build very minimally

in terms of verbosity that is not in terms of the overall build
Comment 39 Kyle Rabago 2023-10-05 22:18:42 UTC
After testing, version 8 sucessfully built from start to finish and the log is about 180 mb so will need to definetly be removed par each build of the sdk (and its subprojects)
Comment 40 Kyle Rabago 2023-10-06 02:29:07 UTC
(In reply to Kyle Rabago from comment #39)
> After testing, version 8 sucessfully built from start to finish and the log
> is about 180 mb so will need to definetly be removed par each build of the
> sdk (and its subprojects)

I plan on working on the patch script tomorrow (around 12 pm utc). Just to sorta restate my entire goal with this is to make debugging of this build alot easier as there are alot of moving parts in this build!

Also in terms of having too much verbosity, I dont know if I would say that necessarily is a bad thing if it helps with fixing builds and finding new bugs,etc. Still even if this isnt necessarily implemented, I still thing giving the build the option (ie use/use_expand flag) could be beneficial. Also In order to make sure we dont make a possibly 200 mb log file each time, I propose removing the log file if the build/pkg installs successfully, and also making sure we remove it before starting a new build. Overall I think this is a worth while fix to make Maciej and Dotnet team's build even better. 

(Also btw I will make sure to look into minimal verbosity tomorrow as well but as it stands I really like normal due to its shear amount of info given to possible bug hunters/users/etc but this is definitely something that could be changed)

(And while I wish I could just change one file for this, the Dir.Build.props file/s sometimes doesnt even have any args in terms of verbosity and instead use another file which can cause syntax conflicts (see v:n / -v n) so therefore its better to let the build.sh script to auto set and make sure the correct syntax is passed)
Comment 41 Kyle Rabago 2023-10-06 17:45:55 UTC
I have the patch script working, need to add places for the dir of the patches/sdk in terms of portage and it should work for v8
Comment 42 Kyle Rabago 2023-10-06 17:47:15 UTC
Created attachment 872241 [details]
Script to apply patches (absolute paths as of now, change where needed to make it work with portage)

In order for this to work you will need to pretty much change the locations of the patches/sdk as it hasent been modified to work with portage yet
Comment 43 Kyle Rabago 2023-10-06 17:50:26 UTC
(In reply to Kyle Rabago from comment #42)
> Created attachment 872241 [details]
> Script to apply patches (absolute paths as of now, change where needed to
> make it work with portage)
> 
> In order for this to work you will need to pretty much change the locations
> of the patches/sdk as it hasent been modified to work with portage yet

FOR VERSION 8 as of now havent looked into v7 (is next)
Comment 44 Kyle Rabago 2023-10-07 14:53:58 UTC
Today I will work on getting this script implemented into the ebuild to get it fully working at least for version 8, will upload it when done!
Comment 45 Kyle Rabago 2023-10-20 14:09:07 UTC
If needed you can just edit the dir props target file/s to remove the redirct log or something or just auto tail the log or something but as of now I dont really have an opinion on what could be done to improve it anymore without drastically changing the ebuild