Actual git version is not displayed for `platform_packages`
See original GitHub issueWhat kind of issue is this?
- PlatformIO Core. If you’ve found a bug, please provide an information below.
Configuration
Operating system: Fedora Linux 35 (Container Image)
PlatformIO Version (platformio --version
):
PlatformIO Core, version 5.2.5a1
Description of problem
Given the following platformio.ini
[env]
platform = espressif8266@3.2.0
framework = arduino
platform_packages =
platformio/framework-arduinoespressif8266 @ git+https://github.com/esp8266/Arduino.git
; notice that there's no version pin, it fetches the master branch
[env:d1_mini]
board = d1_mini
Extra package override is successfully fetched into ~/.platformio/packages/framework-arduinoespressif8266@src-31d658a59f41540201fc3726a1394910/
and reported as version 3.1.0-dev+sha.42aa0e6d
However, manually changing the commit by using git checkout 55ef3e73978ad010d44ad7e4c9bd4b4f32455989
does not seem to affect the version displayed in the PACKAGES
list when doing pio run
, and instead the .git/.piopm
metadata file “version” field is used (from the installation time).
$ pio run
Processing d1_mini (platform: espressif8266@3.2.0; board: d1_mini; framework: arduino)
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp12e.html
PLATFORM: Espressif 8266 (3.2.0) > Espressif ESP8266 ESP-12E
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES:
- framework-arduinoespressif8266 3.1.0-dev+sha.42aa0e6d
- tool-esptool 1.413.0 (4.13)
- tool-esptoolpy 1.30000.201119 (3.0.0)
- toolchain-xtensa 2.100300.210717 (10.3.0)
^CBuild interrupted.
$ git -C ~/.platformio/packages/framework-arduinoespressif8266@src-31d658a59f41540201fc3726a1394910/ rev-parse HEAD
55ef3e73978ad010d44ad7e4c9bd4b4f32455989
Shouldn’t the package manager run git rev-parse HEAD
(or track .git/HEAD
changes) and use that value instead of version saved in the .piopm
? Or, at least attempt to refresh it. I have noticed inconsistent version reports at the esp8266/Arduino repo when user has master-branch package configured, it would be nice to know the actual revision of the repo without asking the user to go to the ~/.platformio/packages dir and run git
command manually 😃
(and I assume the same behaviour for lib_deps
, but I have not tried it)
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
I will, as soon as I’ll get to the PC
Not necessarily true? If you mean using
subprocess
, perhaps.git rev-parse HEAD
is notrev-list
and is extremely cheap operation, since our only goal is to just retrieve the hash.Notice that we could also read the
.git/HEAD
file instead of calling anything. It contains either the hash or the ref path. But, we’d need to implement part of git logic ourselves