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

PHP code fails to compile: Unsupported tl-schema version -1 #2835

Closed
barracuda156 opened this issue Mar 29, 2024 · 13 comments
Closed

PHP code fails to compile: Unsupported tl-schema version -1 #2835

barracuda156 opened this issue Mar 29, 2024 · 13 comments

Comments

@barracuda156
Copy link

[ 10%] Generate common TL source files
cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/td-1.8.0/td/generate && /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/build/td/generate/generate_common && /opt/local/bin/php81 DoxygenTlDocumentationGenerator.php scheme/td_api.tl auto/td/telegram/td_api.h
Unsupported tl-schema version -1
/bin/sh: line 1: 67984 Abort trap              /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/build/td/generate/generate_common
make[2]: *** [td/generate/CMakeFiles/tl_generate_common] Error 134
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/build'
make[1]: *** [td/generate/CMakeFiles/tl_generate_common.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....

What could be the reason for this?

@barracuda156
Copy link
Author

README actually claims that PHP (optional, for documentation generation), but I cannot find a way to get rid of PHP here.

@barracuda156
Copy link
Author

Same error if building with Ninja:

[34/432] cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/td-1.8.0/td/generate && /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/build/td/generate/generate_common && /opt/local/bin/php81 DoxygenTlDocumentationGenerator.php scheme/td_api.tl auto/td/telegram/td_api.h
FAILED: td/generate/CMakeFiles/tl_generate_common /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/build/td/generate/CMakeFiles/tl_generate_common 
cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/td-1.8.0/td/generate && /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/build/td/generate/generate_common && /opt/local/bin/php81 DoxygenTlDocumentationGenerator.php scheme/td_api.tl auto/td/telegram/td_api.h
Unsupported tl-schema version -1
/bin/sh: line 1: 73904 Abort trap              /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/build/td/generate/generate_common

@barracuda156
Copy link
Author

Also the same error when building from 586bc78 (master):

[  4%] Generate common TL source files
cd /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/td-586bc784138042d2710168cd0b29f5dd6d415f45/td/generate/auto && /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/build/td/generate/generate_common && /usr/bin/php ../DoxygenTlDocumentationGenerator.php ../scheme/td_api.tl td/telegram/td_api.h
Unsupported tl-schema version -1
/bin/sh: line 1: 75681 Abort trap              /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/build/td/generate/generate_common
make[2]: *** [td/generate/CMakeFiles/tl_generate_common] Error 134
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_net_tdlib/tdlib/work/build'

@levlam
Copy link
Contributor

levlam commented Mar 29, 2024

Do you have a big-endian CPU/OS? TDLib support only little-endian systems.

@barracuda156
Copy link
Author

Do you have a big-endian CPU/OS? TDLib support only little-endian systems.

@levlam Yes, this is on a Big-endian system.

Is it possible to add support for BE systems? While I am running this on an old macOS, which the upstream may not be too motivated to support, Big-endian systems are supported in the modern versions of OpenBSD, FreeBSD and some distros of Linux. So it will benefit quite a number of people.

@levlam
Copy link
Contributor

levlam commented Mar 29, 2024

This would be hard to achieve, because it requires many changes in different parts of the code.

@barracuda156
Copy link
Author

This would be hard to achieve, because it requires many changes in different parts of the code.

Could you say if it is known to be broken or just nobody tested it? (I mean, beyond initial error – I have no idea at the moment what causes it and therefore how serious it is).

I am asking since FreeBSD, for example, does not seem to restrict it to LE archs: https://github.com/freebsd/freebsd-ports/blob/9c477091cee352b9e783062234ab276bbb61d16c/net-im/tdlib/Makefile (though of course it is possible that they never tried it as well).

Oddly, btw, they do not declare a dependency on any php version – can it be actually bypassed?

P. S. Though on Linux the error has been reported earlier: #364
And OpenBSD refers to it: https://github.com/openbsd/ports/blob/737babba1cb7d9d288b6bfe477ffd7b4d36229c9/net/tdlib/Makefile#L1-L2

@levlam
Copy link
Contributor

levlam commented Mar 29, 2024

It is known to be broken. There are a few other places that are known to work only on little-endian systems, and unknown number of unidentified places that will work incorrectly on big-endian systems.

Current;y, TDLib will not build on big-endian systems, which is better than failing in runtime.

PHP is optional for TDLib building and the issue has nothing to do with PHP.

@barracuda156
Copy link
Author

@levlam Is there a ticket or discussion to track the issues on Big-endian? There may be people interested to help here, since this is OS-agnostic problem.

@levlam
Copy link
Contributor

levlam commented Mar 30, 2024

You have already mentioned the issue 364. There is no complete list of features that must be ported to big-endian, but it would be a pretty long list. At least all usages of memcpy, as<..> and reinterpret_cast must be checked and some of them must be rewritten.

@levlam levlam closed this as completed Jun 3, 2024
@barracuda156
Copy link
Author

@levlam You close this as completed, has it been fixed?

@levlam
Copy link
Contributor

levlam commented Jun 3, 2024

It was closed as duplicate of the issue 364.

@levlam levlam closed this as not planned Won't fix, can't repro, duplicate, stale Jun 3, 2024
@barracuda156
Copy link
Author

@levlam Got it, thank you. An open duplicate is unneeded, of course.

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

No branches or pull requests

2 participants