Repository navigation
Rebuild Views and kernel IDLs when their interface files change - #1266
Merged
Merged
Conversation
The build preprocesses Src/views/ViewsTlb.idl into Output/<Config>/Common/ViewsTlb.idl, inlining Views.idh, Render.idh and common.idh. nmake only compared it against the source .idl, so pulling an interface change to an .idh left the output stale. The generated Views.cs then lacked the new methods, and managed code that called them failed with CS1061 (seen with IVwEnv.OpenWrapGroup after LT-22634). List the three .idh files as dependencies so an edit to any of them regenerates the output IDL, the type library, and Views.cs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1266 +/- ##
=======================================
Coverage 40.92% 40.92%
=======================================
Files 1602 1602
Lines 360800 360800
Branches 42245 42245
=======================================
+ Hits 147648 147649 +1
Misses 183655 183655
+ Partials 29497 29496 -1 🚀 New features to boost your workflow:
|
ViewsPs.idl inlines the same .idh files as ViewsTlb.idl, so after an interface edit its preprocessed copy stayed stale too. dlldatax.c builds the proxy code generated from it into Views.dll, which then marshaled the old interface. Add it as a target of the same dependency line. Test-ViewsNativeArtifactsStale did not scan *.idh files, so a run of the TestViews native tests after an .idh-only edit could skip the native rebuild. Add *.idh to its source patterns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The restore copies common.idh and the other liblcm kernel interface files into Src/Kernel with the package's timestamps, which can predate the last build. Moving to a liblcm version that changes them then left the preprocessed FwKernel and Views IDLs stale, so listing common.idh as a dependency did not cover the case it was there for. The restore now writes LcmKernelFiles.stamp, holding a hash of each copied file, and rewrites it only when a hash changes. FwKernel.mak and Views.mak depend on the stamp instead of the copied files. Clean deletes it and git ignores it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The native build now regenerates the preprocessed
Output/<Config>/Common/ViewsTlb.idlandViewsPs.idlwhenViews.idhorRender.idhchanges, and regenerates those and the FwKernel IDLs when a liblcm update changes the kernel interface files. Until now, pulling a Views interface change into an already-built checkout left the managed build broken: after LT-22634 addedIVwEnv.OpenWrapGroup, a developer who pulled main got four CS1061 errors such as'IVwEnv' does not contain a definition for 'OpenWrapGroup'inXmlBrowseViewBaseVc.cs, because the generatedViews.csstill described the old interface. The proxy code built intoViews.dllwas stale in the same way. A clean build was never affected.Reviewer notes
Root cause.
Bld/_rule.makpreprocessesSrc/views/ViewsTlb.idlandSrc/views/ViewsPs.idlinto the output folder withcl /E, which inlines their#included.idhfiles. nmake's inference rule compares each output only with its source.idl, which almost never changes.ViewsInterfaces/BuildInclude.targetsdoes rerunidlimportwhenViews.idhis newer thanViews.cs, but it reads the stale preprocessed IDL, so the regeneratedViews.csis still missing the new methods. LT-22816 (#1168) added header tracking for C++ objects only; it does not cover IDL includes.Deliberate rules.
Src/views/Views.maklists dependencies only, with no commands, so nmake still uses the existing{src}.idl{out}.idlrule to build both files..idhedit now also rebuildsViewsTlb.tlb,ViewsTlb.h, theViewsPsproxy sources and every Views object, which already depend on those outputs.dlldatax.objpicks up the regeneratedViewsPs_p.cthrough the existing header-dependency tracking. That is the intended cost of an interface change.common.idhand the other liblcm kernel interface files are copied intoSrc/Kernelwith the package's timestamps, which can predate the last build, so the makefiles cannot depend on them directly.Build/PackageRestore.targetsnow writesSrc/Kernel/LcmKernelFiles.stampwith a hash of each copied file, usingWriteOnlyWhenDifferent, so its timestamp moves only when a file's content does.Views.makdepends on the stamp instead ofcommon.idh, andFwKernel.makmakesFwKernelTlb.idlandFwKernelPs.idldepend on it. A content hash rather than the package version also covers local liblcm builds. Clean deletes the stamp and git ignores it.CopiedFilesoutput also lists files it skipped, and a touched file no longer matches the package, so every build would recopy, touch and rebuild.Test-ViewsNativeArtifactsStale(Build/Agent/FwBuildHelpers.psm1) now scans*.idhfiles, so a TestViews run after an.idh-only edit rebuilds the native code first.Tests. No automated test covers makefile dependencies. With the first two commits, touching
Src/views/Views.idhand running.\build.ps1 -CommentHygiene -TokenHygieneregenerated the outputViewsTlb.idl,ViewsTlb.tlb,ViewsPs.idl,ViewsPs.h,ViewsPs_p.c,ViewsPs.dllandViews.cs, and rebuiltdlldatax.objandViews.dll; the build succeeded with 0 warnings and 0 errors. Without the fix, a build after a rebase that rewroteViews.idhleft both preprocessed IDLs unchanged..\test.ps1 -TestProject TestViews -SkipManagedrefreshed the native artifacts and passed 330 of 330; that run does not show*.idhdetection, because a missingviews.lib(see Out of scope) makes the helper report stale before it compares timestamps.The
*.idhpattern was checked separately against a throwaway folder holding every artifact the helper checks, so the timestamp comparison decides the result:mainSrc\views\Views.idhnewer than the artifactsThe stamp was checked with four
.\build.ps1 -CommentHygiene -TokenHygieneruns in a row, each with 0 warnings and 0 errors:Views.cscommon.idhchanged but its original timestamp keptManual tests. None beyond the build above; this changes no runtime behaviour. Release configuration was not built, but the rule uses the configuration-specific
$(COM_OUT_DIR).For developers already hit by this. Delete the stale files and rebuild:
Remove-Item Output\Debug\Common\ViewsTlb.*, Output\Debug\Common\ViewsPs.*, Src\Common\ViewsInterfaces\Views.cs.\build.ps1Out of scope.
Test-ViewsNativeArtifactsStalealso checksOutput\<Config>\views.lib, which the build no longer writes, so it reports stale on every run; fixing that changes when TestViews skips its rebuild and is a separate change. The kernel-fileCopykeepsSkipUnchangedFiles="true", which compares only size and timestamp, so a liblcm file whose content changed but whose size and timestamp match the existing copy would be skipped and the stamp would hash the old copy; the packages seen so far carry distinct timestamps for these files, and settingSkipUnchangedFiles="false"on that oneCopywould close the gap if it is ever hit. No Jira ticket: this is a developer-only build change that a tester cannot see.🤖 Generated with Claude Code
This change is