Skip to content
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

[request] Dependencies of PHP (summary issue) #8618

Open
friendlyanon opened this issue Jan 3, 2022 · 18 comments
Open

[request] Dependencies of PHP (summary issue) #8618

friendlyanon opened this issue Jan 3, 2022 · 18 comments

Comments

@friendlyanon
Copy link
Contributor

friendlyanon commented Jan 3, 2022

This is a summary issue tracking progress for dependencies of the php-src runtime of PHP programming language. These are provided on windows.php.net for Windows, but the goal would be to make them build easily on all platforms in a reproducible way.

Not on CCI yet or needs some work

I will keep editing this list as I work through each item. If I got something wrong, then please let me know.

@friendlyanon
Copy link
Contributor Author

Mailing list post: https://externals.io/message/116655#116779

@pierrejoye
Copy link

glib

we do build it shared already for enchant. What is the issue you are experiencing?

libintl

yes, part of gettext

@friendlyanon
Copy link
Contributor Author

friendlyanon commented Jan 3, 2022

What is the issue you are experiencing?

It's an upstream issue.

if self.settings.os == "Windows" and not self.options.shared:
raise ConanInvalidConfiguration(
"glib can not be built as static library on Windows. "
"see https://gitlab.gnome.org/GNOME/glib/-/issues/692"
)

I noticed I wrote shared in the OP, edited.

@pierrejoye
Copy link

pierrejoye commented Jan 3, 2022 via email

@friendlyanon
Copy link
Contributor Author

friendlyanon commented Jan 5, 2022

Okay, so it seems there is a bit of a cyclic dependency going on with Cyrus SASL and OpenLDAP.

The OpenLDAP project has a component called lmdb, which is necessary to build the sasldb plugin for Cyrus SASL and then OpenLDAP depends on Cyrus SASL for full functionality. Upstream Cyrus SASL also seems to be using some weird conan setup and ships VS solutions for Windows in the win32 folder, so that could be used on Windows hopefully.

There is also the ldapdb plugin in Cyrus SASL, which again depends on OpenLDAP and I'm not sure how to deal with that.
It seems that lmdb must be broken out into its own recipe at the very least.

cc @uilianries

Edit: okay, I forgot that lmdb already has a recipe, but I'm still unsure about the plugins.

friendlyanon added a commit to friendlyanon/conan-center-index that referenced this issue Jan 7, 2022
@friendlyanon friendlyanon mentioned this issue Jan 7, 2022
4 tasks
friendlyanon added a commit to friendlyanon/conan-center-index that referenced this issue Jan 7, 2022
@friendlyanon friendlyanon mentioned this issue Jan 7, 2022
4 tasks
@friendlyanon
Copy link
Contributor Author

A convenient solution to libffi having a custom patch necessary for use in PHP is to use Barbarian.
This would allow us to stay in the Conan ecosystem without having to host an Artifactory server for custom recipes.

@Croydon
Copy link
Contributor

Croydon commented Jan 8, 2022

A convenient solution to libffi having a custom patch necessary for use in PHP is to use Barbarian. This would allow us to stay in the Conan ecosystem without having to host an Artifactory server for custom recipes.

Unfortunately, this is not a solution as CCI recipes can only depend on other CCI recipes

@friendlyanon
Copy link
Contributor Author

The goal is not to have php-src in CCI, but to have all its dependencies on CCI, so it can be built easily on all platforms once it has a CMake build tooling. For php-src, that's perfectly fine, since no other dependency has libffi as a dependency.

For php-src to be available on CCI as well, all of its dependencies that are patched and can't be upstreamed for various reasons would first have to be in a desirable condition upstream. Let's just say I don't want to go down that rabbit hole myself and Barbarian is a good enough solution in the meantime.

@Croydon
Copy link
Contributor

Croydon commented Jan 8, 2022

The goal is not to have php-src in CCI, but to have all its dependencies on CCI, so it can be built easily on all platforms once it has a CMake build tooling. For php-src, that's perfectly fine, since no other dependency has libffi as a dependency.

Understood. I find it personally interesting to eventually have PHP itself in CCI too, but let's keep this out of this issue for now. Perhaps change the title of this issue to something like Dependencies of PHP?

Huge 👍 for working towers a CMake + Conan build system for PHP, btw. 👏

@friendlyanon friendlyanon changed the title [request] PHP (summary issue) [request] Dependencies of PHP (summary issue) Jan 8, 2022
@friendlyanon
Copy link
Contributor Author

friendlyanon commented Jan 9, 2022

I looked at libxpm and some things aren't quite clear to me. The Makefile.am contained in the upstream repository contains more sources for the library than the PHP build files for Windows. Additionally, the windows.php.net distribution of the library contains these additional header files:

  • keysym.h
  • X.h
  • Xfuncproto.h
  • Xlib.h
  • Xosdefs.h
  • Xutil.h

I'm told these files are in the distribution only because the ext/gd extension for PHP depends on those headers. This seems like an improper dependency hierarchy to me.

Edit: I read the README.MSW, now it's clear why there are less sources for the Windows build. tl;dr Pixmap operation related sources don't work on Windows.

@friendlyanon friendlyanon mentioned this issue Jan 10, 2022
4 tasks
@friendlyanon
Copy link
Contributor Author

@cmb69 I looked at the ext/gd directory in php-src and it appears that none of the headers are used directly. Are you sure these aren't an artifact of decisions that aren't relevant anymore?

@cmb69
Copy link

cmb69 commented Jan 10, 2022

xpm.h includes X11/Xlib.h and X11/Xutil.h. If FOR_MSW was defined, simx.h would be included, but that is apparently not available either. The clean solution would likely be to rely on another package, but I presume that X11 can't be built under native Windows. On the other hand, I'm not sure that anybody uses XBM files under Windows.

@pierrejoye
Copy link

pierrejoye commented Jan 10, 2022

@friendlyanon gd.h and a few are used during build. Other may be used only when builds are done against ext/gd or its libgd.

As of libgd itself, you can check https://github.com/libgd/libgd as it has cmake support already. I did not know about Conan. I may add support for it as it looks pretty good (we only relied on distro/src pkg and vcpck on windows so far).

For XPM, back then I forked it and only added what we need to build it on Windows without having to have the full X11. You can see the current used sources for libXPM on Windows for PHP here
simx.h is for MingW only afair, as libgd supports it, PHP does not support mingw on Windows.

@friendlyanon
Copy link
Contributor Author

friendlyanon commented Jan 10, 2022

The recipe in #8786 installs only xpm.h and simx.h, see here.

It also defines the FOR_MSW for consumers here. It's likely that PHP was missing this define during build and thus you still needed the headers, despite building on Windows.

Yep, a quick grep shows no FOR_MSW used in the PHP source.

@cmb69
Copy link

cmb69 commented Jan 10, 2022

@pierrejoye, PHP on Windows still doesn't support building against external libgd, and I'm reluctant to introduce that until custom memory allocators are available.

@friendlyanon, ah, indeed, thank you! I'll roll out a new libxpm package with this change soon.

@pierrejoye
Copy link

pierrejoye commented Jan 10, 2022

@cmb69 correct. However the whole build can be a lot easier by taking what is needed from libgd/libgd's cmake. Made a static build and uses it for ext/gd. It may requires a few tweaks but as it is built at the same time than php, it should not require much changes.

conan-center-bot pushed a commit that referenced this issue Mar 28, 2022
* Add net-snmp/5.9.1

Issue: #8618

* Simplify patching in conanfile.py

* Downgrade recipe for Conan 1.43

* Modernize check for MSVC

* Fix build for Apple ARM64

* Further modify the CFLAGS on Windows

The release and debug flags were taken from a CMake project with default
flags for each build type.

* Nuke CMake info not present upstream

* Use single quotes in Perl build script

Single quotes in Perl avoid certain types of string interpolation that
were stripping characters from the include path in the CI machine.

* Use `tools.replace_in_file` for dynamic patches

* Use target from CMake config with Conan defaults

* Patch `-install_name` on MacOS

* Add `KEEP_RPATHS` to test package

* Apply suggested changes from review

Move the `install_name` patch into the conanfile and empty the libs
attribute for autotools.

* Add another system_libs usage

* Use cmake/3.20.1 for the test package on MacOS M1

* Cleanup attributes and address linter warnings

* Remove use of `settings_build`

* Add OpenSSL to `requires`

Co-authored-by: friendlyanon <friendlyanon@users.noreply.github.com>
@friendlyanon
Copy link
Contributor Author

So, I have been trying to crack the nut that is the Apache HTTP Server and boy, does it have a million knobs. (also unsatisfactory Windows support in build tooling aspect)

I looked at the php-src codebase and a grep for apache doesn't immediately tell me what kind of featureset PHP expects from the HTTP library. https://github.com/winlibs/apache has also been abandoned for 7 years now, so that is no use here either. I tried looking at what features Linux distributions enable, and I found at least the Alpine build script.

@cmb69 @pierrejoye

@cmb69
Copy link

cmb69 commented Apr 11, 2022

@friendlyanon, we using the Apache Lounge builds of Apache for years. I have no idea, how they do these builds exactly, but could ask, if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants