Skip to content

bcp Issue: --namespace renames the namespace but NOT the library target name #27

Description

@vivekkushwaha39

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions