Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guillep/pillar-bug
https://github.com/guillep/pillar-bug
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/guillep/pillar-bug
- Owner: guillep
- License: mit
- Created: 2017-06-16T09:33:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-28T18:59:30.000Z (over 6 years ago)
- Last Synced: 2024-10-31T06:42:03.754Z (2 months ago)
- Language: Smalltalk
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pillar-Bug
This repository explains how to reproduce a hard-to debug pillar bug due to the strange semantics of Pillar configurations.
The configuration of a pillar project uses `doesNotUnderstand:` and the Magritte meta-description framework to control how a configuration should be serialized and deserialized into text among others. This combination has strange semantics that produce hard-to-debug errors..## Setting up the Bug Environment
Clone this repository
```bash
$ git clone https://github.com/guillep/pillar-bug.git
cd pillar-bug
```Install stable Pillar version
```bash
$ git clone https://github.com/pillar-markup/pillar
$ cd pillar
$ ./download.sh
````Run Pharo tests to see that all tests are running OK:
```bash
$ ./pharo Pharo.image test "Pillar.*"
[...]
3182 run, 3182 passes, 0 failures, 0 errors.
```## Bug Alternative 1
### Introducing the Bug
Introduce in PRPillarConfiguration a disabledPhases instance variable + accessors
(You can do it with the script in this repository)```bash
$ ./pharo Pharo.image ../introduceBug.st --save --quit
```Run tests again and see that this accessor produced 16 errors:
```bash
$ ./pharo Pharo.image test "Pillar.*"
[...]
3182 run, 3166 passes, 0 failures, 16 errors
```### Bug Symptoms
The affected tests are failing because now, in the method `PREPubMenuJustHeaderTransformer>>actionOn:`
```smalltalk
actionOn: anInput
^ (self class writers
includes: anInput configuration outputType writerName)
ifTrue: [ maxHeader := self maxHeaderOf: anInput input.
super actionOn: anInput ]
ifFalse: [ anInput ]
```The error is caused because outputType is nil. But we have no clue about the relation with the change we did and the bug.
### Alternatively, to reproduce from the image
Alternatives to reproduce the issue:
```smalltalk
PRExportBuilder new
createConfiguration: 'pillar.conf'
baseDirectory: FileSystem workingDirectory
argDictionary: {
'inputFile'-> (FileSystem workingDirectory / 'Chapters/Chapter1/chapter1.pillar') .
'defaultExporters' -> {'latex'}
} asDictionary;
export
```## Bug Alternative 2
### Introducing the Bug
We can introduce the bug using a different version of the `disabledPhases` accessors, using the properties mechanism in the configuration.
```bash
$ ./pharo Pharo.image ../introduceBugAlternative.st --save --quit
```Run tests again and see that this accessor produced 7 errors:
```bash
$ ./pharo Pharo.image test "Pillar.*"
[...]
3182 run, 3175 passes, 0 failures, 7 errors.
```### Bug Symptoms
The affected tests are failing because now, in the method `PRCreationPhase class>>isEnabled:`
```smalltalk
PRCreationPhase class>>isEnabled: aConfiguration
^ (aConfiguration disabledPhases includes: self key) not
```