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

[CRIT] Source [pkg-config] not downloaded or not locked, you should download it first ! #288

Closed
CViniciusSDias opened this issue Dec 19, 2023 · 11 comments
Labels
question Further information is requested

Comments

@CViniciusSDias
Copy link

When I try to run ./spc build ffi,mbstring,sodium --build-micro -I "ffi.enable=true" I get the following error:

[CRIT] Source [pkg-config] not downloaded or not locked, you should download it first !

There are no instructions in the documentation on how/where I should download the source. I tryied cloning the repository into source folder, tried adding the binary to buildroot/bin, but nothing worked.

I tried to use the GitHub Actions built micro, but I get the following error when trying to execute:

Fatal error: Uncaught FFI\Exception: FFI API is restricted by "ffi.enable" configuration directive

I assume it's because ffi.enable needs to be true instead of preload, but I'm unnable to set it without building it myself, and I'm unnable to build it, unfortunately.

@crazywhalecc
Copy link
Owner

crazywhalecc commented Dec 19, 2023

When I try to run ./spc build ffi,mbstring,sodium --build-micro -I "ffi.enable=true" I get the following error:

  • Download all sources command (with different PHP version): ./spc download --all --with-php=8.3
  • Download sources for extensions and dependencies: ./spc download --for-extensions=ffi,mbstring,sodium

I tried to use the GitHub Actions built micro, but I get the following error when trying to execute:

Now Linux is purely statically compiled, and it cannot support methods such as ffi/dl and other dynamic linking methods for other libraries. If you are using macOS micro, you can use ffi and dl.

By the way, Linux can actually support standalone PHP binary that are not fully statically linked and can use ffi/dl, but currently the main branch does not provide an option (because of glibc).

I assume it's because ffi.enable needs to be true instead of preload

The -I parameter to specify the required ini config when compiling or combining micro.sfx. (Docs)

I tryied cloning the repository into source folder

I just noticed this problem too. It seems that the freedesktop.org website is down. I have copied a previous source code archive to dl.static-php.dev, I'm working on #64 right now and will merge it soon, which contains the address to modify the pkgconfig download.

If you need to compile now, you can use ./spc download --all -U pkg-config:https://dl.static-php.dev/static-php-cli/deps/pkg-config/pkg-config-0.29.2.tar.gz command to temporarily replace the download link of pkgconfig.

@crazywhalecc crazywhalecc added bug Something isn't working question Further information is requested and removed bug Something isn't working labels Dec 19, 2023
@CViniciusSDias
Copy link
Author

Now Linux is purely statically compiled, and it cannot support methods such as ffi/dl and other dynamic linking methods for other libraries. If you are using macOS micro, you can use ffi and dl.

I don't think I understood this correctly.

If I can't correctly use FFI, should it be "yes" here?

@CViniciusSDias
Copy link
Author

I was able to build and create the standalone file, but I got into the FFI error you mentioned:

Fatal error: Uncaught FFI\Exception: Failed loading 'libtcl8.6.so' (Dynamic loading not supported)

Is there a way around it? 😳

@crazywhalecc
Copy link
Owner

If I can't correctly use FFI, should it be "yes" here?

You didn't mention what type of operating system you are using (Linux or macOS), so I explained the different features of different systems.

To put it simply, currently only static-php under macOS can use ffi/dl, and Linux cannot.

@CViniciusSDias
Copy link
Author

You didn't mention what type of operating system you are using

I'm sorry. It's Linux.

To put it simply, currently only static-php under macOS can use ffi/dl, and Linux cannot.

So this should say "no" on the ffi line for Linux column, right?

@crazywhalecc
Copy link
Owner

So this should say "no" on the ffi line for Linux column, right?

For linux, no.

@CViniciusSDias
Copy link
Author

For linux, no.

"no" as in it should not say "no"? Even though you just mentioned it doesn't work? 🤔

@crazywhalecc
Copy link
Owner

crazywhalecc commented Dec 19, 2023

"no" as in it should not say "no"? Even though you just mentioned it doesn't work? 🤔

With the current main branch and project structure, we cannot directly build a php that can use ffi. So for your requirement it is no.

It is possible to use ffi on Linux, but it will not be considered at this time.

@CViniciusSDias
Copy link
Author

CViniciusSDias commented Dec 19, 2023

That's my point: The doc should say that FFI for Linux isn't supported, right?

@crazywhalecc
Copy link
Owner

To be precise, it doesn't work, but it can be supported. Because ffi itself can be compiled inline into PHP, it means that it is supported, but it is another matter that it cannot be used. This has something to do with the limitations of the Linux kernel and has nothing to do with PHP.

But you're right, I shouldn't describe linux ffi as yes without any comments inside the documentation.

@crazywhalecc
Copy link
Owner

The documentation will be updated. static-php/static-php-cli-docs#7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants