Repository: conan-io/conan-center-index

Issue:
[package] boost/1.72.0: not compile on Windows with shared and python options.
### Package and Environment Details (include every applicable attribute)
  * Package Name/Version: **boost/1.72.0**
  * Operating System+version: **Windows 10**
  * Compiler+version: **MSVC++ v15.9.26**
  * Docker image: **--**
  * Conan version: **conan 1.29.0**
  * Python version: **Python 3.8.5**


### Conan profile (output of `conan profile show default` or `conan profile show <profile>` if custom profile is in use)
```
[settings]
os=Windows
os_build=Windows
arch=x86
arch_build=x86
compiler=Visual Studio
compiler.version=15
build_type=Debug
[options]
[build_requires]
[env]
```


### Steps to reproduce (Include if Applicable)
conanfile.txt:
```
[requires]
boost/1.72.0

[options]
*:python=True
*:fPIC=True
*:without_python=False
boost:shared=True
poco:shared=True
sqlite3:shared=True

[generators]
cmake_find_package
cmake_paths
```

`conan install conanfile.txt -s build_type=Debug --build=missing`

### Logs (Include/Attach if Applicable)
<details><summary>Click to expand log</summary>

```
msvc.link.dll c:\.conan\d32830e\1\boost\bin.v2\libs\python\build\msvc-14.0\dbg\pythn-3.8\thrd-mlt\boost_python38.dll

LINK : fatal error LNK1181: cannot open input file 'python38.lib'



        call "c:\.conan\d32830e\1\boost\bin.v2\standalone\msvc\msvc-14.0\msvc-setup.bat" x86 >nul

 link /NOLOGO /INCREMENTAL:NO /DLL /DEBUG /MACHINE:X86 /MANIFEST /subsystem:console /out:"c:\.conan\d32830e\1\boost\bin.v2\libs\python\build\msvc-14.0\dbg\pythn-3.8\thrd-mlt\boost_python38.dll" /IMPLIB:"c:\.conan\d32830e\1\boost\bin.v2\libs\python\build\msvc-14.0\dbg\pythn-3.8\thrd-mlt\boost_python38.lib" /LIBPATH:"c:\python\libs\python38.lib"   @"c:\.conan\d32830e\1\boost\bin.v2\libs\python\build\msvc-14.0\dbg\pythn-3.8\thrd-mlt\boost_python38.dll.rsp"

        if %ERRORLEVEL% NEQ 0 EXIT %ERRORLEVEL%

    

...failed msvc.link.dll c:\.conan\d32830e\1\boost\bin.v2\libs\python\build\msvc-14.0\dbg\pythn-3.8\thrd-mlt\boost_python38.dll c:\.conan\d32830e\1\boost\bin.v2\libs\python\build\msvc-14.0\dbg\pythn-3.8\thrd-mlt\boost_python38.lib c:\.conan\d32830e\1\boost\bin.v2\libs\python\build\msvc-14.0\dbg\pythn-3.8\thrd-mlt\boost_python38.pdb...

...skipped <pc:\.conan\be9e3b4\1\lib>boost_python38.dll for lack of <pc:\.conan\d32830e\1\boost\bin.v2\libs\python\build\msvc-14.0\dbg\pythn-3.8\thrd-mlt>boost_python38.dll...

...skipped <pc:\.conan\be9e3b4\1\lib>boost_python38.lib for lack of <pc:\.conan\d32830e\1\boost\bin.v2\libs\python\build\msvc-14.0\dbg\pythn-3.8\thrd-mlt>boost_python38.lib...

...skipped <pc:\.conan\d32830e\1\boost\bin.v2\libs\python\build\msvc-14.0\dbg\pythn-3.8\thrd-mlt>libboost_python-variant-shared-py3.8.cmake for lack of <pc:\.conan\d32830e\1\boost\bin.v2\libs\python\build\msvc-14.0\dbg\pythn-3.8\thrd-mlt>boost_python38.lib...
```
</details>

The path to python38.lib is correct but linker does not see it. Everything works after changing LIBPATH to "c:\python\libs". I do this by changing line 343 from:
`return python_lib.replace('\\', '/')`
 to:
`return libdir.replace('\\', '/')`




Discussion:

Resolving patch:
diff --git a/recipes/boost/all/conanfile.py b/recipes/boost/all/conanfile.py
--- a/recipes/boost/all/conanfile.py
+++ b/recipes/boost/all/conanfile.py
@@ -660,7 +660,7 @@ def _python_includes(self):
         raise Exception("couldn't locate Python.h - make sure you have installed python development files")
 
     @property
-    def _python_libraries(self):
+    def _python_library_dir(self):
         """
         attempt to find python development library
         :return: the full path to the python library to be linked with
@@ -702,7 +702,7 @@ def _python_libraries(self):
                 self.output.info("checking {}".format(python_lib))
                 if os.path.isfile(python_lib):
                     self.output.info("found python library: {}".format(python_lib))
-                    return python_lib.replace("\\", "/")
+                    return libdir.replace("\\", "/")
         raise ConanInvalidConfiguration("couldn't locate python libraries - make sure you have installed python development files")
 
     def _clean(self):
@@ -1187,11 +1187,11 @@ def create_library_config(deps_name, name):
 
         if not self.options.without_python:
             # https://www.boost.org/doc/libs/1_70_0/libs/python/doc/html/building/configuring_boost_build.html
-            contents += '\nusing python : {version} : "{executable}" : "{includes}" : "{libraries}" ;'\
+            contents += '\nusing python : {version} : "{executable}" : "{includes}" : "{library_dir}" ;'\
                 .format(version=self._python_version,
                         executable=self._python_executable,
                         includes=self._python_includes,
-                        libraries=self._python_libraries)
+                        library_dir=self._python_library_dir)
 
         if not self.options.without_mpi:
             # https://www.boost.org/doc/libs/1_72_0/doc/html/mpi/getting_started.html


Test patch: