[squeak-dev] #recompile:from: does not apply syntax error fixes

Levente Uzonyi leves at caesar.elte.hu
Mon Mar 16 22:06:45 UTC 2020

Hi Christoph,

The trailer can hold many different things, but it's main goal is to 
make it possible to recreate the source code of a method. Normally (in 
case of a regular method with sources and changes files available) it 
holds an offset to the sources or changes file. At that offset starts the 
source chunk of the method.
So, changing the trailer only makes sense when the source code changes, 
and new code is written to the changes file.

#recompile:from: assumes that the source code has not been changed, so 
leaving the trailer intact seems reasonable to me.

Should there be an error with the source code during #recompile:from:, 
you've got no way to fix it because of the above. The error must be 
detected beforehand, and the method must not be recompiled but compiled.


On Mon, 16 Mar 2020, Thiede, Christoph wrote:

> Hi all,
> you remember Compiler-ct.417? I have been carrying this change around with my image for a few months, and when the migration to Sista was published recently, I got a number of SyntaxErrors from Trunk methods that do not follow the vertical bar rule we agreed on. I'll fix these errors, depending on
> Compiler-ct.417, soon - however, I think there could be a problem with the current #recompile:from: logic. After fixing the Syntax errors while all selectors were being recompiled, the new source code had not been applied to the methods. I think the reason could be that we reuse the old method trailer instead of
> simply starting with a fresh one.
> But I don't know many details about CompiledMethodTrailers. Would it be a good idea to discard the old trailer when recompiling any method? Concretely, we could send #generate to methodNode rather than #generate:.
> Best,
> Christoph

More information about the Squeak-dev mailing list