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

Baseline output is not stable #5085

Closed
mvorisek opened this issue May 27, 2021 · 6 comments · Fixed by phpstan/phpstan-src#536
Closed

Baseline output is not stable #5085

mvorisek opened this issue May 27, 2021 · 6 comments · Fixed by phpstan/phpstan-src#536

Comments

@mvorisek
Copy link
Contributor

Bug report

Code snippet that reproduces the problem

image

run on 2 different machines, one linux (CI, multicpu) and one Windows (with 1 CPU)

Expected output

baseline output must always be stable

@mergeable
Copy link

mergeable bot commented May 27, 2021

This bug report is missing a link to reproduction on phpstan.org.

It will most likely be closed after manual review.

@ondrejmirtes
Copy link
Member

/cc @dktapps

@dktapps
Copy link
Contributor

dktapps commented May 27, 2021

...

To be honest, I was already inclined to point to a change in PHP's own behaviour to blame for this in the first place, considering that the errors were already sorted, and especially now considering the fact that the errors are now sorted immediately before output, first by file, then by message pattern. So if this still didn't fix it, then I'm out of answers.

@dktapps
Copy link
Contributor

dktapps commented May 27, 2021

On closer inspection, I noticed this: https://github.com/phpstan/phpstan-src/blob/master/src/Command/ErrorFormatter/BaselineNeonErrorFormatter.php#L64

This makes me think that the sorting order change is something to do with the directory separators in the original path (since it would likely be absolute), which might explain the ordering difference. I guess it would make sense to alter the algorithm to sort based on the normalized relative path, instead of the original path.

@ondrejmirtes
Copy link
Member

Fixed by phpstan/phpstan-src#536

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants