betrusted-io/gateware

build failure generating git info

Closed this issue · 1 comments

xobs commented

The build fails on Windows generating git info:

Traceback (most recent call last):
  File ".\betrusted-soc.py", line 1442, in <module>
    ret = main()
  File ".\betrusted-soc.py", line 1397, in main
    soc = BetrustedSoC(platform, args.revision, xous=args.xous)
  File ".\betrusted-soc.py", line 1156, in __init__
    self.submodules.info = info.Info(platform, self.__class__.__name__, analog_pads)
  File "D:\Code\Betrusted\soc\deps\gateware\gateware\info\__init__.py", line 19, in __init__
    self.submodules.git = git.GitInfo()
  File "D:\Code\Betrusted\soc\deps\gateware\gateware\info\git.py", line 58, in __init__
    commit = sum(int(x) << (i*8) for i, x in enumerate(reversed(git_commit())))
  File "D:\Code\Betrusted\soc\deps\gateware\gateware\info\git.py", line 37, in git_commit
    cwd=git_root(),
  File "D:\Code\Betrusted\soc\deps\gateware\gateware\info\git.py", line 22, in git_root
    stdin=git.stdout,
  File "D:\Software\Python37\lib\subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "D:\Software\Python37\lib\subprocess.py", line 488, in run
    with Popen(*popenargs, **kwargs) as process:
  File "D:\Software\Python37\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "D:\Software\Python37\lib\subprocess.py", line 1207, in _execute_child
    startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified

It looks like it's calling cygpath, which only exists if you're running under cygwin.

I've worked around the problem by removing the call to git_commit() and hardcoding it to 0, but we may want to consider going with a more compatible git info module such as https://github.com/im-tomu/foboot/blob/master/hw/rtl/version.py