Commit Graph

19 Commits

Author SHA1 Message Date
Jan Kundrát
be917803d9 CI: adapt to github changes for ::set-output
Bug: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
2023-02-05 00:14:14 +01:00
Jan Kundrát
6507fa5138 Build for Python 3.11 as well
On Windows and OS X, this simply adds a bunch of extra builds. On Linux,
I'm also bumping the manylinux tag because Python 3.11 is newer than the
distro in question. This means that there will be no builds for "new
Python on old distros" because one has to draw a line somewhere.
Effectively, wheels for Linux Python 3.11 will therefore require glibc
2.35.
2023-02-04 22:58:46 +01:00
Jan Kundrát
54489cea62 Use pybind11 from PIP
I don't have the details about why exactly that version of pybind11 on
Ubuntu 20.04 broke down, but here's how it ended up on Ubuntu 22.04 when
trying to use Python 3.11:

 In file included from /usr/include/pybind11/cast.h:16,
                  from /usr/include/pybind11/attr.h:13,
                  from /usr/include/pybind11/pybind11.h:13,
                  from /usr/include/pybind11/functional.h:12,
                  from /home/runner/work/oopt-gnpy-libyang/oopt-gnpy-libyang/oopt-gnpy-libyang.cpp:1:
 /usr/include/pybind11/detail/type_caster_base.h: In function ‘std::string pybind11::detail::error_string()’:
 /usr/include/pybind11/detail/type_caster_base.h:482:26: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
   482 |             frame = frame->f_back;
       |                          ^~
 In file included from /opt/hostedtoolcache/Python/3.11.1/x64/include/python3.11/Python.h:42,
                  from /usr/include/pybind11/detail/common.h:215,
                  from /usr/include/pybind11/pytypes.h:12,
                  from /usr/include/pybind11/cast.h:13,
                  from /usr/include/pybind11/attr.h:13,
                  from /usr/include/pybind11/pybind11.h:13,
                  from /usr/include/pybind11/functional.h:12,
                  from /home/runner/work/oopt-gnpy-libyang/oopt-gnpy-libyang/oopt-gnpy-libyang.cpp:1:
 /opt/hostedtoolcache/Python/3.11.1/x64/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
    22 | typedef struct _frame PyFrameObject;
       |                ^~~~~~

On Windows, it failed because (apparently) vcpkg patches Python
detection as per https://github.com/microsoft/vcpkg/issues/23796. The
build would fail like this (vcpkg Pytohn is 3.10, the system-selected
one is 3.11):

 CMake Error at C:/t/build-env-1a5f954n/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
   Could NOT find Python (missing: Development.Module) (found suitable version
   "3.11.1", minimum required is "3.8")
 Call Stack (most recent call first):
   C:/t/build-env-1a5f954n/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
   C:/t/build-env-1a5f954n/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPython/Support.cmake:3245 (find_package_handle_standard_args)
   C:/t/build-env-1a5f954n/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/FindPython.cmake:519 (include)

So let's just use the PIP magic and hope for the best.
2023-02-04 22:58:46 +01:00
Jan Kundrát
18a4fd67e3 Sync with libyang upstream 2023-02-03 15:18:44 +01:00
Jan Kundrát
3f7ea31282 CI: Windows: use short temp paths
TL;DR: the path limit strikes again

The build infrastructure produces excessively long path names, and our
wonderful combination of pypa-build -> cmake -> MSVC chokes on them on a
spectacular fashion even though the runner image already has that
long-path-name support set in the registry:

 -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe
 -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe - broken
 CMake Error at C:/Users/runneradmin/AppData/Local/Temp/build-env-b5qtu_yx/Lib/site-packages/cmake/data/share/cmake-3.25/Modules/CMakeTestCXXCompiler.cmake:63 (message):
   The C++ compiler

     "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.34.31933/bin/Hostx64/x64/cl.exe"

   is not able to compile a simple test program.

   It fails with the following output:

     Change Dir: C:/Users/runneradmin/AppData/Local/Temp/build-via-sdist-nzuhfzad/oopt-gnpy-libyang-0.0.5.dev5+g470406b/build/temp.win-amd64-cpython-310/Release/oopt_gnpy_libyang/CMakeFiles/CMakeScratch/TryCompile-5bq90s

     Run Build Command(s):C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/amd64/MSBuild.exe cmTC_1c273.vcxproj /p:Configuration=Debug /p:Platform=x64 /p:VisualStudioVersion=17.0 /v:m && MSBuild version 17.4.1+9a89d02ff for .NET Framework
 -- Configuring incomplete, errors occurred!
       Microsoft (R) C/C++ Optimizing Compiler Version 19.34.31937 for x64
 See also "C:/Users/runneradmin/AppData/Local/Temp/build-via-sdist-nzuhfzad/oopt-gnpy-libyang-0.0.5.dev5+g470406b/build/temp.win-amd64-cpython-310/Release/oopt_gnpy_libyang/CMakeFiles/CMakeOutput.log".
       Copyright (C) Microsoft Corporation.  All rights reserved.
 See also "C:/Users/runneradmin/AppData/Local/Temp/build-via-sdist-nzuhfzad/oopt-gnpy-libyang-0.0.5.dev5+g470406b/build/temp.win-amd64-cpython-310/Release/oopt_gnpy_libyang/CMakeFiles/CMakeError.log".
       testCXXCompiler.cxx
       cl /c /Zi /W3 /WX- /diagnostics:column /Od /Ob0 /D _MBCS /D WIN32 /D _WINDOWS /D "CMAKE_INTDIR=\"Debug\"" /Gm- /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR /Fo"cmTC_1c273.dir\Debug\\" /Fd"cmTC_1c273.dir\Debug\vc143.pdb" /external:W3 /Gd /TP /wd4251 /wd4275 /errorReport:queue "C:\Users\runneradmin\AppData\Local\Temp\build-via-sdist-nzuhfzad\oopt-gnpy-libyang-0.0.5.dev5+g470406b\build\temp.win-amd64-cpython-310\Release\oopt_gnpy_libyang\CMakeFiles\CMakeScratch\TryCompile-5bq90s\testCXXCompiler.cxx"
     FileTracker : error FTK1011: could not create the new file tracking log file: C:\Users\runneradmin\AppData\Local\Temp\build-via-sdist-nzuhfzad\oopt-gnpy-libyang-0.0.5.dev5+g470406b\build\temp.win-amd64-cpython-310\Release\oopt_gnpy_libyang\CMakeFiles\CMakeScratch\TryCompile-5bq90s\cmTC_1c273.dir\Debug\cmTC_1c273.tlog\link-rc.read.1.tlog. The system cannot find the path specified. [C:\Users\runneradmin\AppData\Local\Temp\build-via-sdist-nzuhfzad\oopt-gnpy-libyang-0.0.5.dev5+g470406b\build\temp.win-amd64-cpython-310\Release\oopt_gnpy_libyang\CMakeFiles\CMakeScratch\TryCompile-5bq90s\cmTC_1c273.vcxproj]

Just look at the beauty of the generated path. Let me break it down into
easily digestible chunks. First of all, this is the global temporary
directory as set by the GitHub environment:

 C:\Users\runneradmin\AppData\Local\Temp\

40 characters, thank you. Let's add some unique temp thingy for the build:

 build-via-sdist-nzuhfzad\

25 characters, 16 of which are useless. OK.

 oopt-gnpy-libyang-0.0.5.dev5+g470406b\

38 characters for the package name and version. We have a long package name.

 build\temp.win-amd64-cpython-310\Release\

41 useless characters indicating that this is a build (as if we didn't
know from path part #2). Let's also stick in some random info about
platform type, Python type and its version because nothing can happen,
right?

 oopt_gnpy_libyang\

18 extra characters in case the project name changed compared from path
chunk #3.

 CMakeFiles\CMakeScratch\TryCompile-5bq90s\cmTC_1c273.dir\Debug\

CMake to the rescue, 63 characters for guaranteeing that this is a
frakin' unique path.

 cmTC_1c273.tlog\link-rc.read.1.tlog

At this point MSVC adds meek 35 characters which once again are not a
big deal, right?
2023-02-03 15:18:44 +01:00
Jan Kundrát
5346e705d3 CI: GitHub: upgrade Node.js 12 actions 2023-02-03 15:18:44 +01:00
Jan Kundrát
d99190f9f4 CI: Windows: use upstream vcpkg
Our fixes for pybind11 are no longer needed because they already updated
to a fixed version.
2023-02-03 15:18:44 +01:00
Jan Kundrát
777133fd9c CI: pin auditwheel so that it works on Ubuntu 20.04
...which we require because we want the oldest possible one which can
still build that C++ code, because we want a generic manylinux tag.
2023-02-03 15:18:44 +01:00
Jan Kundrát
4f1c735a3d Fix EOL issues on Windows 2022-07-08 00:22:59 +02:00
Jan Kundrát
8aa33f3020 Windows: test the wheel on Windows 2019 as well
...just to make sure that our bundling of libraries and what not works
correctly.
2022-07-07 16:04:07 +02:00
Jan Kundrát
d7a8a7bbe9 Mac OS builds
Apple clang is too randomly broken (no operator<=> for std::string,
seriously?), so this needs GCC.

Also, there were some non-fatal warnings about a mismatch of "deployment
target", so I figured out that I probably need to use the latest and
greatest to limit the blast size when stuff breaks. Fingers crossed;
these blind builds really take a leap of faith. But the resulting
CPython module loads successfully, so I suppose this might actually
work?

Since Apple clang is not enough and the bundled GCC is not a
cross-compiler (and I don't really feel like bootstrapping one today),
we cannot build arm64 binaries on Mac OS yet. But the Python version
that is driving this build is the `universal2` fat binary thingy, and
due to pypa/wheel#406 and/or pypa/setuptools#2520, this required another
fair amount of hoop jumping. Finally, the BSD-ish userland comes with
its set of peculiarities.
2022-07-02 23:28:13 +02:00
Jan Kundrát
006c015337 CI: die if no wheels are produced
Why is this not the default?
2022-07-01 02:13:10 +02:00
Jan Kundrát
3a458f2318 Python bindings: just enough to validate some YANG data 2022-07-01 00:52:53 +02:00
Jan Kundrát
c77d87c9fd cache: vcpkg: sync just the installed bits 2022-06-30 08:30:34 +02:00
Jan Kundrát
e54f5d9b5e Fix pybind11 and vcpkg from microsoft/vcpkg@25467 2022-06-29 22:53:05 +02:00
Jan Kundrát
3ab0f5d9b8 Build on Ubuntu 20.04 as well 2022-06-29 22:47:16 +02:00
Jan Kundrát
b62617afd3 CI: explain why Ubuntu 20.04 is not supported
While that one has a bigger chance of producing binaries which work
on older systems, it has doctest 2.3.6, whereas upstream libyang-cpp
needs doctest 2.4.6.
2022-06-28 16:05:03 +02:00
Jan Kundrát
b873ced70b CI: Build on Linux as well 2022-06-25 23:35:45 +02:00
Jan Kundrát
f9b323b126 Building libyang and libyang-cpp on Windows
Since we have full control over the whole build stack (do we, when it
comes to Python?), it's safe to disable MSVC warnings about exporting
symbols from a DLL which are inherited from a non-exported type (or have
members which are of a non-exported type).
2022-06-16 20:15:34 +02:00