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

(V3) incorrect handling of duplicate methods in different packages of the same project #940

Open
dalehenrich opened this issue Nov 21, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@dalehenrich
Copy link
Member

As of RowanClientServices:cfe8285a6 and GemStone 3.7.2, there are duplicate methods in two packages Rowan-Services-Tests and Rowan-Services-TestsV2 ... These two packages can be loaded together and Rowan silently loads "both packages" even though only one of the methods wins ... fortunately an audit of RowanClientServices produces the following audit errors:

==============Auditing  project RowanClientServices
==============Auditing  package Rowan-Services-Tests
---------------RowanServicesTest>>Mismatched method category (expected: 'support' actual: #'*rowan-services-testsv2'): RowanServicesTest>>createServicesTestPackage
---------------RowanServicesTest>>Compiled method is not identical to loaded method: RowanServicesTest>>createServicesTestPackage
---------------RowanServicesTest>>Mismatched method category (expected: 'accessing' actual: #'*rowan-services-testsv2'): RowanServicesTest>>servicesTestComponentName
---------------RowanServicesTest>>Compiled method is not identical to loaded method: RowanServicesTest>>servicesTestComponentName
---------------RowanServicesTest>>Mismatched method category (expected: 'support' actual: #'*rowan-services-testsv2'): RowanServicesTest>>loadServicesTestProject
---------------RowanServicesTest>>Compiled method is not identical to loaded method: RowanServicesTest>>loadServicesTestProject
---------------RowanServicesTest>>Mismatched method category (expected: 'support' actual: #'*rowan-services-testsv2'): RowanServicesTest>>createProjectDefinitionNamed:
---------------RowanServicesTest>>Compiled method is not identical to loaded method: RowanServicesTest>>createProjectDefinitionNamed:
---------------RowanServicesTest>>Mismatched method category (expected: 'support' actual: #'*rowan-services-testsv2'): RowanServicesTest>>createNonDiskTestProjectNamed:packageName:
---------------RowanServicesTest>>Compiled method is not identical to loaded method: RowanServicesTest>>createNonDiskTestProjectNamed:packageName:
---------------RowanServicesTest>>Mismatched method category (expected: 'support' actual: #'*rowan-services-testsv2'): RowanServicesTest>>loadRowanSample1
---------------RowanServicesTest>>Compiled method is not identical to loaded method: RowanServicesTest>>loadRowanSample1

We should be able to recognize that there are duplicate methods in different packages in the same project during the load and throw an error.

@dalehenrich dalehenrich added the bug Something isn't working label Nov 21, 2024
@dalehenrich dalehenrich self-assigned this Nov 21, 2024
@dalehenrich
Copy link
Member Author

The following expression run against RowanClientServices:cfe8285a6 extent0.rowan3.dbf will reproduce the audit errors ... note that the conditional attribute testsV2 is what brings in the package with duplicate methods:

run
	| rowanProject loadSpecs projectsHome projectNames |
	projectsHome := '/bosch1/users/dhenrich/_stones/37x/k_37x_externals_st'.
 rowanProject := Rowan projectNamed: 'Rowan'.
	loadSpecs := rowanProject loadedLoadSpecifications.
	{
		'Announcements' .
		'FileSystemGs' .
		'RemoteServiceReplication' .
		'RowanClientServices' .
	}
		do: [:projectName |
			"pick up the extra rowan3 projects"
			(Rowan projectNamed: projectName ifAbsent: [])
				ifNotNil: [:project |
					| loadSpec |
					loadSpec :=  project loadSpecification.
					loadSpecs addLoadSpec: loadSpec ] ].
	loadSpecs do: [:loadSpec |
		| relRoot projectAlias |
		projectAlias := loadSpec projectName = 'RowanClientServices'
			ifTrue: [ 
				(System gemVersionAt: 'gsVersion') asRwGemStoneVersionNumber >= ('3.7.2' asRwGemStoneVersionNumber)
					ifTrue: [ 
						"RowanClientServices is the only project that needs a projectAlias"
						'RowanClientServicesV3']
					ifFalse: [ loadSpec projectAlias ] ]
			ifFalse: [ loadSpec projectAlias ].
		relRoot := loadSpec relativeRepositoryRoot.
		relRoot isEmpty
			ifTrue: [ 
				loadSpec 
					projectsHome: projectsHome;
					gitUrl: 'file:', ((projectsHome, '/', projectAlias) asFileReference pathString);
					yourself  ]
			ifFalse: [
						"embedded Rowan project" 
						loadSpec
							gitUrl: 'file:', (((projectsHome, '/', projectAlias) asFileReference / relRoot) pathString);
							projectsHome: projectsHome;
							yourself ].
		loadSpec addCustomConditionalAttributes: #('tests' 'testsV2') ].
	projectNames := loadSpecs load projectNames asArray sort. 
	GsFile gciLogServer: 'Rowan projects attached and reloaded: '.
	projectNames do: [:each |
	GsFile gciLogServer: '	', each ]

%

run
Rowan projectTools audit auditAll. 
%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant