bcp Issue: `--namespace` renames the namespace but NOT the library target name
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- cpp
- Domain
- build-system
Research direction
Start with bcp's library-prefix renaming logic and the generated libs/regex/build/Jamfile.v2 from the reproduction. Check how the modular lib boost_regex target is handled when using --namespace=myboost. Done means the target becomes lib myboost_regex and the build produces the expected libmyboost_regex.* artifacts.
Written by the indexing model from the issue text.
Description
Boost version: 1.90.0 (BOOST_VERSION 109000)
Tool: bcp (from dist/bin/bcp)
Platform: Linux x86_64, gcc-14, b2
Summary
bcp --namespace=myboost is documented to rename both the C++ boost
namespace and the binary library prefix. The namespace rename works, but the
Boost.Build library target name in libs/regex/build/Jamfile.v2 is left
unchanged (lib boost_regex). Consequently the built artifact is
libboost_regex.* instead of the expected libmyboost_regex.*.
Reproduction
ROOT=/path/to/boost
"$ROOT/dist/bin/bcp" \
--boost="$ROOT" \
--namespace=myboost --namespace-alias --unix-lines \
regex config build assert concept_check preprocessor static_assert \
type_traits core throw_exception predef \
"$ROOT/.build"
cd "$ROOT/.build" && ./bootstrap.sh && ./b2 --with-regex -j4
Observed
Namespace rename — WORKS
Headers and sources are rewritten to namespace myboost, with a boost alias
inserted (from --namespace-alias):
// boost/assert.hpp
namespace myboost {} namespace boost = myboost; namespace myboost { ... }
Library target name — NOT renamed
.build/libs/regex/build/Jamfile.v2 still declares:
lib boost_regex : ../src/$(SOURCES) icu_options ...
(identical to the original — the boost_regex target name was not rewritten to
myboost_regex.)
Produced artifacts — wrong prefix
stage/lib/libboost_regex.so.1.90.0
stage/lib/libboost_regex.so
stage/lib/libboost_regex.a
Expected: libmyboost_regex.so.1.90.0, libmyboost_regex.so, libmyboost_regex.a.
Expected behaviour
Per bcp docs ("Also renames Boost binaries to use newname rather than boost
as a prefix"), the lib boost_regex target in the modular
libs/regex/build/Jamfile.v2 should be renamed to lib myboost_regex, so the
built library is libmyboost_regex.*.
Likely cause
In the modular (1.90) layout the library target is declared in
libs/regex/build/Jamfile.v2. bcp's library-prefix renaming logic does not
appear to rewrite the lib <name> target declaration in these modular build
Jamfiles.
- Dominant language
- C++
- Stars
- 23
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/bcp
-
Could not use custom namespace on Boost 1.89.0: Unable to find file or target named boost_align Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·