Dvc: build: windows: investigate improper version

Created on 26 Jun 2019  路  13Comments  路  Source: iterative/dvc

https://github.com/iterative/dvc/releases/tag/0.50.0

dvc-0.50.0.a54a34.mod.exe

should be

dvc-0.50.0.exe
bug c8-full-day p0-critical

All 13 comments

@efiop where to start looking for this issue?

@ryokugyu the script that is generating the version is in scripts/innosetup/config_gen.py. It is importing __version__ from dvc that is in the environment. In appveyor.yml(which is building this exe on CI) we are installing dvc locally with pip install . and I'm not sure if config_gen got the __version__ from the repo itself or from the installed dvc package. One of the possible solutions is to just modify config_gen to get the _BASE_VERSION from dvc/version.py, which is always present during the build from our repo.

i installed dvc via pip install dvc on my machine.

when running dvc version or dvc --version
dvc_vesion_windows

i am getting this.

@ryokugyu with pip install dvc? I meant pip install ., we are using that in appveyor.yml. The dvc version itself is working fine, tested it too, the issue is somewhere during the build process on appveyor.

@ryokugyu Here is where we are installing dvc twice (this is a bug, probably don't need the latter one) https://github.com/iterative/dvc/blob/master/.appveyor.yml#L55

  - pip install .[all,tests]
  - python setup.py install

Maybe the latter one is causing this issue. After that, we are running https://github.com/iterative/dvc/blob/master/.appveyor.yml#L73

.\scripts\build_windows.cmd

which is building the executable with a wrong version.

@ryokugyu Here is where we are installing dvc twice (this is a bug, probably don't need the latter one) https://github.com/iterative/dvc/blob/master/.appveyor.yml#L55

  - pip install .[all,tests]
  - python setup.py install

Maybe the latter one is causing this issue.

so, we just remove the python setup.py install?
and then how to test it?

@ryokugyu To test it:
1) make sure there is no dvc installed (where dvc should not print anything)
2) do git checkout 0.50.0
2) run pip install .
3) run .\scripts\build_windows.cmd
4) check that created dvc-*.exe has proper version

Still persists in 0.50.1 https://ci.appveyor.com/project/iterative/dvc/builds/25560657/job/cevfj2se81oiigs4 with setup.py ine removed in d6d0b25

Ok so here is why we get this strange number of version:

  • when installing we get the version of dvc to properly name executable
  • if current branch is tagged and unchanged, we will name it as version number (dvc-0.50.0.exe)
  • if something has been changed, we will add first 6 letters of revision sha, which results in dvc-0.50.0.a54a34.mod.exe

But why is it happening on freshly checked out 0.50.0 version?

  • to install it on windows we need to download some dependencies (dvc_left.bmp, dvc_up.bmp, dvc.ico) using dvc.
  • calling dvc cause repo initialization
  • repo by default should ignore file list
  • problem is that .gitignore on this revision did not included /repos (which is ignored here)
  • pulling causes adding /repos to .gitignore, branch is unclean
  • during installation new version name is introduced, because branch is not clean

Proposed solution

  • introduce /repos to master .gitignore to avoid same bug in the future

  • we could replace released windows binary with build that has been build after git reset --hard, which should follow pulling dvc_left and the rest

Fix has been introduced by @Naba7 in #2195, thanks @Naba7!

@pared so you are confirming that it is fixed? Should we close this?

Yes, checked on master, pulling the dependencies does not introduce changes to the repo.

I am closing the issue, next release should not have such problems.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

dnabanita7 picture dnabanita7  路  3Comments

TezRomacH picture TezRomacH  路  3Comments

robguinness picture robguinness  路  3Comments

ghost picture ghost  路  3Comments