[D4] Small problem with package dependencies

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[D4] Small problem with package dependencies

Chris Uppal-2
A bit of background: I've just started using Win2K, and am being bugged by
the way it resets the font to TimesRoman at the drop of a hat.  Therefore
I'm using a small patch suggested by Ian B:

=======
RichTextEdit>>onViewOpened
     super onViewOpened.
     self font isNil
        ifTrue: [self setFont: SmalltalkSystemShell defaultFont].
=======

Also, I've recently started keeping patches like this is separate .ST files,
so I can file them in individually, rather than all in one big (well, not
very big) package.

That caused me some problems.  I couldn't save any packages!

The reason is that filing in a .ST file with the above code adds the new
method to the Dolphin package (where RichTextEdit lives), but it includes a
reference to SmalltalkSystemShell (which lives in the Development package),
and so causes a circular dependency between Dolphin and Development.  That
means that packages which depend on Dolphin (which is most of 'em!) won't
save.

Now, that's not a bug in Dolphin, and the above paragraph is intended just
as a heads-up to anyone else who is keeping patches in .ST files.  The easy
solution is just to move the patch into a small package of its own.

However, when I moved the method into Development, the circular dependency
doesn't go away, and using the prerequisites browser to see why Dolphin
still thinks it depends on Development causes a walkback.  As far as I can
see the problem is caused by some inconsistency in the way that Packages
which are #isSystemPackage, will short-circuit the computation of their
dependencies.

It's easy to get rid of the ghost dependency by evaluating:
    PackageManager current resetPrerequisites.

(BTW, the above mantra is also needed if you save a package under a
different name.  Otherwise packages which depend on it still think they are
depending on the old name.)

    -- chris


Reply | Threaded
Open this post in threaded view
|

Re: [D4] Small problem with package dependencies

Blair McGlashan
Chris

You wrote in message
news:[hidden email]...

[Re: Circular dependency bug]
>..., when I moved the method into Development, the circular dependency
> doesn't go away, and using the prerequisites browser to see why Dolphin
> still thinks it depends on Development causes a walkback.  As far as I can
> see the problem is caused by some inconsistency in the way that Packages
> which are #isSystemPackage, will short-circuit the computation of their
> dependencies.

Thanks, we'll investigate.

>
> It's easy to get rid of the ghost dependency by evaluating:
>     PackageManager current resetPrerequisites.
>
> (BTW, the above mantra is also needed if you save a package under a
> different name.  Otherwise packages which depend on it still think they
are
> depending on the old name.)

Thanks for that too. That problem seems to exists in 3.x too, but is less
likely to show up because 4.0 doesn't reset prerequisites quite so freely.
I've attached a patch for 4.x.

Regards

Blair



























begin 666 PackageManager_renamePackageTo.st
M(5!A8VMA9V5-86YA9V5R(&UE=&AO9'-&;W(A#0H-"G)E;F%M95!A8VMA9V4Z
M(&%086-K86=E('1O.B!A4W1R:6YG4&%T:&YA;64-"@DB071T96UP=',@=&\@
M<F5N86UE(&%086-K86=E(&AE;&0@8GD@=&AE(')E8V5I=F5R('1O(&%3=')I
M;F=.86UE+B(-"@D-"@E\(&5X:7-T:6YG(&YE=TYA;64@? T*"6YE=TYA;64@
M.CT@1FEL92!S<&QI=%-T96U&<F]M.B!A4W1R:6YG4&%T:&YA;64N#0H)97AI
M<W1I;F<@.CT@<V5L9B!P86-K86=E3F%M960Z(&YE=TYA;64@:69.;VYE.B!;
M72X-"@DH97AI<W1I;F<@:7-.:6P@;W(Z(%ME>&ES=&EN9R ]/2!A4&%C:V%G
M95TI(&EF1F%L<V4Z(%L-"@D)7G-E;&8@97)R;W(Z("=086-K86=E(&%L<F5A
M9'D@97AI<W1S)UTN#0H)<V5L9B!P86-K86=E<R -"@D)<F5M;W9E2V5Y.B!A
M4&%C:V%G92!N86UE(&EF06)S96YT.B!;73L-"@D)870Z(&YE=TYA;64@<'5T
M.B!A4&%C:V%G92X-"@EA4&%C:V%G92!P86-K86=E1FEL94YA;64Z(&%3=')I
M;F=0871H;F%M92X-"@E><V5L9B!R97-E=%!R97)E<75I<VET97,[(&QO861E
M9$-H86YG960-"@D-"B$@(0T*(5!A8VMA9V5-86YA9V5R(&-A=&5G;W)I97-&
M;W(Z("-R96YA;65086-K86=E.G1O.B%P=6)L:6,A<F5M;W9I;F<A("$-"@T*
`
end