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

Revert integration of T4 code generation into project file #940

Merged
merged 2 commits into from
Jan 21, 2023

Conversation

atifaziz
Copy link
Member

@atifaziz atifaziz commented Jan 21, 2023

This reverts commit f669558 from merge of PR #776.

The integration required parallel builds to be turned off for MoreLinq. Since PR #776, more frameworks are being targeted and this slows the build down considerably, taking per target 5 seconds (on my machine) and a total time of approximately 44 seconds:

13:15:15:755	Rebuild started...
13:15:16:123	Restored A:\MoreLINQ\main\bld\ExtensionsGenerator\MoreLinq.ExtensionsGenerator.csproj (in 38 ms).
13:15:16:123	Restored A:\MoreLINQ\main\MoreLinq\MoreLinq.csproj (in 127 ms).
13:15:16:372	1>------ Rebuild All started: Project: MoreLinq.ExtensionsGenerator, Configuration: Debug Any CPU ------
13:15:16:374	2>------ Rebuild All started: Project: MoreLinq, Configuration: Debug Any CPU ------
13:15:16:383	Restored A:\MoreLINQ\main\MoreLinq.Test\MoreLinq.Test.csproj (in 381 ms).
13:15:17:577	1>MoreLinq.ExtensionsGenerator -> A:\MoreLINQ\main\bld\ExtensionsGenerator\bin\Debug\net7.0\MoreLinq.ExtensionsGenerator.dll
13:15:24:161	2>MoreLinq -> A:\MoreLINQ\main\MoreLinq\bin\Debug\net462\MoreLinq.dll
13:15:29:861	2>MoreLinq -> A:\MoreLINQ\main\MoreLinq\bin\Debug\netstandard1.0\MoreLinq.dll
13:15:36:302	2>MoreLinq -> A:\MoreLINQ\main\MoreLinq\bin\Debug\netstandard2.0\MoreLinq.dll
13:15:43:464	2>MoreLinq -> A:\MoreLINQ\main\MoreLinq\bin\Debug\netstandard2.1\MoreLinq.dll
13:15:50:057	2>MoreLinq -> A:\MoreLINQ\main\MoreLinq\bin\Debug\net6.0\MoreLinq.dll
13:15:50:388	3>------ Rebuild All started: Project: MoreLinq.Test, Configuration: Debug Any CPU ------
13:15:53:399	3>MoreLinq.Test -> A:\MoreLINQ\main\MoreLinq.Test\bin\Debug\net6.0\MoreLinq.Test.dll
13:15:57:360	3>MoreLinq.Test -> A:\MoreLINQ\main\MoreLinq.Test\bin\Debug\netcoreapp3.1\MoreLinq.Test.dll
13:15:58:028	3>MoreLinq.Test -> A:\MoreLINQ\main\MoreLinq.Test\bin\Debug\net462\MoreLinq.Test.exe
13:15:59:206	3>MoreLinq.Test -> A:\MoreLINQ\main\MoreLinq.Test\bin\Debug\net7.0\MoreLinq.Test.dll
13:15:59:255	========== Rebuild All: 3 succeeded, 0 failed, 0 skipped ==========
13:15:59:255	========== Elapsed 00:43.519 ==========

Reverting means that parallel builds can be enabled again and as a result, the total build time drop to approximately half:

13:16:23:133	Rebuild started...
13:16:23:338	Restored A:\MoreLINQ\main\bld\ExtensionsGenerator\MoreLinq.ExtensionsGenerator.csproj (in 24 ms).
13:16:23:395	Restored A:\MoreLINQ\main\MoreLinq\MoreLinq.csproj (in 86 ms).
13:16:23:508	Restored A:\MoreLINQ\main\MoreLinq.Test\MoreLinq.Test.csproj (in 260 ms).
13:16:23:513	1>------ Rebuild All started: Project: MoreLinq.ExtensionsGenerator, Configuration: Debug Any CPU ------
13:16:23:516	2>------ Rebuild All started: Project: MoreLinq, Configuration: Debug Any CPU ------
13:16:25:174	1>MoreLinq.ExtensionsGenerator -> A:\MoreLINQ\main\bld\ExtensionsGenerator\bin\Debug\net7.0\MoreLinq.ExtensionsGenerator.dll
13:16:25:641	2>MoreLinq -> A:\MoreLINQ\main\MoreLinq\bin\Debug\net462\MoreLinq.dll
13:16:27:179	2>MoreLinq -> A:\MoreLINQ\main\MoreLinq\bin\Debug\netstandard1.0\MoreLinq.dll
13:16:28:777	2>MoreLinq -> A:\MoreLINQ\main\MoreLinq\bin\Debug\netstandard2.0\MoreLinq.dll
13:16:30:275	2>MoreLinq -> A:\MoreLINQ\main\MoreLinq\bin\Debug\netstandard2.1\MoreLinq.dll
13:16:32:248	2>MoreLinq -> A:\MoreLINQ\main\MoreLinq\bin\Debug\net6.0\MoreLinq.dll
13:16:32:387	3>------ Rebuild All started: Project: MoreLinq.Test, Configuration: Debug Any CPU ------
13:16:35:260	3>MoreLinq.Test -> A:\MoreLINQ\main\MoreLinq.Test\bin\Debug\net6.0\MoreLinq.Test.dll
13:16:40:810	3>MoreLinq.Test -> A:\MoreLINQ\main\MoreLinq.Test\bin\Debug\net462\MoreLinq.Test.exe
13:16:41:595	3>MoreLinq.Test -> A:\MoreLINQ\main\MoreLinq.Test\bin\Debug\netcoreapp3.1\MoreLinq.Test.dll
13:16:42:223	3>MoreLinq.Test -> A:\MoreLINQ\main\MoreLinq.Test\bin\Debug\net7.0\MoreLinq.Test.dll
13:16:42:289	========== Rebuild All: 3 succeeded, 0 failed, 0 skipped ==========
13:16:42:289	========== Elapsed 00:19.232 ==========

The cost of integrating T4 (which is rarely invoked) does not seem to justify the cost of doubling the build times. There's a small inconvenience to having to remember keeping the generated code fresh if the template is change by invoking the help shell scripts if you're not using Visual Studio, where it happens the moment the template is saved. The freshness of the generated code is asserting during CI build

MoreLINQ/appveyor.yml

Lines 79 to 83 in 62914fb

$diff = git diff --ignore-all-space --exit-code 2>&1
$diff | % { if ($_ -is [string]) { $_ } else { [string]$_ } } | echo
if ($LASTEXITCODE -ne 0) {
throw "New code was generated during build that's not been committed."
}

@atifaziz atifaziz changed the title Revert “Integrate templated code generation into project file (#776)” Revert integration T4 code generation into project file Jan 21, 2023
@atifaziz atifaziz changed the title Revert integration T4 code generation into project file Revert integration of T4 code generation into project file Jan 21, 2023
@codecov
Copy link

codecov bot commented Jan 21, 2023

Codecov Report

Merging #940 (169395b) into master (c76db18) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #940   +/-   ##
=======================================
  Coverage   92.42%   92.42%           
=======================================
  Files         112      112           
  Lines        3446     3446           
  Branches     1023     1023           
=======================================
  Hits         3185     3185           
  Misses        199      199           
  Partials       62       62           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@atifaziz atifaziz merged commit 0be76fd into morelinq:master Jan 21, 2023
@atifaziz atifaziz deleted the revert-f669558 branch January 21, 2023 21:05
atifaziz added a commit that referenced this pull request Jan 29, 2023
This adds to commit "Revert "Integrate templated code generation into
project file (#776)"" (0be76fd) that
was merge of PR #940.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants