From boris at codesynthesis.com Mon Mar 1 09:49:55 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon, 1 Mar 2021 11:49:55 +0200 Subject: [build2] Upcoming Repository Certificate Replacement Message-ID: Both cppget.org and stage.build2.org package repository certificates will be replaced with renewed versions on Tue the 9th of Mar 2021 at 12pm UTC. This will result in the change of certificate fingerprints. If you have these fingerprints specified as part of the trust values in your project's repositories.manifest files or --trust option values in bpkg or build2 toolchain install script invocations, then you will need to update any such places with new fingerprints. For details, see: https://build2.org/blog/repo-cert-replacement.xhtml The new fingerprints (old fingerprints are shown for reference): cppget.org: new: 70:64:FE:E4:E0:F3:60:F1:B4:51:E1:FA:12:5C:E0:B3:DB:DF:96:33:39:B9:2E:E5:C2:68:63:4C:A6:47:39:43 old: 86:BA:D4:DE:2C:87:1A:EE:38:C7:F1:64:7F:65:77:02:15:79:F3:C4:83:C0:AB:5A:EA:F4:F7:8C:1D:63:30:C6 stage.build2.org: new: EC:50:13:E2:3D:F7:92:B4:50:0B:BF:2A:1F:7D:31:04:C6:57:6F:BC:BE:04:2E:E0:58:14:FA:66:66:21:1F:14 old: 37:CE:2C:A5:1D:CF:93:81:D7:07:46:AD:66:B3:C3:90:83:B8:96:9E:34:F0:E7:B3:A2:B0:6C:EF:66:A4:BE:65 From Breakspot at outlook.com Fri Mar 19 09:26:19 2021 From: Breakspot at outlook.com (breakspot reyes) Date: Fri, 19 Mar 2021 09:26:19 +0000 Subject: [build2] C++20 Message-ID: <8DF8ECAA-A286-4E1A-9EC2-6FA67B57A4DE@outlook.com> Hi, Im having issues compiling modules, error: header file cannot be imported because it is not known to be a header unit import ; How can start using modules, I already update it to build2-toolchain-0.14-a.0 From boris at codesynthesis.com Fri Mar 19 14:26:12 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri, 19 Mar 2021 16:26:12 +0200 Subject: [build2] C++20 In-Reply-To: <8DF8ECAA-A286-4E1A-9EC2-6FA67B57A4DE@outlook.com> References: <8DF8ECAA-A286-4E1A-9EC2-6FA67B57A4DE@outlook.com> Message-ID: breakspot reyes via users writes: > Im having issues compiling modules, error: header file cannot > be imported because it is not known to be a header unit > import ; You will need to me more specific: which compiler/version you are using, whether you have enabled modules support in your project, etc. Currently, your best modules-wise is GCC master. See this recent announcement for details: https://build2.org/blog/build2-cxx20-modules-gcc.xhtml For example of build2 projects that use modules, see this repository: https://github.com/build2/cxx20-modules-examples/ From Breakspot at outlook.com Fri Mar 19 21:36:41 2021 From: Breakspot at outlook.com (breakspot reyes) Date: Fri, 19 Mar 2021 21:36:41 +0000 Subject: [build2] C++20 In-Reply-To: References: <8DF8ECAA-A286-4E1A-9EC2-6FA67B57A4DE@outlook.com> Message-ID: <7FB8B8CC-C19F-498C-B1A0-5568B1D74E3E@outlook.com> I already using those projects,Do I need gcc 11? Branch devel/c++-modules?(repository) > On Mar 19, 2021, at 7:26 AM, Boris Kolpackov wrote: > > breakspot reyes via users writes: > >> Im having issues compiling modules, error: header file cannot >> be imported because it is not known to be a header unit >> import ; > > You will need to me more specific: which compiler/version you are > using, whether you have enabled modules support in your project, > etc. > > Currently, your best modules-wise is GCC master. See this recent > announcement for details: > > https://build2.org/blog/build2-cxx20-modules-gcc.xhtml > > For example of build2 projects that use modules, see this repository: > > https://github.com/build2/cxx20-modules-examples/ From markus.pawellek at mailbox.org Mon Mar 22 15:53:38 2021 From: markus.pawellek at mailbox.org (Markus Pawellek) Date: Mon, 22 Mar 2021 16:53:38 +0100 (CET) Subject: [build2] Python Wrapper with Pybind11, Calling Python, and Renaming Libraries Message-ID: <1529405875.56821.1616428418193@office.mailbox.org> Hello, a few weeks ago, I have created a Python wrapper in Pybind11 for a C++ test library built by the build2 build system. The code and a small explanation can be found here: https://github.com/lyrahgames/build2-pybind11-pip-test Two problems had to be solved. To be able to compile a shared library which can be used by Python, one needs to access environment variables of the currently used Python environment. This can easily be done by calling the used Python executable on the command line with certain parameters and saving its output in appropriate configuration variables. In build2 alone, this seemed not to be possible for me and therefore I have introduced another layer of indirection by using a Makefile. The Makefile then calls the Python executable and bdep to set the configuration variables. Afterwards the project can be built by build2 and installed by Pip. Is there a way to call the Python executable from inside build2 and use its output directly to set some configuration variables? Furthermore, shared libraries that can be called by Python use a different naming scheme and extension than typical shared libraries. There was no possibility of changing the suffix or naming scheme of a library target. Therefore I have defined a new file type with the appropriate requirements and copied libraries to the new type by using inline build recipes with cp. Is there a better way of renaming libraries? Greetings Markus From boris at codesynthesis.com Tue Mar 23 10:56:46 2021 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue, 23 Mar 2021 12:56:46 +0200 Subject: [build2] Python Wrapper with Pybind11, Calling Python, and Renaming Libraries In-Reply-To: <1529405875.56821.1616428418193@office.mailbox.org> References: <1529405875.56821.1616428418193@office.mailbox.org> Message-ID: Markus Pawellek via users writes: > To be able to compile a shared library which can be used by Python, > one needs to access environment variables > of the currently used Python environment. > This can easily be done by calling the used Python executable > on the command line with certain parameters > and saving its output in appropriate configuration variables. > In build2 alone, this seemed not to be possible for me > and therefore I have introduced another layer of indirection by using a Makefile. > The Makefile then calls the Python executable > and bdep to set the configuration variables. > Afterwards the project can be built by build2 and installed by Pip. > Is there a way to call the Python executable from inside build2 > and use its output directly to set some configuration variables? There are the $process.run()[1] and $process.run_regex()[2] functions that I think should allow you to achieve what you want. We use[3] the former in ODB for something similar (extract the GCC plugin directory). In your case I would probably use the extracted values as defaults for the relevant config.pxart_python.* variables. > Furthermore, shared libraries that can be called by Python > use a different naming scheme and extension than typical shared libraries. > There was no possibility of changing > the suffix or naming scheme of a library target. > Therefore I have defined a new file type with the appropriate requirements > and copied libraries to the new type by using inline build recipes with cp. > Is there a better way of renaming libraries? Yes, turns out we again do something similar in ODB[4]. In your case it could look along these lines: define pylib: libs pylib{*}: { extension = ($cxx.target.class == 'windows' ? pyd : so) bin.lib.prefix = # No lib prefix. backlink = true # Backlink in forwarded configs. } pylib{hello}: {hxx ixx txx cxx}{**} Note that since pylib{} is derived from libs{}, the standard link rule will match and build it. [1] https://github.com/build2/build2/blob/master/libbuild2/functions-process.cxx#L413 [2] https://github.com/build2/build2/blob/master/libbuild2/functions-process.cxx#L429 [3] https://git.codesynthesis.com/cgit/odb/odb/tree/build/root.build#n19 [4] https://git.codesynthesis.com/cgit/odb/odb/tree/odb/buildfile#n4