hdl / conda-eda

Conda recipes for FPGA EDA tools for simulation, synthesis, place and route and bitstream generation.
https://anaconda.org/LiteX-Hub
Apache License 2.0
95 stars 26 forks source link

Add git revisions as labels #283

Closed donn closed 4 months ago

donn commented 1 year ago

Would it be possible to add labels that are like gitrev-XXXXXXXXXXXXXXX that have the full git revision of a specific build?

mithro commented 1 year ago

FYI - @proppy

mithro commented 1 year ago

@PiotrZierhoffer is this information already available in some way?

proppy commented 1 year ago

@donn git revision of the upstream repo, or the conda-eda repo?

If the former the short rev is already part of the archive name, prefixed with g, see: https://anaconda.org/LiteX-Hub/openlane/files

donn commented 1 year ago

That's not entirely an option, as there is no way I'm aware of to translate the long rev into ${version}_g${shortrev} without cloning the repository myself first or maintaining a dictionary somewhere.

mithro commented 1 year ago

@donn - What are you trying to do? The {shortrev} value should work anywhere the full revision value is accepted...

donn commented 1 year ago

We don't have shortrev set up in the OpenLane tool Docker repo tags (efabless/openlane-tools), so we can't use the shortrevs there. Additionally, shortrevs are not immutable: in the (admittedly small) chance that another revision is generated with the first same 7 characters in the revision hash, the shortrev immediately becomes ambiguous: git will not generate the same shortrev for said revision nor will it accept it as a means of reaching said revision again.

Additionally, that does not solve the version and revision numbers as part of the version tag.

I was wondering if we could just have a direct mapping from the full revision hash to a label. It would make my life a lot easier.