-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Join forces? #18
Comments
Certainly happy for the help. Please make an issue to request adding yourself to the maintainer team. The biggest thing that would help is refactoring this to generate multiple As to language-specific binding As to tracking development upstreams: this is possible, but typically is done on a case-by-case basis, on a separate, long-running branch, and with a custom |
Some links missing from the above: |
Thanks for the supportive feedback. I hope to fix the Windows building issue first. Then I'll come back here and see whether we can deal with the three issues. With some luck we each understand the other half of the problem 😄 Might take some time (read, possibly weeks). |
To answer this: "half". Building the Prolog extension is part of the rather involved Prolog build process. Building as a Python package it is a stand-alone git submodule of the SWI-Prolog repo that is built using pip and |
|
That is available for each SWI-Prolog release. Not for the Python interface alone, but of course that can be created. |
Sorry for the delay. Working on install scripts is not really my favorite, in particular on Windows where each build takes 16 minutes ... Anyway, at https://github.com/SWI-Prolog/swi-prolog-feedstock is now my recipe that works on Linux, MacOS (tested arm64 only) and Windows using VS2022. That is, it produces a complete SWI-Prolog environment with bi-directional integration to Python. I won't say it is a good feedstock (it is not), but SWI-Prolog received the changes needed to make this works smoothly and the feedstock contains all dependencies. Some remarks
And then we have the issues of outputs, channel_targets and abi_migration_branches. Can someone make a proposal for that? Roughly, we have
|
On the main, I'd just start a pull request to conda-forge once the tarball is available. It could even start with just
Yep, hard block on that.
If the compiled thing is an entirely standalone binary, then yes. If it links against python/numpy/gdal/etc, then no, I don't believe so. It's also possible to have variants that use multiple compilers, but takes rather a lot of work. I am also not an expert on these topics, and this should likely be raised to (pared down) version of that question on gitter to get a current ruling, as i can't find the docs for it.
Optional dependencies aren't really a thing in The original design of If they aren't linked in as binaries, such extra outputs can be pretty "dumb" metapackages, that just gather
Not sure what scale this is relevant: independently-packaged extensions, or extensions created through this recipe? Either way, if possible they should just be separate packages. Indeed, if the python side of the house can be built independently, it can be whole separate recipe. |
Thanks. I guess we can simply disable the tests for osx/m*? Packaging and dependencies is still somewhat unclear to me. Let me try to describe. The core system comes with a number of optional extensions, some of which have serious external dependencies. The build process for these dependencies is pretty much wired into the CMake build infrastructure though. I think I understand I could use one build project and then use multiple output sections that create multiple Conda packages, each with its own runtime requirements? That would be pretty close to what is done for the Debian packages. Is it possible to trigger an action on installing or removing such a package? The current system maintains a single library index file that needs to be rebuilt after adding or removing extensions. For embedding Python into Prolog, this is just one of the extensions as mentioned above. The Python package to embed Prolog can be build as an independent package from its own source. This requires a tarball from one of the git submodules. Is the best option to distribute that to PyPi as a pip package first? |
generally tests (or even built binaries) are never executed for cross-compiled-under-emulation artifacts.
yes, as long as the thing-under-test at the lowest level thing (e.g. There are a number of syntax helpers for making sure these end up with a robustly-solveable packaging. In the "one-true-build" pattern, where a build:
script: # all the main complexity here
requirements:
build:
- {{ compiler('c') }}
# whatever else
host:
- python # this gets expanded in the ci matrix
outputs:
- name: swi-prolog-base
script: move-files.sh
dependencies:
run: # ...
test:
commands:
- swi-prolog --version
- name: swi-prolog-python-inside-prolog
script: move-files.sh
dependencies:
run:
- python # will be magically pinned
- {{ pin_subpackage('swi-prolog-base', exact=True) }}
test:
commands:
- swi-prolog-but-using-python-somehow
- name: swi-prolog-prolog-inside-python
script: move-files.sh
dependencies:
run:
- python # will be magically pinned
- {{ pin_subpackage('swi-prolog-base', exact=True) }}
test:
imports:
- swi_prolog_inside_python
commands:
- pip check # ensure any _other_ python deps aren't screwed up
- swi-prolog-but-using-python-somehow --version
requires:
- pip
# the 12 days of swi-prolog...
- name: swi-prolog-and-a-pear-tree
dependencies:
run:
- python
- {{ pin_subpackage('swi-prolog-base', exact=True) }}
- {{ pin_subpackage('swi-prolog-python-inside-prolog', exact=True) }}
- {{ pin_subpackage('swi-prolog-prolog-inside-python', exact=True) }}
no git checkouts or submodules will be used in conda-forge CI. this is not my call. the biggest win is to have upstream CI build and upload a "fat" tarball as part of CI release (not git(hub|lab) workflow artifact, which don't get real URLs) process. ideally, the release artifacts also includes a
if this builds against
yes, canonical source upstreams separate from forge URLs are always a win. this can take some heat off building the main "platform" package, where CI timeout possibility is very real. In the case of PyPI: a Everyhting that can be a separate feedstock is a win, even if they are built from the same upstream fat tarball.... unless the above |
Thanks. I think I get the idea 😄 The arm64 version could be a real problem if the system is created using cross-compilation. Several parts of the build process run Prolog itself. The build system supports two routes for cross compilation. The simple route is if there is an emulator to run the binary (e.g., Wine for cross-compilation for Windows on Linux). The complicated route is to also generate a compatible native Prolog in the same CMake build tree and use the native executable to run the Prolog steps of the build. I think we should skip that for now ... I'll first look into avoiding shared index files that complicate adding and removing extensions. That would also simplify various Linux distributions. Next, give the outputs thing a try. More will follow ... |
Sorry for the delay. I did the rewrites to make generate sub-packages and combining them easier. The current result is at https://github.com/SWI-Prolog/swi-prolog-feedstock/tree/outputs Currently only works on Linux. I'll take care of the porting after we get the structure right for Linux. I should have re-read your skeleton more carefully as I see you can use a single move-files.sh and make it work depending on the package name. I now use one per output and use a Python script to avoid having to write Windows and non-Windows versions. Conda complains on these Python scripts though using
for this file type I use the CMake components to create the packages. That works nice, but I think it is using the host As is, I have no tests. I'll figure out a way to do this cleanly. I did add a
Thanks --- Jan |
Not sure about the warnings, but presumably they are there for a reason... can't say for sure. A relatively useful approach is to include
I don't know. Some environment detection and rewriting may not be correct, and, as mentioned above, it may not be using the correct
Ensure that
Haven't looked: would start a (draft) PR against this repo so that there can be line-by-line discussion rather than telephone. Here is an https://github.com/conda-forge/swi-prolog-feedstock/tree/experimental
Other than the |
Over on #20, the bot is starting to find |
Actually, on second thought/build that failed, so will not merge that (or go digging much further) and await some discussion here. |
Comment:
Hi Team,
I'm the lead developer of SWI-Prolog. Possibly you are ware that SWI-Prolog has a new Python interface called "Janus". Given that, we want an easy way to get Python, SWI-Prolog and Janus in its two incarnations (as a Prolog library to embed Python and as a Python package to embed Prolog) installed everywhere. As is, the Prolog build picks up Python when the embedding headers and library are found. Pip may be used to build Janus (named
janus_swi
to avoid ambiguities with an existing package as well as Janus for XSB Prolog) as a Python package on Linux, MacOS and Windows (using MSVC).Conda came to mind and I started a feedstock. You can find that at https://github.com/SWI-Prolog/swi-prolog-feedstock
Today I was happy to find this repo. My aim is to come to a recipe that supports at least Linux, MacOS and Windows. Linux and MacOS are working, Windows somehow stalls during the build.
Are you interested merging my work into this repo? My aim is to make it cross platform, support the new Janus interface and come with regular updates that follow the development branch if this can be achieved with little overhead. My hope is that there is some more knowledge about Conda to help streamlining the feedstock.
The text was updated successfully, but these errors were encountered: