-
Notifications
You must be signed in to change notification settings - Fork 9
Conversation
This does only work when using a git repository with witness lint. But ideally we also have the verison available for packaged versions of the linter. Currently there is a variable for storing the version inside https://github.com/sosy-lab/sv-witnesses/blob/main/lint/witnesslint/linter.py Ideally we set this version to something like The verison output of the linter could e.g. first try to determine whether this is a source checkout and use Does this make sense? |
Coupling the linter to git as proposed in this PR is somewhat dangerous, for example if in the future we migrate away from git or git changes it command-line parameters etc. So at the very least the code needs to be robust against all kinds of errors when determining the version (git not installed, git returning an error, etc.). I don't think catching What Martin suggests is feasible, we do something like this in CPAchecker, although there we do not need to do it at runtime, but only at build time. (However, if done the code should look first at the hard-coded version and only attempt to run git if this looks like a development version.) But I want to suggest that for a small project like this, determining the version based on git is not necessary. Just declare a version in the source code, suffixed with |
Removed the dependency on git. Personally I also prefer not having this here, but it also means we discard the second part of #53. @MartinSpiessl Is that acceptable for you? |
Well, the main issue I really think should be addressed is that it should always be clear in SV-COMP which version of the linter was run. Manually bumping the version before creating a zip for the archives repository of the SV-COMP is error-prone, because one might forget to do this and then we have two different versions of the linter which give the same version string. In the worst case this could lead to a lot of work caused because people try to debug a problem without realizing that there were two different linter versions. This should be addressed, but can be done in the packaging script/method (that does not yet exist but really should). Also having commits that just do "bump version to x.y.z" just feels odd to me, there should be a more elegant way to achieve this. I just stumbled upon Python Semantic Release(PSR) via https://py-pkgs.org/07-releasing-versioning.html#automatic-version-bumping , this looks interesting, but is probably overkill for such a small project as the linter.
Hmmm, I am curious, how would having the package make this easier? As I see it one would also have to bump the version there, so while this would be an improvement for users who want to install the package e.g. via pip, this would not really affect the general considerations of how the version is determined. Regarding this MR, I think it is good like this and we can merge it. Then worry about how to package the linter for SV-COMP independently from this. |
This is why it is critical to have a clear indication whether a version is a proper release version or a non-unique identifier of a range of commits. Suffixing
I think you are overcomplicating this and your link also just creates such commits. There is nothing bad with this, and it is also negligible effort because it can be automated with a few lines of script.
I didn't say this becomes easier. |
Merging this since the current version seems to be acceptable for everyone. Further discussion can take place in #39, once that PR is ready. |
The version-number change in this PR is not good: |
Done in 42a9175. |
This PR adds version output to each run of the witness linter. To get more precise information about the used version, the current git revision is also appended when possible.
Closes #53.