pharo icon indicating copy to clipboard operation
pharo copied to clipboard

Compiler on CI failure in absence of declared trait

Open Ducasse opened this issue 1 year ago • 3 comments

In bloc I got the following classe definition.

TestCase subclass: #BlBasicTest
        uses: TBlExamples
	instanceVariableNames: ''
	classVariableNames: ''
	package: 'Bloc-UnitedTests-Basic'

On the server, the trait TBlExamples was not loaded before the package containing this class definition resulting in the NewUndeclared.

This resulted in a syntax error when compiling methods on the CI.

Syntax Error on line 4: 'Variable or expression expected'
=========================================================
01: testBorderRopedText
02: 	<sampleInstance>
03: 	
04: 	| aText |
    _^_
05: 	aText := 'Text with border' asRopedText.
06: 	aText fontSize: 30.
07: 	aText foreground: Color gray.
08: 	aText thin.
09: 
10: 	self assert: aText rope attributes equals: {
11: 			(BlFontSizeAttribute size: 30).
12: 			(BlTextForegroundAttribute paint: Color gray).
13: 			BlFontWeightAttribute thin }.
14: 
15: 	^ aText

Error with status code 1:
657 run_script /home/runner/.smalltalkCI/helpers.sh
Error: Process completed with exit code 1.

Ducasse avatar Apr 09 '23 08:04 Ducasse

Here without any space showing that this is not an undesirable character

Syntax Error on line 4: 'Variable or expression expected'
=========================================================
01: testBorderRopedText
02: 	<sampleInstance>
03: 	
04: 	| aText |
    _^_
05: 	aText := 'Text with border' asRopedText.
06: 	aText fontSize: 30.
07: 	aText foreground: Color gray.
08: 	aText thin.
09: 
10: 	self assert: aText rope attributes equals: {
11: 			(BlFontSizeAttribute size: 30).
12: 			(BlTextForegroundAttribute paint: Color gray).
13: 			BlFontWeightAttribute thin }.
14: 
15: 	^ aText

Ducasse avatar Apr 09 '23 08:04 Ducasse

@Ducasse is the stack trace available?

privat avatar Apr 14 '23 17:04 privat

This is quite common case when trait dependencies between packages are broken and the error report is very cryptic and not helpful.

pavel-krivanek avatar May 04 '24 06:05 pavel-krivanek