oneapi-src / level-zero

oneAPI Level Zero Specification Headers and Loader
https://spec.oneapi.com/versions/latest/elements/l0/source/index.html
MIT License
208 stars 90 forks source link

Broken Git version check #31

Closed eero-t closed 10 months ago

eero-t commented 4 years ago

Build makes invalid assumptions about Git repository tags / content:

$ git clone --branch v0.91.21 --depth 1 https://github.com/oneapi-src/level-zero.git  && cd level-zero && cmake -Wno-dev -G Ninja -DCMAKE_BUILD_TYPE=Release .
Cloning into 'level-zero'...
Note: switching to '317bc0d1ed9630924d409b419a30465dfdcf2be3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
fatal: ambiguous argument 'v0.91..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
CMake Error at CMakeLists.txt:43 (message):
  Cannot determine patch version - couldn't find v0.91 tag in repository

(It builds fine without the "--depth 1" option which I use to reduce git checkout sizes in build containers.)

bmyates commented 4 years ago

Hi, this has been improved in the 1.0 version now on master branch. If cmake can't determine the patch version it will default to zero with a warning message instead of a fatal error.

eero-t commented 4 years ago

So newer L0 versions will not fail to this, but are likely to advertise wrong patch version... Why version information isn't hard-coded in the build file, like in many other projects?

(To help avoid things getting out of sync, you could have a checklist about things that need to be updated on each release.)

eero-t commented 10 months ago

Closing, will file another bug if another instance of this surfaces.