Skip to content

[pybind11/openimageio] Add feature python2#18143

Closed
JackBoosY wants to merge 4 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/18113
Closed

[pybind11/openimageio] Add feature python2#18143
JackBoosY wants to merge 4 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/18113

Conversation

@JackBoosY
Copy link
Copy Markdown
Contributor

Fixes #18113.

@JackBoosY JackBoosY added category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist info:internal labels May 27, 2021
@JackBoosY
Copy link
Copy Markdown
Contributor Author

@akilaln According to our policy, we shouldn't add the conflict features in vcpkg, so this PR will not be accepted.
For your request, you can pull my changes and install pybind11[core,python2] first, then install openimageio[pybind11-2].

Thanks.

@JackBoosY JackBoosY closed this May 31, 2021
@akilaln
Copy link
Copy Markdown

akilaln commented May 31, 2021

On Linux, it is failing while trying to build pybind11 with Python2

sudo ./vcpkg/vcpkg install pybind11[core,python2]:x64-linux
Computing installation plan...
The following packages will be built and installed:
    pybind11[core,python2]:x64-linux -> 2.6.2#1
  * python2[core]:x64-linux -> 2.7.18
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-linux...
Could not locate cached archive: /root/.cache/vcpkg/archives/b2/b24bdec02e7f13d46134568d9c128ec2f989284b.zip
Could not locate cached archive: /root/.cache/vcpkg/archives/ea/ea2f45d39aee14c52ef4b338c0b03ef6d589babd.zip
Starting package 1/2: python2:x64-linux
Building package python2[core]:x64-linux...
-- Using cached /home/alakshminarayanan/test/oiio_test/vcpkg/downloads/Python-2.7.18.tar.xz
-- Cleaning sources at /home/alakshminarayanan/test/oiio_test/vcpkg/buildtrees/python2/src/Python-2-98bb9d6a54.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source /home/alakshminarayanan/test/oiio_test/vcpkg/downloads/Python-2.7.18.tar.xz
-- Applying patch /home/alakshminarayanan/test/oiio_test/vcpkg/ports/python2/001-build-msvc.patch
-- Applying patch /home/alakshminarayanan/test/oiio_test/vcpkg/ports/python2/002-build-msvc.patch
-- Applying patch /home/alakshminarayanan/test/oiio_test/vcpkg/ports/python2/003-build-msvc.patch
-- Applying patch /home/alakshminarayanan/test/oiio_test/vcpkg/ports/python2/004-static-library-msvc.patch
-- Applying patch /home/alakshminarayanan/test/oiio_test/vcpkg/ports/python2/006-static-fix-headers.patch
-- Applying patch /home/alakshminarayanan/test/oiio_test/vcpkg/ports/python2/007-fix-build-path.patch
-- Using source at /home/alakshminarayanan/test/oiio_test/vcpkg/buildtrees/python2/src/Python-2-98bb9d6a54.clean
-- Building /home/alakshminarayanan/test/oiio_test/vcpkg/buildtrees/python2/src/Python-2-98bb9d6a54.clean/PCBuild/pythoncore.vcxproj for Release
CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:105 (message):
    Command failed: msbuild /home/alakshminarayanan/test/oiio_test/vcpkg/buildtrees/python2/src/Python-2-98bb9d6a54.clean/PCBuild/pythoncore.vcxproj /p:Configuration=Release /t:Rebuild /p:Platform=x64 /p:PlatformToolset=external /p:VCPkgLocalAppDataDisabled=true /p:UseIntelMKL=No /p:WindowsTargetPlatformVersion= /p:VcpkgManifestInstall=false /p:VcpkgManifestEnabled=false /m /p:WholeProgramOptimization=false /p:VcpkgEnabled=false
    Working Directory: /home/alakshminarayanan/test/oiio_test/vcpkg/buildtrees/python2/x64-linux-rel
    Error code: No such file or directory
    See logs for more information:

Call Stack (most recent call first):
  scripts/cmake/vcpkg_build_msbuild.cmake:129 (vcpkg_execute_required_process)
  ports/python2/portfile.cmake:55 (vcpkg_build_msbuild)
  scripts/ports.cmake:139 (include)


Error: Building package python2:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `./vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: python2:x64-linux
  Vcpkg version: 2021-05-05-unknownhash

@JackBoosY JackBoosY reopened this Jun 1, 2021
@JackBoosY
Copy link
Copy Markdown
Contributor Author

@akilaln Ahh... python2 not support non-Windows currently.

@JackBoosY
Copy link
Copy Markdown
Contributor Author

@akilaln Please also use #18219 changes.

@akilaln
Copy link
Copy Markdown

akilaln commented Jun 1, 2021

@JackBoosY - Thanks for adding python 2 support for Linux. I was able to successfully build pybind11 with Python2. However when I built OIIO I saw this error

sudo ./vcpkg/vcpkg install openimageio[pybind11-2]:x64-linux

CMake Error at scripts/cmake/vcpkg_execute_required_process.cmake:105 (message):
    Command failed: /home/alakshminarayanan/test/oiio_test/vcpkg/downloads/tools/ninja-1.10.1-linux/ninja install -v
    Working Directory: /home/alakshminarayanan/test/oiio_test/vcpkg/buildtrees/glib/x64-linux-dbg
    Error code: 1
    See logs for more information:
      /home/alakshminarayanan/test/oiio_test/vcpkg/buildtrees/glib/package-x64-linux-dbg-out.log

Call Stack (most recent call first):
  scripts/cmake/vcpkg_install_meson.cmake:58 (vcpkg_execute_required_process)
  ports/glib/portfile.cmake:55 (vcpkg_install_meson)
  scripts/ports.cmake:139 (include)


Error: Building package glib:x64-linux failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `./vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: glib:x64-linux
  Vcpkg version: 2021-05-05-unknownhash

@JackBoosY
Copy link
Copy Markdown
Contributor Author

@akilaln Can you please provide /home/alakshminarayanan/test/oiio_test/vcpkg/buildtrees/glib/package-x64-linux-dbg-out.log?
I can successfully build on my machine.

@akilaln
Copy link
Copy Markdown

akilaln commented Jun 2, 2021

@JackBoosY , Here the output log you requested

package-x64-linux-dbg-out.log

@JackBoosY
Copy link
Copy Markdown
Contributor Author

@akilaln Can you please re-install glib again?

@akilaln
Copy link
Copy Markdown

akilaln commented Jun 2, 2021

@JackBoosY - I tried installing glib vcpkg install glib:x64-linux a few times but no luck. My gcc version is up-to date too. It still fails at the same point.
package-x64-linux-dbg-out.log

@JackBoosY
Copy link
Copy Markdown
Contributor Author

@akilaln It seems you built the dynamic glib library, what else did you modify?

@akilaln
Copy link
Copy Markdown

akilaln commented Jun 3, 2021

@JackBoosY , I didn't make any changes myself. I pulled your changes from #18143 and #18219

@JackBoosY
Copy link
Copy Markdown
Contributor Author

@akilaln I think that's a port bug on master branch, can you please clone a new vcpkg then try to install glib:x64-windows again?

And please provide the configure log /home/alakshminarayanan/test/oiio_test/vcpkg/buildtrees/glib/config-x64-linux-dbg-out.log and /home/alakshminarayanan/test/oiio_test/vcpkg/buildtrees/glib/config-x64-linux-dbg-err.log.

Thanks.

@JackBoosY
Copy link
Copy Markdown
Contributor Author

@Neumann-A Do you know what happened?
Normally, test components should not be compiled, and libresourceplugin belongs to the shared_module of test.
Also I saw -Dbuild_tests=false was added to vcpkg_configure_meson.

@akilaln
Copy link
Copy Markdown

akilaln commented Jun 4, 2021

@JackBoosY , I cloned a fresh vcpkg and tried building glib:x64-linux and got the same error. Here are the logs you requested
config-x64-linux-dbg-out.log

Actually config-x64-linux-dbg-err.log is empty

@UnlawfulMonad
Copy link
Copy Markdown

UnlawfulMonad commented Jun 4, 2021

Hi @JackBoosY I've been working on this with @akilaln . It looks like the error occurs because it's trying to link against a newer version of glibc which has its symbols suffixed with @@2.2.5. I was able to build your patches without any problems on my Fedora 33 system but on CentOS 7, glibc doesn't have that suffix.

As an example, on Fedora I see:

$ objdump -d /lib64/libc.so.6 | grep '\<abort\>' | head
...
000000000002678e <abort@@GLIBC_2.2.5>:
...

While on CentOS 7 I see:

$ objdump -d /lib64/libc.so.6 | grep '\<abort\>' | head
...
0000000000037930 <abort>:
...

If you look at line 712 of the log @akilaln linked, it complains about that symbol (even though the build is occurring on CentOS 7). I'm not sure if I'm digging in the wrong spot and if just disabling the tests would resolve it.

@JackBoosY
Copy link
Copy Markdown
Contributor Author

JackBoosY commented Jun 8, 2021

@UnlawfulMonad Hmm... I don't have a Fedora machine, so I think I should disable the test automatically.

And in fact, test has been declared disabled, but I don't know why it was still activated:

-Dbuild_tests=false
-Dinstalled_tests=false

@JackBoosY JackBoosY closed this Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist invalid

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OpenImageIO] Windows & Linux build with python 2.7 bindings

4 participants