pybind / pybind/pybind11

[BUG]: The main repository and submodule both have source code dependencies on the usage of pybind11

Open
#5,521 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
C++
Stars
18k
Forks
2.3k
Avg merge
5d 17h
Merged PRs (30d)
10

Description

Required prerequisites
What version (or hash if on master) of pybind11 are you using?

stable branches

Problem description

Reproduce by files uploading

Problem

When the main repo and the submodule repo also depends the pybind11 in source code way, the command pybind11_add_module in cmakelists.txt of main repo will

  • use the function defined in test_pybind11/third-party/sub/third-party/pybind11/tools/pybind11Tools.cmake
  • not the expected definition in test_pybind11/third-party/pybind11/tools/pybind11Tools.cmake

How to proof this problem is exist?

I have deleted this two files the pybind11 in test_pybind11/third-party/pybind11:

deleted:    tools/pybind11NewTools.cmake
deleted:    tools/pybind11Tools.cmake

But I still can build the repo successfully by

mkdir build
cd build
cmake ..
make
Reproducible example code
code is here: https://github.com/HRXWEB/test_pybind11
Is this a regression? Put the last known working version here if it is.

Not a regression

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked test_pybind11 repository and inspect its main CMakeLists.txt plus test_pybind11/third-party/pybind11/tools/pybind11Tools.cmake and the nested submodule copy. Reproduce from a clean build with cmake .. and make, then verify which pybind11_add_module definition is selected after the main copy's tool files are removed.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.