pct
pct copied to clipboard
Class Compile Hierarchy - Doesn't account for parent class include file changes
Describe the bug
When we modify an include file containing a temp-table, and then do an incremental compile, some classes that need to be recompiled are not. When we then run our r-code we see the following types of errors:
[PCTRun] TEMP-TABLE 'ttTable' of class 'someChildClass' no longer matches the definition in base class 'someClass'. (13203)
[PCTRun] Could not access element 'ttTable' of class 'someClass' using object of type 'someChildClass' - caller compilation is out of sync with class compilation. (12882)
To Reproduce
See this repo: https://github.com/kenherring/PCTBug
After cloning, run the following steps and you'll receive the error listed above
ant compile
cp ttTable-new.i ttTable.i
ant compile
ant run
When we do the second ant compile
we see that someClass.cls
is compiled, but the child is not. Then when we execute the compiled code using ant run
we see we get a mismatch on the temp-table definition in the child class.
Expected behavior
In this situation I'd expect that since the class someChildClass.cls
inherits someClass.cls
that it would be compiled. We can see the someChildClass.cls.hierarchy
file knows of the relationship:
"someClass" ".\someClass.cls"
Environment
- Operating system and version - windows 10/centos
- OpenEdge version: 12.2
- Ant version: 1.10.6
- PCT version: 218 & 221, probably others as well.
Additional context
Sample Log:
$ ant compile
Buildfile: C:\git\PCTBug\build.xml
compile:
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] runme.p [No r-code]
[PCTCompile] someChildClass.cls [No r-code]
[PCTCompile] someClass.cls [Table CRC]
[PCTCompile] 3 file(s) compiled
BUILD SUCCESSFUL
Total time: 0 seconds
$ cp ttTable-new.i ttTable.i
$ ant compile
Buildfile: C:\git\PCTBug\build.xml
compile:
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] someClass.cls [R-code older than include file: ttTable.i]
[PCTCompile] 1 file(s) compiled
BUILD SUCCESSFUL
Total time: 0 seconds
$ ant run
Buildfile: C:\git\PCTBug\build.xml
run:
[PCTRun] TEMP-TABLE 'ttTable' of class 'someChildClass' no longer matches the definition in base class 'someClass'. (13203)
[PCTRun] Could not access element 'ttTable' of class 'someClass' using object of type 'someChildClass' - caller compilation is out of sync with class compilation. (12882)
BUILD FAILED
C:\git\PCTBug\build.xml:17: PCTRun returned: 1
Total time: 0 seconds
I didn't forget you, I'll have a look at this issue at the beginning of next week!
Just did a quick test on Linux, but couldn't reproduce. Does the OS have any impact on the bug ?
gquerret@jenkins ~/dev/PCTBug main ± ant compile
Buildfile: /home/gquerret/dev/PCTBug/build.xml
compile:
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] runme.p [No r-code]
[PCTCompile] someChildClass.cls [No r-code]
[PCTCompile] someClass.cls [Table CRC]
[PCTCompile] 3 file(s) compiled
BUILD SUCCESSFUL
Total time: 0 seconds
gquerret@jenkins ~/dev/PCTBug main ± cp ttTable-new.i ttTable.i
gquerret@jenkins ~/dev/PCTBug main ± ant compile
Buildfile: /home/gquerret/dev/PCTBug/build.xml
compile:
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] someClass.cls [R-code older than include file: ttTable.i]
[PCTCompile] 1 file(s) compiled
BUILD SUCCESSFUL
Total time: 0 seconds
gquerret@jenkins ~/dev/PCTBug main ± ant run
Buildfile: /home/gquerret/dev/PCTBug/build.xml
run:
[PCTRun] 100
[PCTRun] 101 test
BUILD SUCCESSFUL
Total time: 0 seconds
gquerret@jenkins ~/dev/PCTBug main ±
Thanks for taking a look @gquerret! Looks like my repo wasn't quite perfect - I pushed some changes that should help. If you clone my repo and try again I think you'll get better results this time around. I was also able to test and recreate this on unix:
[root@437977374c96 PCTBug]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
Runtime log:
[root@437977374c96 PCTBug]# ant compile
Buildfile: /PCTBug/build.xml
compile:
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] runme.p [No r-code]
[PCTCompile] someChildClass.cls [No r-code]
[PCTCompile] someClass.cls [Table CRC]
[PCTCompile] 3 file(s) compiled
BUILD SUCCESSFUL
Total time: 0 seconds
[root@437977374c96 PCTBug]# cp ttTable-new.i ttTable.i
cp: overwrite ‘ttTable.i’? y
[root@437977374c96 PCTBug]# ant compile
Buildfile: /PCTBug/build.xml
compile:
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] someClass.cls [R-code older than include file: ttTable.i]
[PCTCompile] 1 file(s) compiled
BUILD SUCCESSFUL
Total time: 0 seconds
[root@437977374c96 PCTBug]# ant run
Buildfile: /PCTBug/build.xml
run:
[PCTRun] TEMP-TABLE 'ttTable' of class 'someChildClass' no longer matches the definition in base class 'someClass'. (13203)
[PCTRun] Could not access element 'ttTable' of class 'someClass' using object of type 'someChildClass' - caller compilation is out of sync with class compilation. (12882)
BUILD FAILED
/PCTBug/build.xml:22: PCTRun returned: 1
Total time: 0 seconds
Reproduced, thanks ! I'll have a look.
I'm also getting:
Could not access element 'method name
' for class 'class name
' using object of type 'class name
' - caller compilation is out of sync with class compilation. (12882)
When an include file is using a class and the class has changed. The .p
containing the include using the class is not automatically recompiled.
I had a look at the current implementation and found the problem. However, it's not a straightforward change and would require changes at how class dependencies are computed and stored (which I agree is not optimal). Focus is currently on the language server implementation (and the OE builder) for the VSCode plugin, so I won't be able to this implementation in a near future. I can help if you want to open a PR.
Hey Gilles - I'd likely need some guidance on where the change needs to be made in the code but I do believe I can find time to open a PR for this.
@kenherring Please have a look at the PCT dev environment, then we'll discuss details here