Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

During GsFileIn using currentPackage/currentProject, error message is (confusingly) wrong when the inDictionary field of the topaz class definition does not match the symbol dictionary declared in the load spec #956

Open
dalehenrich opened this issue Mar 5, 2025 · 0 comments

Comments

@dalehenrich
Copy link
Member

In this case (see GemTalk/JadeiteForPharo#248) the project was created in JfP using the New... menu item, which creates a project using default parameters.

The load spec created looks like the following:

RwLoadSpecificationV2 {
	#projectName : 'lisa',
	#projectSpecFile : 'rowan/project.ston',
	#componentNames : [
		'Core'
	],
	#platformProperties : {
		'gemstone' : {
			'allusers' : {
				#defaultSymbolDictName : 'UserGlobals'
			}
		}
	},
	#comment : ''
}

and notice that the default symbol dictionary name is UserGlobals.

The following script is used to attempt to load and package a .gs file (UseSpec.gs):

| classesToBeInitialized |
classesToBeInitialized := Array new.
Rowan gemstoneTools topaz currentTopazProjectName: 'lisa'.
Rowan gemstoneTools topaz currentTopazPackageName: 'UseSpace'.

[
	[
		GsFileIn fromServerPath: 'UseSpace.gs'.
	] on: Warning do: [ :ex | ex resume ].
]  on: RwExecuteClassInitializeMethodsAfterLoadNotification
    do: [:ex |  
	classesToBeInitialized add: ex candidateClass.
	ex resume: false ].

classesToBeInitialized do: [:class | class initialize ].

Rowan gemstoneTools topaz currentTopazProjectName: nil.
Rowan gemstoneTools topaz currentTopazPackageName: nil.

The .gs file UseSpec.gs contains class definitions that look like the following:

expectvalue /Class
doit
Object subclass: 'IPCustomerCollection'
  instVarNames: #( theCustomers intendedSize counter)
  classVars: #()
  classInstVars: #()
  poolDictionaries: #()
  inDictionary: Globals 
  options: #()
%

Note that the inDictionary: Globals field in the class definition does not match the default symbol dictionary declared in the load spec UserGlobals.

When the script is run a Attempt to move a packaged class 'IPCustomerCollection' from the symbol dictionary 'UserGlobals' to the symbol dictionary 'Globals'. Please use the Rowan api to achieve the move, at line 16 file /bosch1/users/dhenrich/_stones/37x/g_37x_externals_st/lisa/gs/UseSpace.gs error is thrown.

An error is expected at this time, because we are expecting to create loaded packages that will duplicate the results of loading the .gs, so an error is expected.

However, the error message is incorrect. The class is actually not being moved from 'UserGlobals' into 'Globals', the class has been created in 'Globals' following the topaz class definition and the error should complain that it will not move the class from 'Globals' into 'UserGlobals'.

So... the error message needs to be fixed to avoid confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant