Consistent import
- DGDanforth
- Posts: 1061
- Joined: Tue Sep 17, 2013 1:16 am
- Location: Palo Alto, California, USA
- Contact:
Consistent import
Folks,
When compiling an old module I got the error message
" MyVectors.Vector is not consistently imported
"
but that does not tell me which modules are inconsistent.
It would be very nice if a list (or tree?) were presented showing
the inconsistent modules.
Doug
When compiling an old module I got the error message
" MyVectors.Vector is not consistently imported
"
but that does not tell me which modules are inconsistent.
It would be very nice if a list (or tree?) were presented showing
the inconsistent modules.
Doug
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: Consistent import
If the imports are processed in textual order, I assume so but I have not checked it, then move the import that produces the inconsistency to the start of the import list. Then compile again and see which module produces the message now. That is the module you are looking for.
- Josef
- Josef
- DGDanforth
- Posts: 1061
- Joined: Tue Sep 17, 2013 1:16 am
- Location: Palo Alto, California, USA
- Contact:
Re: Consistent import
"move the import that produces the inconsistency"Josef Templ wrote:If the imports are processed in textual order, I assume so but I have not checked it, then move the import that produces the inconsistency to the start of the import list. Then compile again and see which module produces the message now. That is the module you are looking for.
- Josef
But I don't know which import produces the inconsistency!
When I compile module A which has an import list L the compiler
just says module X is inconsistently imported.
Do you mean to move module X to the head of the import list?
Well, in my case X does not occur within L. It is imported
by some subset of the modules in L.
Doug
-
- Posts: 204
- Joined: Wed Sep 18, 2013 10:06 pm
- Contact:
Re: Consistent import
You can use Info > Dependency to draw a dependency graph and Info > Create Tool to generate a set of commands to recompile everything in the correct order.
However, as far as I can see, these commands require object files . As your top-level module fails to compile you might need to create a tool for each item in your import list and run each of those tools to perform recompiles of the lower level modules first.
However, as far as I can see, these commands require object files . As your top-level module fails to compile you might need to create a tool for each item in your import list and run each of those tools to perform recompiles of the lower level modules first.
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: Consistent import
I see, the error position is not very specific.
This is because for some reason the compiler checks for inconsistencies not
during the import but only later on before creating an object file.
But there is another approach that really works.
Comment out all the code of your module except for the import statement.
Recompile. Should not produce any error message now.
Then, try to load this module by executing some dummy procedure (that does not exist).
The loading will fail with an inconsistency message that reads like this:
command error: object A.R inconsistently imported from B
Then you know that you have to recompile B.
Hope this helps.
- Josef
This is because for some reason the compiler checks for inconsistencies not
during the import but only later on before creating an object file.
But there is another approach that really works.
Comment out all the code of your module except for the import statement.
Recompile. Should not produce any error message now.
Then, try to load this module by executing some dummy procedure (that does not exist).
The loading will fail with an inconsistency message that reads like this:
command error: object A.R inconsistently imported from B
Then you know that you have to recompile B.
Hope this helps.
- Josef
- DGDanforth
- Posts: 1061
- Joined: Tue Sep 17, 2013 1:16 am
- Location: Palo Alto, California, USA
- Contact:
Re: Consistent import
Unfortunately that is not what I see. Here is a screen dump of what theJosef Templ wrote:I see, the error position is not very specific.
This is because for some reason the compiler checks for inconsistencies not
during the import but only later on before creating an object file.
But there is another approach that really works.
Comment out all the code of your module except for the import statement.
Recompile. Should not produce any error message now.
Then, try to load this module by executing some dummy procedure (that does not exist).
The loading will fail with an inconsistency message that reads like this:
command error: object A.R inconsistently imported from B
Then you know that you have to recompile B.
Hope this helps.
- Josef
compiler produces after the body text has been folded out
- Attachments
-
- ScreenSave.jpg (38.44 KiB) Viewed 21437 times
Re: Consistent import
There is a module, on CPC, called WandsTracer, that can analyze import lists, and generate compile lists.
A full recursive report of all imports, including the Oms modules, can be very large! However if you just ask for the compile list excluding Oms modules the report is quite reasonable. I show below the import dependancies for WandsTracer itself.
A full recursive report of all imports, including the Oms modules, can be very large! However if you just ask for the compile list excluding Oms modules the report is quite reasonable. I show below the import dependancies for WandsTracer itself.
- Attachments
-
- WandsTracer.pdf
- Compile list report
- (28.03 KiB) Downloaded 741 times
- DGDanforth
- Posts: 1061
- Joined: Tue Sep 17, 2013 1:16 am
- Location: Palo Alto, California, USA
- Contact:
Re: Consistent import
Thank you Robert. I'll look at it.Robert wrote:There is a module, on CPC, called WandsTracer, that can analyze import lists, and generate compile lists.
A full recursive report of all imports, including the Oms modules, can be very large! However if you just ask for the compile list excluding Oms modules the report is quite reasonable. I show below the import dependancuies for WandsTracer itself.
Doug
- Josef Templ
- Posts: 2047
- Joined: Tue Sep 17, 2013 6:50 am
Re: Consistent import
In some situations (public fingerprint changed) the compiler emits the error message right at the module import.
In other situations (only the private fingerprint changed, e.g. by adding or removing a non-exported field from
an exported type) the error message is delayed until that object (typically a type) is really used and there is no meaningful position.
In any case there is also some info displayed in the LOG window.
This should give you an idea where the inconsistency comes from. What is written to the log?.
In your case the module that causes the inconsistency is MyViews. Some type may have been changed and
that type should be listed in the log.
It may be enough to recompile MyViews.
- Josef
In other situations (only the private fingerprint changed, e.g. by adding or removing a non-exported field from
an exported type) the error message is delayed until that object (typically a type) is really used and there is no meaningful position.
In any case there is also some info displayed in the LOG window.
This should give you an idea where the inconsistency comes from. What is written to the log?.
In your case the module that causes the inconsistency is MyViews. Some type may have been changed and
that type should be listed in the log.
It may be enough to recompile MyViews.
- Josef
Re: Consistent import
This listing was generated by setting up the control Form as shown below. (Other sets of control options can produce very long lists!)Robert wrote:I show below the import dependancies for WandsTracer itself.