We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[package] thrift/0.13.0: build fails using --profile but works using --profile:host and --profile:build
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **thrift/0.13.0**
  * Operating System+version: **Linux Ubuntu 18.04**
  * Compiler+version: **GCC 7**
  * Conan version: **conan 1.25.2**
  * Python version: **Python 3.6.9**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
Configuration for profile linux-x64:
[settings]
os=Linux
os_build=Linux
arch=x86_64
arch_build=x86_64
compiler=gcc
compiler.version=7
compiler.libcxx=libstdc++11
build_type=Debug
[options]
*:fPIC=True
*:shared=True
[build_requires]
[env]
```


### Steps to reproduce (Include if Applicable)
I have a package that uses _thrift/0.13.0_ as build requirement (thrift compiler) and as normal requirement (thrift libs). When I build and create my package with

```conan create . --profile:host linux-x64 --profile:build linux-x64```

the build works perfectly, the thrift sources are compiled with the thrift compiler. When I  use

```conan create . --profile linux-x64```

the build fails when using the thrift compiler. The difference is that in the first case, the binary directories of all build requirement packages are added to PATH environment during build and in the second case, nothing is added to PATH. The cmake build of my package expects the thrift compiler being in PATH.

I was not sure if this is really a package bug and not a conan bug. Sorry if this was the wrong place.



--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `recipes/thrift/all/conanfile.py`
Content:
```
1 import os
2 from conans import tools, CMake, ConanFile
3 
4 
5 class ConanFileDefault(ConanFile):
6     name = "thrift"
7     description = "Thrift is an associated code generation mechanism for RPC"
8     topics = ("conan", "thrift", "serialization", "rpc")
9     url = "https://github.com/conan-io/conan-center-index"
10     homepage = "https://github.com/apache/thrift"
11     license = "Apache-2.0"
12     exports_sources = ["CMakeLists.txt", "patches/*.diff"]
13     generators = "cmake", "cmake_find_package"
14 
15     settings = "os", "arch", "compiler", "build_type"
16     options = {
17         "shared": [True, False],
18         "fPIC": [True, False],
19         "with_zlib": [True, False],
20         "with_libevent": [True, False],
21         "with_openssl": [True, False],
22         "with_boost_functional": [True, False],
23         "with_boost_smart_ptr": [True, False],
24         "with_boost_static": [True, False],
25         "with_boostthreads": [True, False],
26         "with_stdthreads": [True, False],
27         "with_c_glib": [True, False],
28         "with_cpp": [True, False],
29         "with_java": [True, False],
30         "with_python": [True, False],
31         "with_haskell": [True, False],
32         "with_plugin": [True, False]
33     }
34     default_options = {
35         "shared": False,
36         "fPIC": True,
37         "with_zlib": True,
38         "with_libevent": True,
39         "with_openssl": True,
40         "with_boost_functional": False,
41         "with_boost_smart_ptr": False,
42         "with_boost_static": False,
43         "with_boostthreads": False,
44         "with_stdthreads": True,
45         "with_c_glib": False,
46         "with_cpp": True,
47         "with_java": False,
48         "with_python": False,
49         "with_haskell": False,
50         "with_plugin": False
51     }
52     _source_subfolder = "source_subfolder"
53     _build_subfolder = "build_subfolder"
54 
55     _cmake = None
56 
57     def config_options(self):
58         if self.settings.os == 'Windows':
59             del self.options.fPIC
60 
61     def source(self):
62         tools.get(**self.conan_data["sources"][self.version])
63         extracted_dir = "thrift-" + self.version
64         os.rename(extracted_dir, self._source_subfolder)
65 
66     def build(self):
67         for p in self.conan_data["patches"][self.version]:
68             tools.patch(**p)
69         for f in ["Findflex.cmake", "Findbison.cmake"]:
70             if os.path.isfile(f):
71                 os.unlink(f)
72         cmake = self._configure_cmake()
73         cmake.build()
74 
75     def requirements(self):
76         self.requires("boost/1.73.0")
77         if self.settings.os == 'Windows':
78             self.requires("winflexbison/2.5.22")
79         else:
80             self.requires("flex/2.6.4")
81             self.requires("bison/3.5.3")
82 
83         if self.options.with_openssl:
84             self.requires("openssl/1.1.1g")
85         if self.options.with_zlib:
86             self.requires("zlib/1.2.11")
87         if self.options.with_libevent:
88             self.requires("libevent/2.1.11")
89 
90     def _configure_cmake(self):
91         if self._cmake:
92             return self._cmake
93         self._cmake = CMake(self)
94         for option, value in self.options.items():
95             self._cmake.definitions[option.upper()] = value
96 
97         # Make thrift use correct thread lib (see repo/build/cmake/config.h.in)
98         self._cmake.definitions["USE_STD_THREAD"] = self.options.with_stdthreads
99         self._cmake.definitions["USE_BOOST_THREAD"] = self.options.with_boostthreads
100         self._cmake.definitions["WITH_SHARED_LIB"] = self.options.shared
101         self._cmake.definitions["WITH_STATIC_LIB"] = not self.options.shared
102         self._cmake.definitions["BOOST_ROOT"] = self.deps_cpp_info['boost'].rootpath
103         self._cmake.definitions["BUILD_TESTING"] = False
104         self._cmake.definitions["BUILD_COMPILER"] = True
105         self._cmake.definitions["BUILD_LIBRARIES"] = True
106         self._cmake.definitions["BUILD_EXAMPLES"] = False
107         self._cmake.definitions["BUILD_TUTORIALS"] = False
108 
109         # Make optional libs "findable"
110         if self.options.with_openssl:
111             self._cmake.definitions["OPENSSL_ROOT_DIR"] = self.deps_cpp_info['openssl'].rootpath
112         if self.options.with_zlib:
113             self._cmake.definitions["ZLIB_ROOT"] = self.deps_cpp_info['zlib'].rootpath
114         if self.options.with_libevent:
115             self._cmake.definitions["LIBEVENT_ROOT"] = self.deps_cpp_info['libevent'].rootpath
116 
117         self._cmake.configure(build_folder=self._build_subfolder)
118         return self._cmake
119 
120     def package(self):
121         self.copy(pattern="LICENSE", dst="licenses", src=self._source_subfolder)
122         cmake = self._configure_cmake()
123         cmake.install()
124         # Copy generated headers from build tree
125         build_source_dir = os.path.join(self._build_subfolder, self._source_subfolder)
126         self.copy(pattern="*.h", dst="include", src=build_source_dir, keep_path=True)
127         tools.rmdir(os.path.join(self.package_folder, "lib", "cmake"))
128         tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig"))
129 
130     def package_info(self):
131         self.cpp_info.libs = tools.collect_libs(self)
132         # Make sure libs are link in correct order. Important thing is that libthrift/thrift is last
133         # (a little naive to sort, but libthrift/thrift should end up last since rest of the libs extend it with an abbrevation: 'thriftnb', 'thriftz')
134         # The library that needs symbols must be first, then the library that resolves the symbols should come after.
135         self.cpp_info.libs.sort(reverse = True)
136 
137         if self.settings.os == "Windows":
138             # To avoid error C2589: '(' : illegal token on right side of '::'
139             self.cpp_info.defines.append("NOMINMAX")
140         elif self.settings.os == "Linux":
141             self.cpp_info.system_libs.extend(["m", "pthread"])
142
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/recipes/thrift/all/conanfile.py b/recipes/thrift/all/conanfile.py
--- a/recipes/thrift/all/conanfile.py
+++ b/recipes/thrift/all/conanfile.py
@@ -139,3 +139,7 @@
             self.cpp_info.defines.append("NOMINMAX")
         elif self.settings.os == "Linux":
             self.cpp_info.system_libs.extend(["m", "pthread"])
+
+        bin_path = os.path.join(self.package_folder, "bin")
+        self.output.info("Appending PATH env var with : {}".format(bin_path))
+        self.env_info.PATH.append(bin_path)

{"golden_diff": "diff --git a/recipes/thrift/all/conanfile.py b/recipes/thrift/all/conanfile.py\n--- a/recipes/thrift/all/conanfile.py\n+++ b/recipes/thrift/all/conanfile.py\n@@ -139,3 +139,7 @@\n             self.cpp_info.defines.append(\"NOMINMAX\")\n         elif self.settings.os == \"Linux\":\n             self.cpp_info.system_libs.extend([\"m\", \"pthread\"])\n+\n+        bin_path = os.path.join(self.package_folder, \"bin\")\n+        self.output.info(\"Appending PATH env var with : {}\".format(bin_path))\n+        self.env_info.PATH.append(bin_path)\n", "issue": "[package] thrift/0.13.0: build fails using --profile but works using --profile:host and --profile:build\n### Package and Environment Details (include every applicable attribute)\r\n  * Package Name/Version: **thrift/0.13.0**\r\n  * Operating System+version: **Linux Ubuntu 18.04**\r\n  * Compiler+version: **GCC 7**\r\n  * Conan version: **conan 1.25.2**\r\n  * Python version: **Python 3.6.9**\r\n\r\n\r\n### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)\r\n```\r\nConfiguration for profile linux-x64:\r\n[settings]\r\nos=Linux\r\nos_build=Linux\r\narch=x86_64\r\narch_build=x86_64\r\ncompiler=gcc\r\ncompiler.version=7\r\ncompiler.libcxx=libstdc++11\r\nbuild_type=Debug\r\n[options]\r\n*:fPIC=True\r\n*:shared=True\r\n[build_requires]\r\n[env]\r\n```\r\n\r\n\r\n### Steps to reproduce (Include if Applicable)\r\nI have a package that uses _thrift/0.13.0_ as build requirement (thrift compiler) and as normal requirement (thrift libs). When I build and create my package with\r\n\r\n```conan create . --profile:host linux-x64 --profile:build linux-x64```\r\n\r\nthe build works perfectly, the thrift sources are compiled with the thrift compiler. When I  use\r\n\r\n```conan create . --profile linux-x64```\r\n\r\nthe build fails when using the thrift compiler. The difference is that in the first case, the binary directories of all build requirement packages are added to PATH environment during build and in the second case, nothing is added to PATH. The cmake build of my package expects the thrift compiler being in PATH.\r\n\r\nI was not sure if this is really a package bug and not a conan bug. Sorry if this was the wrong place.\r\n\r\n\n", "before_files": [{"content": "import os\nfrom conans import tools, CMake, ConanFile\n\n\nclass ConanFileDefault(ConanFile):\n    name = \"thrift\"\n    description = \"Thrift is an associated code generation mechanism for RPC\"\n    topics = (\"conan\", \"thrift\", \"serialization\", \"rpc\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/apache/thrift\"\n    license = \"Apache-2.0\"\n    exports_sources = [\"CMakeLists.txt\", \"patches/*.diff\"]\n    generators = \"cmake\", \"cmake_find_package\"\n\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n        \"with_zlib\": [True, False],\n        \"with_libevent\": [True, False],\n        \"with_openssl\": [True, False],\n        \"with_boost_functional\": [True, False],\n        \"with_boost_smart_ptr\": [True, False],\n        \"with_boost_static\": [True, False],\n        \"with_boostthreads\": [True, False],\n        \"with_stdthreads\": [True, False],\n        \"with_c_glib\": [True, False],\n        \"with_cpp\": [True, False],\n        \"with_java\": [True, False],\n        \"with_python\": [True, False],\n        \"with_haskell\": [True, False],\n        \"with_plugin\": [True, False]\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"with_zlib\": True,\n        \"with_libevent\": True,\n        \"with_openssl\": True,\n        \"with_boost_functional\": False,\n        \"with_boost_smart_ptr\": False,\n        \"with_boost_static\": False,\n        \"with_boostthreads\": False,\n        \"with_stdthreads\": True,\n        \"with_c_glib\": False,\n        \"with_cpp\": True,\n        \"with_java\": False,\n        \"with_python\": False,\n        \"with_haskell\": False,\n        \"with_plugin\": False\n    }\n    _source_subfolder = \"source_subfolder\"\n    _build_subfolder = \"build_subfolder\"\n\n    _cmake = None\n\n    def config_options(self):\n        if self.settings.os == 'Windows':\n            del self.options.fPIC\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = \"thrift-\" + self.version\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def build(self):\n        for p in self.conan_data[\"patches\"][self.version]:\n            tools.patch(**p)\n        for f in [\"Findflex.cmake\", \"Findbison.cmake\"]:\n            if os.path.isfile(f):\n                os.unlink(f)\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def requirements(self):\n        self.requires(\"boost/1.73.0\")\n        if self.settings.os == 'Windows':\n            self.requires(\"winflexbison/2.5.22\")\n        else:\n            self.requires(\"flex/2.6.4\")\n            self.requires(\"bison/3.5.3\")\n\n        if self.options.with_openssl:\n            self.requires(\"openssl/1.1.1g\")\n        if self.options.with_zlib:\n            self.requires(\"zlib/1.2.11\")\n        if self.options.with_libevent:\n            self.requires(\"libevent/2.1.11\")\n\n    def _configure_cmake(self):\n        if self._cmake:\n            return self._cmake\n        self._cmake = CMake(self)\n        for option, value in self.options.items():\n            self._cmake.definitions[option.upper()] = value\n\n        # Make thrift use correct thread lib (see repo/build/cmake/config.h.in)\n        self._cmake.definitions[\"USE_STD_THREAD\"] = self.options.with_stdthreads\n        self._cmake.definitions[\"USE_BOOST_THREAD\"] = self.options.with_boostthreads\n        self._cmake.definitions[\"WITH_SHARED_LIB\"] = self.options.shared\n        self._cmake.definitions[\"WITH_STATIC_LIB\"] = not self.options.shared\n        self._cmake.definitions[\"BOOST_ROOT\"] = self.deps_cpp_info['boost'].rootpath\n        self._cmake.definitions[\"BUILD_TESTING\"] = False\n        self._cmake.definitions[\"BUILD_COMPILER\"] = True\n        self._cmake.definitions[\"BUILD_LIBRARIES\"] = True\n        self._cmake.definitions[\"BUILD_EXAMPLES\"] = False\n        self._cmake.definitions[\"BUILD_TUTORIALS\"] = False\n\n        # Make optional libs \"findable\"\n        if self.options.with_openssl:\n            self._cmake.definitions[\"OPENSSL_ROOT_DIR\"] = self.deps_cpp_info['openssl'].rootpath\n        if self.options.with_zlib:\n            self._cmake.definitions[\"ZLIB_ROOT\"] = self.deps_cpp_info['zlib'].rootpath\n        if self.options.with_libevent:\n            self._cmake.definitions[\"LIBEVENT_ROOT\"] = self.deps_cpp_info['libevent'].rootpath\n\n        self._cmake.configure(build_folder=self._build_subfolder)\n        return self._cmake\n\n    def package(self):\n        self.copy(pattern=\"LICENSE\", dst=\"licenses\", src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        # Copy generated headers from build tree\n        build_source_dir = os.path.join(self._build_subfolder, self._source_subfolder)\n        self.copy(pattern=\"*.h\", dst=\"include\", src=build_source_dir, keep_path=True)\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"pkgconfig\"))\n\n    def package_info(self):\n        self.cpp_info.libs = tools.collect_libs(self)\n        # Make sure libs are link in correct order. Important thing is that libthrift/thrift is last\n        # (a little naive to sort, but libthrift/thrift should end up last since rest of the libs extend it with an abbrevation: 'thriftnb', 'thriftz')\n        # The library that needs symbols must be first, then the library that resolves the symbols should come after.\n        self.cpp_info.libs.sort(reverse = True)\n\n        if self.settings.os == \"Windows\":\n            # To avoid error C2589: '(' : illegal token on right side of '::'\n            self.cpp_info.defines.append(\"NOMINMAX\")\n        elif self.settings.os == \"Linux\":\n            self.cpp_info.system_libs.extend([\"m\", \"pthread\"])\n", "path": "recipes/thrift/all/conanfile.py"}], "after_files": [{"content": "import os\nfrom conans import tools, CMake, ConanFile\n\n\nclass ConanFileDefault(ConanFile):\n    name = \"thrift\"\n    description = \"Thrift is an associated code generation mechanism for RPC\"\n    topics = (\"conan\", \"thrift\", \"serialization\", \"rpc\")\n    url = \"https://github.com/conan-io/conan-center-index\"\n    homepage = \"https://github.com/apache/thrift\"\n    license = \"Apache-2.0\"\n    exports_sources = [\"CMakeLists.txt\", \"patches/*.diff\"]\n    generators = \"cmake\", \"cmake_find_package\"\n\n    settings = \"os\", \"arch\", \"compiler\", \"build_type\"\n    options = {\n        \"shared\": [True, False],\n        \"fPIC\": [True, False],\n        \"with_zlib\": [True, False],\n        \"with_libevent\": [True, False],\n        \"with_openssl\": [True, False],\n        \"with_boost_functional\": [True, False],\n        \"with_boost_smart_ptr\": [True, False],\n        \"with_boost_static\": [True, False],\n        \"with_boostthreads\": [True, False],\n        \"with_stdthreads\": [True, False],\n        \"with_c_glib\": [True, False],\n        \"with_cpp\": [True, False],\n        \"with_java\": [True, False],\n        \"with_python\": [True, False],\n        \"with_haskell\": [True, False],\n        \"with_plugin\": [True, False]\n    }\n    default_options = {\n        \"shared\": False,\n        \"fPIC\": True,\n        \"with_zlib\": True,\n        \"with_libevent\": True,\n        \"with_openssl\": True,\n        \"with_boost_functional\": False,\n        \"with_boost_smart_ptr\": False,\n        \"with_boost_static\": False,\n        \"with_boostthreads\": False,\n        \"with_stdthreads\": True,\n        \"with_c_glib\": False,\n        \"with_cpp\": True,\n        \"with_java\": False,\n        \"with_python\": False,\n        \"with_haskell\": False,\n        \"with_plugin\": False\n    }\n    _source_subfolder = \"source_subfolder\"\n    _build_subfolder = \"build_subfolder\"\n\n    _cmake = None\n\n    def config_options(self):\n        if self.settings.os == 'Windows':\n            del self.options.fPIC\n\n    def source(self):\n        tools.get(**self.conan_data[\"sources\"][self.version])\n        extracted_dir = \"thrift-\" + self.version\n        os.rename(extracted_dir, self._source_subfolder)\n\n    def build(self):\n        for p in self.conan_data[\"patches\"][self.version]:\n            tools.patch(**p)\n        for f in [\"Findflex.cmake\", \"Findbison.cmake\"]:\n            if os.path.isfile(f):\n                os.unlink(f)\n        cmake = self._configure_cmake()\n        cmake.build()\n\n    def requirements(self):\n        self.requires(\"boost/1.73.0\")\n        if self.settings.os == 'Windows':\n            self.requires(\"winflexbison/2.5.22\")\n        else:\n            self.requires(\"flex/2.6.4\")\n            self.requires(\"bison/3.5.3\")\n\n        if self.options.with_openssl:\n            self.requires(\"openssl/1.1.1g\")\n        if self.options.with_zlib:\n            self.requires(\"zlib/1.2.11\")\n        if self.options.with_libevent:\n            self.requires(\"libevent/2.1.11\")\n\n    def _configure_cmake(self):\n        if self._cmake:\n            return self._cmake\n        self._cmake = CMake(self)\n        for option, value in self.options.items():\n            self._cmake.definitions[option.upper()] = value\n\n        # Make thrift use correct thread lib (see repo/build/cmake/config.h.in)\n        self._cmake.definitions[\"USE_STD_THREAD\"] = self.options.with_stdthreads\n        self._cmake.definitions[\"USE_BOOST_THREAD\"] = self.options.with_boostthreads\n        self._cmake.definitions[\"WITH_SHARED_LIB\"] = self.options.shared\n        self._cmake.definitions[\"WITH_STATIC_LIB\"] = not self.options.shared\n        self._cmake.definitions[\"BOOST_ROOT\"] = self.deps_cpp_info['boost'].rootpath\n        self._cmake.definitions[\"BUILD_TESTING\"] = False\n        self._cmake.definitions[\"BUILD_COMPILER\"] = True\n        self._cmake.definitions[\"BUILD_LIBRARIES\"] = True\n        self._cmake.definitions[\"BUILD_EXAMPLES\"] = False\n        self._cmake.definitions[\"BUILD_TUTORIALS\"] = False\n\n        # Make optional libs \"findable\"\n        if self.options.with_openssl:\n            self._cmake.definitions[\"OPENSSL_ROOT_DIR\"] = self.deps_cpp_info['openssl'].rootpath\n        if self.options.with_zlib:\n            self._cmake.definitions[\"ZLIB_ROOT\"] = self.deps_cpp_info['zlib'].rootpath\n        if self.options.with_libevent:\n            self._cmake.definitions[\"LIBEVENT_ROOT\"] = self.deps_cpp_info['libevent'].rootpath\n\n        self._cmake.configure(build_folder=self._build_subfolder)\n        return self._cmake\n\n    def package(self):\n        self.copy(pattern=\"LICENSE\", dst=\"licenses\", src=self._source_subfolder)\n        cmake = self._configure_cmake()\n        cmake.install()\n        # Copy generated headers from build tree\n        build_source_dir = os.path.join(self._build_subfolder, self._source_subfolder)\n        self.copy(pattern=\"*.h\", dst=\"include\", src=build_source_dir, keep_path=True)\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"cmake\"))\n        tools.rmdir(os.path.join(self.package_folder, \"lib\", \"pkgconfig\"))\n\n    def package_info(self):\n        self.cpp_info.libs = tools.collect_libs(self)\n        # Make sure libs are link in correct order. Important thing is that libthrift/thrift is last\n        # (a little naive to sort, but libthrift/thrift should end up last since rest of the libs extend it with an abbrevation: 'thriftnb', 'thriftz')\n        # The library that needs symbols must be first, then the library that resolves the symbols should come after.\n        self.cpp_info.libs.sort(reverse = True)\n\n        if self.settings.os == \"Windows\":\n            # To avoid error C2589: '(' : illegal token on right side of '::'\n            self.cpp_info.defines.append(\"NOMINMAX\")\n        elif self.settings.os == \"Linux\":\n            self.cpp_info.system_libs.extend([\"m\", \"pthread\"])\n\n        bin_path = os.path.join(self.package_folder, \"bin\")\n        self.output.info(\"Appending PATH env var with : {}\".format(bin_path))\n        self.env_info.PATH.append(bin_path)\n", "path": "recipes/thrift/all/conanfile.py"}]}