Code Monkey home page Code Monkey logo

Comments (4)

wyq977 avatar wyq977 commented on August 22, 2024

After looking through the github action CI, I found out that the git submodule failed to clone into external/doctest where it later led to errors in cmake. As indicated by the messages in logging:

Successful run:

Run auth_header="$(git config --local --get http.https://github.com/.extraheader)"
  auth_header="$(git config --local --get http.https://github.com/.extraheader)"
  git submodule sync --recursive
  git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
  shell: /bin/bash --noprofile --norc -e -o pipefail {0}
Submodule 'external/doctest' (https://github.com/onqtam/doctest.git) registered for path 'external/doctest'
Cloning into '/home/runner/work/cpp-project/cpp-project/external/doctest'...
Submodule path 'external/doctest': checked out '503de03ee2cbbfc58c2063dce36dc96f917f2da3'

Failed run (without git submodule)

Run auth_header="$(git config --local --get http.https://github.com/.extraheader)"
  auth_header="$(git config --local --get http.https://github.com/.extraheader)"
  git submodule sync --recursive
  git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
  shell: /bin/bash --noprofile --norc -e -o pipefail {0}

from cpp-project.

bsamseth avatar bsamseth commented on August 22, 2024

Hi!

Thanks for reporting this. Submodules in git always cause issues. Still, I realize it is not made as clear as it should that you need submodules for the build to work. I also noticed that the setup.sh script could fail under some versions of sh (I changed computer, and now it fails) due to me using bash syntax. This would cause the submodule stuff to be skipped.

I've made some changes to both the README and the setup script to improve this (#22). It seems to do the trick, at least on my machine.

In summary: When cloning, use git clone --recurse-submodules <url>. If you already cloned without, it should be enough to do git submodule update --init --recursive. But the safest is to clone the "right" way.

Hope it helps!

from cpp-project.

wyq977 avatar wyq977 commented on August 22, 2024

Thanks a lot for the tips, forgot to mention the setup.sh but great that you fixed it!

I would suggested made some twists in the github action as checkout support recursive when cloning

see actions/checkout#34

So the modified workflow would start with:

    - uses: actions/checkout@master
      with:
        submodules: true

It works on other example but I have no luck with that since they just merged it into master branch 4 days ago. But textbook/git-checkout-submodule-action@master should works in theory

from cpp-project.

bsamseth avatar bsamseth commented on August 22, 2024

Thanks for the input about the simplified action - I don't remember where I got the code I use now, but in any case this is cleaner. It works fine. As soon as all the CI checks complete I'll merge the PR and master should be good to go.

from cpp-project.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.