denshoproject / ddr-local

Web UI used for interacting with DDR collections and entities on a local machine.
Other
3 stars 0 forks source link

Packager mishandling git-worktree dependencies #265

Closed gjost closed 4 years ago

gjost commented 4 years ago

Sara: Running ddr-pubcopy results in the following strange error:

(ddrlocal) ddr@DDREditor:/media/qnfs/kinkura/gold/ddr-densho-398$ ddr-pubcopy -mezzanine,transcript /media/qnfs/kinkura/gold/ddr-densho-398 /media/qnfs/kinkura/transfer/
Traceback (most recent call last):
...
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/EGG-INFO/scripts/ddr-pubcopy", line 16, in <module>
    from DDR import docstore
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/docstore.py", line 65, in <module>
    from DDR import modules
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/modules.py", line 3, in <module>
    from DDR import dvcs
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/dvcs.py", line 125, in <module>
    'cmd': latest_commit(config.INSTALL_PATH),
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/ddr_cmdln-0.9.4b0-py2.7.egg/DDR/dvcs.py", line 118, in latest_commit
    return repo.git.log('--pretty=format:%H %d %ad', '--date=iso', '-1')
...
  File "/opt/ddr-local/venv/ddrlocal/lib/python2.7/site-packages/git/cmd.py", line 825, in execute
    raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git log --pretty=format:%H %d %ad --date=iso -1
  stderr: 'fatal: Not a git repository: /opt/ddr-local-master/ddr-cmdln/.git/worktrees/ddr-cmdln'
gjost commented 4 years ago

When DDR starts up it gets the latest commit for each part of the codebase so it can write these commits in the object metadata (this is useful for diagnoses fit there's a problem in object files). The software couldn't get those commits because the ddr-cmdln code's .git/ dir was missing. This is a problem in the packaging code.

The Long Version:

I use git-worktree to manage the various branches of the ddr-local/ddr-cmdln/ddr-defs/ddr-vocab codebase. Worktree lets you have one .git/ dir but multiple working directories, each with a different branch. This lets me have develop and master directories checked out simultaneously. This is useful in cases where e.g. I'm working on one branch but have to flip to a different branch to fix a bug.

The .git/ dir only exists in one place (the master branch), so when I make a package for the develop branch I have the Makefile do some shuffling to make it all Just Work. This has been working for approximately the past year. The error indicates that something in the Makefile is now Not Working and the proper shuffling did not occur. It's not an error with the DDR application itself.

gjost commented 4 years ago

I wasn't able to track down exactly why this was happening. In the end I pruned the worktrees from my dev environment and rolled a package without them: ddrlocal-develop_2.8.9-5.

GeoffFroh commented 4 years ago

Marked wontfix b/c we are no longer using gitworktree