Valdiralita
Valdiralita
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
that only happens in docker and not on windows, i guess on windows the file is locked or something, but i would expect the file writes to be finished when WaitForExit returns
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
after inspecting the generated files it was clear that my msbuild task sometimes produced wrong output. the task calls another binary that creates the file and waits for its exit. then it opens the file and reads the content. sometimes the file seems to be empty. placing a sleep(5000) after process.WaitForExit() seems to make it work ...
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
csc invokes the source generator, doesnt it?
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
its all one csc call, i cant look what csc is doing in the binlog, can i?
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
the warnings are emitted by the source generator
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
so my log output looks like this: CSC : warning SG0001: processed: A [/..../...csproj] CSC : warning SG0001: processed: B [/..../...csproj] CSC : warning SG0001: processed: C [/..../...csproj] CSC : warning SG0001: processed: D [/..../...csproj] /..../....cs(116,75): error CS0117: 'E_Generated' does not contain a definition for 'mystruct' [/..../....csproj] /..../....cs(116,111): error CS0117: 'F_Generated' does not contain a definition for 'mystruct' [/..../....csproj] Build FAILED. CSC : warning SG0001: processed: E [/..../....csproj] CSC : warning SG0001: processed: F [/..../....csproj]
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
thats what i meant
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
right, the source generator calls context.AddSource()
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
and i can see that half of the files is processed and then i get a compilation error complaining about types not being found that are generated later in the log o.O
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
ive added a warning for each file that is processed with context.ReportDiagnostic()
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
or rather, compilation fails before the source generator emits the files
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
ok now that the msbuild task works, my source generator for consuming the produces files fails...
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
whats a regular compilation task?
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
yeah so it seems that BeforeTargets="PrepareForBuild" is too early and happens before the msbuild task nuget is restored
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
ill try to create the binlog in the docker container
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
i have only created the binlog on my local machine where it always succeedes
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
yeah, i didnt find anything suspicious. the msbuild task produces files and the source generator consumes these files. my problem is that: sometimes on a build files are missing for the source generator and not everything is created, sometimes all files are missing, sometimes none and sometimes just a few
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
yes, what would be the correct BeforeTargets for a job that should run after restore but before sourcegenerators run?
37 replies
CC#
Created by Valdiralita on 10/22/2024 in #help
Custom msbuild task
the task that uses the msbuild task runs BeforeTargets="PrepareForBuild;BeforeBuild" and im suspecting that the nuget wasnt restored yet
37 replies
CC#
Created by Valdiralita on 10/2/2024 in #help
creating a nuget for a custom msbuild task
just a .props file in a parent directory specified net8
13 replies