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

Idempotent build: file-entities.php #201

Merged
merged 10 commits into from
Dec 10, 2024
Merged

Idempotent build: file-entities.php #201

merged 10 commits into from
Dec 10, 2024

Conversation

alfsb
Copy link
Member

@alfsb alfsb commented Dec 8, 2024

There are two principal sources of non idempotence in PHP manuals. scripts/file-entities.php.in and configure.php This PR rewrites scripts/file-entities.php.in into idempotent scripts/file-entities.php.

scripts/file-entities.php.in comes a long way. It's almost as old as the first solid Docbook XML manual, and got heavily patched in its more than two decades of existence. It had and/or has code for idiosyncrasies of CVS, SVN and git, of Saxon, xsltproc and PhD, of all versions of PHP starting with PHP 4, of almost all operations systems starting with Windows 95... That is a lot of history, and that is a lot of accumulated anachronisms.

Tested on all languages with two behavior changes, listed below.

  1. <!ENTITY> output order is changed in manual DTD preambule;
  2. The commented out entities on https://github.com/php/doc-en/blob/master/reference/swoole/book.xml stop being rendered, in all languages.

The first one is insignificant, but the second one may be a real bug. It almost got me crazy because the commented out entities are rendered on the PHP manual main site, and the code itself hinted of some form of recursive cascading file inclusions.

But tests with PhD xhtml and bigxhtml showed that all differences are basically Swoole related, so there is no any (more?) automatic recursive file loading in reference/ or elsewhere.

@alfsb alfsb mentioned this pull request Dec 8, 2024
26 tasks
@alfsb
Copy link
Member Author

alfsb commented Dec 9, 2024

Conflict resolved. Passes CI, and yet I would like testing of Windows users. I'm trying to make the code as shell free as possible. In particular, I would like to hear if the git -C switch avoids the need for cd /d on Windows.

The Swoole bit may warrant opening an issue, if the docs are still actively developed.

@alfsb alfsb requested a review from haszi December 9, 2024 13:14
Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tried locally, but for Windows maybe @cmb69 could try?

.gitignore Outdated Show resolved Hide resolved
scripts/file-entities.php Outdated Show resolved Hide resolved
scripts/file-entities.php Show resolved Hide resolved
scripts/file-entities.php Outdated Show resolved Hide resolved
scripts/file-entities.php Outdated Show resolved Hide resolved
scripts/file-entities.php Outdated Show resolved Hide resolved
scripts/file-entities.php Outdated Show resolved Hide resolved
@cmb69
Copy link
Member

cmb69 commented Dec 10, 2024

It almost got me crazy because the commented out entities are rendered on the PHP manual main site, and the code itself hinted of some form of recursive cascading file inclusions.

Well, there may be nested comments, which are not allowed in XML.

but for Windows maybe @cmb69 could try?

Gave it a quick try, and detected no issues.

@alfsb
Copy link
Member Author

alfsb commented Dec 10, 2024

It's time. Merging.

The breakages of &reference.spl.entities.countable; are unrelated, as they occurs already.

@alfsb alfsb merged commit df18cd2 into php:master Dec 10, 2024
6 of 12 checks passed
@alfsb
Copy link
Member Author

alfsb commented Dec 10, 2024

Gave it a quick try, and detected no issues.

Thanks for the testing. Building manual on Windows seems to be way more viable now (compared to 2000, at least).

php/doc-en#4288 is a thing everyone that builds on Windows should keep a eye, as it is a nasty thing that may caused so much... suffering, for many and many years. Bit me hard, today.

@alfsb alfsb deleted the idempotent2 branch December 10, 2024 21:32
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

Successfully merging this pull request may close these issues.

3 participants