theseion / Fuel

Fuel, the Smalltalk object serializer
https://theseion.github.io/Fuel
MIT License
26 stars 12 forks source link

FLDelayedSerializationMock DNU when Serializing #257

Closed seandenigris closed 2 years ago

seandenigris commented 2 years ago

The following script:

FLSerializer new
        object: 1;
        fileName: (FileLocator home / '1.fuel') fullName;
        serialize.

led to this error:

Screen Shot 2021-11-14 at 1 56 18 PM

Implementing this on FLDelayedSerializationMock avoided the error, but not sure of other implications:

isResponsible
    ^ false

Fuel 4.0.0 on P9 (GT actually)

theseion commented 2 years ago

How did you load the project? That method is simply a method on FLDelayedSerializationModk, which is in Fuel-Test-Core. Your example works for me.

seandenigris commented 2 years ago

I loaded it in an image where 3.0.3 was already loaded. Could that be a factor? I’ll try a fresh image

theseion commented 2 years ago

The baseline includes a hack that first unloads a loaded Fuel. I know that works because we run all our tests in Pharo by simply loading the baseline. The only difference I can see so far is GT.

seandenigris commented 2 years ago

Yes, I confirm. I get the error in GT, but not P9. Not sure what the difference is. Checking the references of BaselineOfFuel in GT, there is:

"BaselineOfIDE"
        spec baseline: 'Fuel' with: [ 
            spec
                repository: repository;
                loads: #( 'Tests' ) ].

and

"BaselineOfMorphic"
        spec baseline: 'Fuel' with: [ 
            spec repository: repository; loads: #('Core') ].

which are the same in Pharo 9. Although, maybe the value of repository is different? Perhaps @girba could shed some light...

theseion commented 2 years ago

Do you load GT into the image manually or do you use a prepared image? Can you post the instructions for either so I can try to reproduce?

seandenigris commented 2 years ago
Metacello new
    repository: 'github://theseion/Fuel:4.0.0';
    baseline: 'Fuel';
    load.
theseion commented 2 years ago

The reason this loads differently in GT is that GT explicitly loads #Tests. Metacello will detect a load conflict and will not load the new version. In Pharo that package is probably not registered (my guess is that the release process cleans out the Metacello registry), so it looks like #Tests is something new to load.

In any case, here's the invocation to make it work in GT:

Metacello new
    repository: 'github://theseion/Fuel:4.0.0';
    baseline: 'Fuel';
    onWarning: [ :ex |
        ex class == MCMergeOrLoadWarning
            ifTrue: [ ex load ]
            ifFalse: [ ex resume ] ];
    load: #Tests
seandenigris commented 2 years ago

Thanks. I requested on discord for GT to upgrade to 4.0.0 which seems to be the simplest fix