Closed klauer closed 4 years ago
Pinging this issue to see if it's still a problem. I'll close this tomorrow if I don't get a response.
I believe it is just being ignored, unless you provided a fix directly to @ghalym.
I haven't encountered this issue again, even when not using the --allow-errors.
Any idea what was the resolution? Cleaning/rebuilding .tmc files?
Not sure, I actually thought that was resolved in either a new pmps or general lib release.
@slacAWallace reports resolving this in https://github.com/pcdshub/lcls-twincat-pmps/pull/45 . Can you include details here @slacAWallace?
Credit where it's due, @ZLLentz realized the answer first.
Turns out pinning references in libraries referenced by a project will cause TC to build the tmc including resolutions for each referenced version of a type.
Ie. PMPS 0.7.0 built with a fixed reference to general 2.3.4, @ghalym builds the GATT with PMPS 0.7.0 and general set to 0.0.0, and gets duplicate tmc entries.
A potential fix might be to use the namespace tag included with these symbols to resolve the one pytmc should build a PV for. It is a workaround because TC gives no indication which symbol you're actually addressing by name with ADS. So at some point TC is making a decision to ignore one of those symbols...
I think this also explains another weird TC issue we run into sometimes where it will claim a type is not equal to itself during a build. It's a super weird thing to see because it looks like, 'STRUCT_A Is not Equal to type STRUCT_A' and you're left wondering about the nature of this universe. It does start to make sense though when different libraries are attempting to use the same type (by name), with actual differences between the types across the different referenced versions. A more direct error message about a resolution conflict would make TC better.
As an example:
Severity Code Description Project File Line Suppression State Error Type 'FB_LREALFromEPICS' is not equal to type 'FB_LREALFromEPICS' of VAR_IN_OUT 'fbBYKIK_Rate' KFEArbiter C:\Users\awallace\Documents\Source\lcls-plc-kfe-arbiter\Arbiter\KFEArbiter\POUs\CurrentBPUpdate.TcPOU 3
(Great work, @ZLLentz 👍 )
I see - that makes sense.
If we can find a programmatic way to check for this, I'd be happy to include it in pytmc. Perhaps we could at least just include the list of library references in the summary webpage to aid in debugging 🤷♂️
Does this also imply that if you load two versions of a library, you will have two instances of their library globals that don't talk to each other? This seems like a situation ripe for confusing bugs in PLC land too.
RE: finding it in pytmc, it should be theoretically possible since pytmc already notices that there are duplicate entries. When one of the failures occurs, one of the entries will have a additional namespace section in the tmc file that has a screwy-looking path on it with at least one library name.
Does this also imply that if you load two versions of a library, you will have two instances of their library globals that don't talk to each other? This seems like a situation ripe for confusing bugs in PLC land too.
This is exactly what I mean by at some point TC decides which one to use and doesn't tell us. Big ol' shrug here.
OK, I'll make a preliminary issue referencing this one in pytmc.
Downstream libraries which include both
lcls-twincat-general
andlcls-twincat-pmps
result in duplicate symbols forGVL_Logger
which breaks IOC generation.Unclear as to the exact fix; this needs some research.
Duplicate symbols:
Note that the above symbols are allocated twice on the PLC at different locations.
Short-term hack to allow this bad behavior in pytmc:
pytmc db --allow-errors ...