Skip to content

fmtlib does not have a master branch #5

@bartman

Description

@bartman

I tried a simple build against your library and no other dependencies.

CMakeLists.txt
# CMake file for a C++ program
cmake_minimum_required(VERSION 4.0)
project(work_contract_test VERSION 1.0 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
#set(CMAKE_CXX_EXTENSIONS OFF)

# https://github.com/buildingcpp/work_contract
include(FetchContent)
FetchContent_Declare(
    work_contract
    GIT_REPOSITORY https://github.com/buildingcpp/work_contract.git
    GIT_TAG        origin/main
)
FetchContent_MakeAvailable(work_contract)

# include pthread
find_package(Threads REQUIRED)

# build main.cpp
add_executable(main main.cpp)

# use pthread and work_contract libraries
target_link_libraries(main PRIVATE Threads::Threads work_contract)

It failed being unable to fetch the fmtlib from github.

❯ cmake -S. -Bbuild
CMake Deprecation Warning at build/_deps/work_contract-src/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.10 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.


*** Build type not set.  defaulting to Release
Build Type = Release
Fetching Content: fmt
-- url: https://github.com/fmtlib/fmt.git
-- tag: master
[ 11%] Performing download step (git clone) for 'fmt-populate'
Cloning into 'fmt-src'...
fatal: invalid reference: master
CMake Error at _deps/fmt-subbuild/fmt-populate-prefix/tmp/fmt-populate-gitclone.cmake:61 (message):
  Failed to checkout tag: 'master'


make[2]: *** [CMakeFiles/fmt-populate.dir/build.make:102: fmt-populate-prefix/src/fmt-populate-stamp/fmt-populate-download] Error 1
make[1]: *** [CMakeFiles/Makefile2:87: CMakeFiles/fmt-populate.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

CMake Error at /etc/profiles/per-user/bart/share/cmake-4.1/Modules/FetchContent.cmake:1918 (message):
  Build step for fmt failed: 2
Call Stack (most recent call first):
  /etc/profiles/per-user/bart/share/cmake-4.1/Modules/FetchContent.cmake:1609 (__FetchContent_populateSubbuild)
  /etc/profiles/per-user/bart/share/cmake-4.1/Modules/FetchContent.cmake:2145:EVAL:2 (__FetchContent_doPopulation)
  /etc/profiles/per-user/bart/share/cmake-4.1/Modules/FetchContent.cmake:2145 (cmake_language)
  /etc/profiles/per-user/bart/share/cmake-4.1/Modules/FetchContent.cmake:2384 (__FetchContent_Populate)
  build/scripts-src/cmake/fetch_dependencies.cmake:25 (FetchContent_MakeAvailable)
  build/_deps/work_contract-src/CMakeLists.txt:69 (fetch_dependency)


-- Configuring incomplete, errors occurred!

It looks like your cmake is trying to pull branch master from this repo...

Image

... but the repo has a main branch.

❯ git ls-remote https://github.com/fmtlib/fmt.git | grep -e main -e master
3febdca556d2979566cd88ebebeb809c9faabcc0	refs/heads/main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions