Repository: conan-io/conan-center-index

Issue:
[package] b2/4.9.3: Can't build with clang without g++
### Description

I'm trying to build b2 in Docker that doesn't have g++. It fails.

### Package and Environment Details

* Package Name/Version: **b2/4.9.3**
* Operating System+version: **Debian Bullseye**
* Compiler+version: **Debian clang version 11.0.1-2**
* Docker image: ****
* Conan version: **conan 1.54.0**
* Python version: **Python 3.9.2**

Dockerfile:
```
FROM debian:bullseye-20221114-slim
RUN echo 'deb http://deb.debian.org/debian bullseye-backports main' > /etc/apt/sources.list.d/backports.list
RUN apt-get update && \
    apt-get install -y --no-install-recommends -t bullseye-backports \
        cmake \
    && \
    apt-get -y --no-install-recommends install \
        clang=1:11.0-51+nmu5 \
        make=4.3-4.1 \
        patch=2.7.6-7 \
        perl=5.32.1-4+deb11u2 \
        python3=3.9.2-3 \
        python3-pip=20.3.4-4+deb11u1 \
        ca-certificates=20210119 \
    && \
    python3 -m pip install --no-cache-dir --upgrade conan==1.54.0
```


### Conan profile

[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=clang
compiler.version=11
compiler.libcxx=libstdc++11
compiler.cppstd=17
build_type=Release
[options]
b2:toolset=clang
[conf]
[build_requires]
[env]

### Steps to reproduce

conan install -r conancenter b2/4.9.3@ -pr:b=default -pr:h=default --build=b2

### Logs

<details><summary>Click to expand log</summary>

```
Configuration (profile_host):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=clang
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
os_build=Linux
[options]
b2:toolset=clang
[build_requires]
[env]

Configuration (profile_build):
[settings]
arch=x86_64
arch_build=x86_64
build_type=Release
compiler=clang
compiler.cppstd=17
compiler.libcxx=libstdc++11
compiler.version=11
os=Linux
os_build=Linux
[options]
b2:toolset=clang
[build_requires]
[env]

b2/4.9.3: Forced build from source
Installing package: b2/4.9.3
Requirements
    b2/4.9.3 from 'conancenter' - Cache
Packages
    b2/4.9.3:4db1be536558d833e52e862fd84d64d75c2b3656 - Build

Installing (downloading, building) binaries...
b2/4.9.3: WARN: Build folder is dirty, removing it: /root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656
b2/4.9.3: Copying sources to build folder
b2/4.9.3: Building your package in /root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656
b2/4.9.3: Generator txt created conanbuildinfo.txt
b2/4.9.3: Aggregating env generators
b2/4.9.3: Calling build()
b2/4.9.3: Build engine..

###
###
### Using 'clang' toolset.
###
###

Debian clang version 11.0.1-2
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

###
###

> clang++ -x c++ -std=c++11 -O3 -s -DNDEBUG builtins.cpp class.cpp command.cpp compile.cpp constants.cpp cwd.cpp debug.cpp debugger.cpp execcmd.cpp execnt.cpp execunix.cpp filesys.cpp filent.cpp fileunix.cpp frames.cpp function.cpp glob.cpp hash.cpp hcache.cpp hdrmacro.cpp headers.cpp jam_strings.cpp jam.cpp jamgram.cpp lists.cpp make.cpp make1.cpp md5.cpp mem.cpp modules.cpp native.cpp object.cpp option.cpp output.cpp parse.cpp pathnt.cpp pathsys.cpp pathunix.cpp regexp.cpp rules.cpp scan.cpp search.cpp startup.cpp subst.cpp sysinfo.cpp timestamp.cpp variable.cpp w32_getreg.cpp modules/order.cpp modules/path.cpp modules/property-set.cpp modules/regex.cpp modules/sequence.cpp modules/set.cpp -o b2
b2/4.9.3: Install..
Jamroot.jam:107: in modules.load from module Jamfile</root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root>
warning: Bison generator program 'bison' not found. Skipping grammar build.
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/build/project.jam:372: in load-jamfile from module project
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/build/project.jam:64: in load from module project
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/build/project.jam:142: in project.find from module project
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/build-system.jam:618: in load from module build-system
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/kernel/modules.jam:294: in import from module modules
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/kernel/bootstrap.jam:135: in module scope from module
warning: No toolsets are configured.
warning: Configuring default toolset "gcc".
warning: If the default is wrong, your build may not work correctly.
warning: Use the "toolset=xxxxx" option to override our guess.
warning: For more configuration options, please consult
warning: https://www.bfgroup.xyz/b2/manual/release/index.html#bbv2.overview.configuration
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/tools/common.jam:1152: in common.find-compiler from module common
error: toolset gcc initialization:
error: no command provided, default command 'g++' not found
error: initialized from
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/tools/gcc.jam:165: in gcc.init from module gcc
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/build/toolset.jam:44: in toolset.using from module toolset
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/build-system.jam:658: in load from module build-system
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/kernel/modules.jam:294: in import from module modules
/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/kernel/bootstrap.jam:135: in module scope from module

b2/4.9.3:
b2/4.9.3: ERROR: Package '4db1be536558d833e52e862fd84d64d75c2b3656' build failed
b2/4.9.3: WARN: Build folder /root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/build
ERROR: b2/4.9.3: Error in build() method, line 151
        self.run(full_command)
        ConanException: Error 1 while executing /root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/root/src/engine/b2 --ignore-site-config --prefix=/root/.conan/data/b2/4.9.3/_/_/build/4db1be536558d833e52e862fd84d64d75c2b3656/build/output --abbreviate-paths install b2-install-layout=portable
```

</details>



Discussion:
Just checked - previous revision works
conan install -r conancenter "b2/4.9.3@#d3af356ab5b4102bb1b0722aff1f0bde" -pr:b=default -pr:h=default --build=b2

So problem appears somewhere in #13758

Resolving patch:
diff --git a/recipes/b2/portable/conanfile.py b/recipes/b2/portable/conanfile.py
--- a/recipes/b2/portable/conanfile.py
+++ b/recipes/b2/portable/conanfile.py
@@ -141,6 +141,8 @@ def build(self):
         self.output.info("Install..")
         command = os.path.join(
             self._b2_engine_dir, "b2.exe" if use_windows_commands else "b2")
+        if b2_toolset not in ["auto", "cxx", "cross-cxx"]:
+            command += " toolset=" + str(b2_toolset)
         full_command = \
             ("{0} --ignore-site-config " +
              "--prefix={1} " +


Test patch: