Failure to retrieve software version from git checkout
Dear experts,
I get an error which is apparently related to the following function
https://gitlab.cern.ch/silab/bdaq53/blob/v0.9.0/bdaq53/scan_base.py#L34
The error message is
[rd53a@marrd53a scans]$ python scan_digital.py
2018-12-13 17:08:52,579 - [DigitalScan ] - WARNING You are using the default chip configuration file. Please use a chip specific configuration file!
2018-12-13 17:08:52,579 - [DigitalScan ] - INFO Initializing DigitalScan...
2018-12-13 17:08:52,726 - [Periphery ] - INFO Periphery is disabled.
2018-12-13 17:08:52,731 - [RD53A ] - SUCCESS Found board USBPix3 with SMA running firmware version 0.9
2018-12-13 17:08:52,731 - [RD53A ] - INFO Si570 oscillator is already configured
2018-12-13 17:08:52,732 - [RD53A ] - INFO Initializing communication with chip...
2018-12-13 17:08:52,841 - [RD53A ] - INFO Aurora receiver running at 1.28Gb/s
2018-12-13 17:08:52,842 - [RD53A ] - INFO 1 Aurora lane active
2018-12-13 17:08:52,882 - [RD53A ] - SUCCESS Communication established
2018-12-13 17:08:53,554 - [DigitalScan ] - INFO Configuring chip...
Traceback (most recent call last):
File "scan_digital.py", line 80, in <module>
scan.start(**local_configuration)
File "/home/rd53a/RD53_DAQ/bdaq53_new_v0.9.0/bdaq53/bdaq53/scan_base.py", line 641, in start
self._configure_readout(**kwargs) # Raw data handling
File "/home/rd53a/RD53_DAQ/bdaq53_new_v0.9.0/bdaq53/bdaq53/scan_base.py", line 538, in _configure_readout
self.dump_configuration(**kwargs)
File "/home/rd53a/RD53_DAQ/bdaq53_new_v0.9.0/bdaq53/bdaq53/scan_base.py", line 405, in dump_configuration
row['value'] = get_software_version()
File "/home/rd53a/RD53_DAQ/bdaq53_new_v0.9.0/bdaq53/bdaq53/scan_base.py", line 43, in get_software_version
active_branch = repo.active_branch
File "/home/rd53a/anaconda2/lib/python2.7/site-packages/GitPython-2.1.11-py2.7.egg/git/repo/base.py", line 696, in active_branch
return self.head.reference
File "/home/rd53a/anaconda2/lib/python2.7/site-packages/GitPython-2.1.11-py2.7.egg/git/refs/symbolic.py", line 275, in _get_reference
raise TypeError("%s is a detached symbolic reference as it points to %r" % (self, sha))
TypeError: HEAD is a detached symbolic reference as it points to 'bb0f659a993b72927ec631b4eedbbc76c8139112'
Closing remaining open files:/home/rd53a/RD53_DAQ/bdaq53_new_v0.9.0/bdaq53/bdaq53/scans/output_data/20181213_170852_digital_scan.h5...done
The way I set up the code is through
git clone https://gitlab.cern.ch/silab/bdaq53.git
git checkout tags/v0.9.0
As it is a tag, this looks consistent with the returned HEAD as active git branch.
Is there another recommended way to set up a given tag to avoid this issue?
Thank you very much for your feedback
Best regards,
Thomas