core-v-verif icon indicating copy to clipboard operation
core-v-verif copied to clipboard

Make system doesn't update the git branch/commit/tag when rerunning with a different value

Open christian-herber-nxp opened this issue 2 years ago • 3 comments

Improve makefile to update the git repository on incremental builds

Task Outcome

Make system that properly updates the git repository in incremental runs

Completion Criteria

in a build using make, the git repository should be updated if it has been cloned before, if

  • there is new commits remote
  • an environment variable changed to use different branch/commit/tag

frankly, the safest way to do this will likely be to remove and then clone again. this would avoid issues where the remote url changed to a fork but the repo name is the same. shallow clone could be done for performance improvement.

christian-herber-nxp avatar Feb 14 '23 10:02 christian-herber-nxp

Hi @christian-herber-nxp, you are right about this. I am torn about whether anything needs to be done about this. Up to now we have required the user to make clean_all before switching to a new version of any of the external resources that are cloned for core-v-verif (RTL, RISCV-DV, SVLIB).

I would certainly review an pull-request to the Makefiles to automate updates of cloned repos on incremental builds, as long as it does not add undue complexity to our build environment (which is already complicated).

I am not a fan of shallow clones as they often trade performance for complexity.

MikeOpenHWGroup avatar Feb 14 '23 14:02 MikeOpenHWGroup

I see pros and cons on both the current and proposed approach - the proposed methodology looses some flexibility if you actually do modifications in-place on cloned repositories (quick tests, riscv-dv development work etc.). In that case you would have to ensure that the cloned, modified repos are not overwritten; personally I prefer the solution that does not potentially erase development work when one accidentally forgets some flag, rather than the the one that always cleans out everything unless explicitly told otherwise.

silabs-hfegran avatar Feb 15 '23 12:02 silabs-hfegran

Hi all, If I need to make some experiments on Core RTL, I am cloning manually elsewhere than inside core-v-verif/core-v-cores and use CV_CORE_PATH which creates a link in core-v-cores to your updated clone. No fear that it would be destroyed unintentionally (only the link). But I agree this mechanism is only available for RTL and not on any other clone core-v-verif is making locally. To have clean_all destroying all clones would require first to apply same "linking" methodology to all required clones.

pascalgouedo avatar Feb 15 '23 15:02 pascalgouedo