YosysHQ / yosys

Yosys Open SYnthesis Suite
https://yosyshq.net/yosys/
ISC License
3.3k stars 860 forks source link

Fix `check-git-abc` Makefile target #4384

Closed dopamane closed 1 month ago

dopamane commented 1 month ago

What are the reasons/motivation for this change?

https://github.com/YosysHQ/yosys/issues/4383

Explain how this is achieved.

Add the condition that if git submodule status abc results in a string starting with - then the git submodule is uninitialized.

If applicable, please suggest to reviewers how they can test the change.

Clone the repo, run make or make check-git-abc, examine instructions to initialize the submodule, git submodule update --init, re-run make or make check-git-abc and there should not be any error.

mmicko commented 1 month ago

@dopamane thanks for changes suggestions. Please note there are couple of cases we need to handle here

  1. no "abc" directory ( ask for submodule init)
  2. there is "abc" directory but it is empty ( ask for submodule init)
  3. there is existing "abc" from before the change and there is .gitcommit (with "$Format:%h$") ask for it to be removed and initialized
  4. there is existing "abc" with .gitcommit containing git revision number (this is fine it is unpacked abc tarball)

Last one is special case we need to handle for users not using git but building all from source tarballs. Meta code that should cover this

if abc dir exists 
   if abc/.gitcommit is not "$Format:%h$"
          all fine abc tarball, just exit
   else if abc submodule status is "-" 
          using old abc checkout, remove and initialize
   else 
         all fine
else 
   ask for submodule init
mmicko commented 1 month ago

@dopamane Could you please take a look at https://github.com/YosysHQ/yosys/pull/4386 and if this one works fine for you.