I am encountering some challenges while using Pant...
# general
c
I am encountering some challenges while using Pants in my open-source project. Despite setting
[GLOBAL].pants_version = '2.16.0'
, I keep receiving an error message regarding the installed version. The error states:
'pants.base.exceptions.BuildConfigurationError: Version mismatch: Requested version was 2.16.0, but our version is 2.16.0+git016d98d7.'
To resolve this issue, I attempted to uninstall the older version; however, I couldn't find a suitable command to do so. Consequently, I deleted the binary file instead. Subsequently, I used the following installation command:
curl --proto '=https' --tlsv1.2 -fsSL <https://static.pantsbuild.org/setup/get-pants.sh> | bash,
which reinstalled the
2.16.0+git016d98d7
version. This inconsistency in versions is causing problems across different systems, as each system may have a different minor version. Moreover, when I execute `pants --version'`outside the build root, I encounter another error. Ideally, the currently installed version should not require the build root file to output its version. Putting
[GLOBAL].pants_version = '^2.16.0'
has suppressed the error for a couple of commands but the error reappeared again and now i can't run any of the pants command
b
Hm, that's weird. How frustrating! The commit in that version output is the same commit as the main 2.16.0 release itself... so it's weird that it's ending up like that. Reinstalling the
pants
runner may not help directly, as it's 'just' a runner that downloads and installs the real pants code. This is also why
pants --version
only works in a build root: it is printing the version of pants that's configured to run in that root. To see the version of the pants runner,
PANTS_BOOTSTRAP_VERSION=report pants
prints that out. One potential way to unblock you is to clear out the cache that the pants runner has of the pants code:
~/Library/Caches/nce
on macOS or (I think)
~/.cache/nce
on Linux.
h
Ouch, sorry for the trouble! This is somehow related to our reversioning logic. Does this happen on a specific platform?