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

Error when building doc locally #20848

Open
RisingSunLight42 opened this issue Mar 31, 2025 · 4 comments
Open

Error when building doc locally #20848

RisingSunLight42 opened this issue Mar 31, 2025 · 4 comments

Comments

@RisingSunLight42
Copy link

RisingSunLight42 commented Mar 31, 2025

Hi! I tried to build the doc locally by following the short tutorial in the readme. I've cloned the repo properly, opened a cmd in \symfony-docs\_build, ran composer install and then php build.php.

The output I got:

C:\Users\sunli\Documents\code\symfony-docs\_build>php build.php -v
 Building all Symfony Docs...

 // cache: enabled / output file type(s): HTML

 // Tip: add the --disable-cache option to this command to force the re-build of all docs.

Processing file: best_practices
Processing file: bundles\best_practices
Processing file: bundles\configuration
Processing file: bundles\extension
Processing file: bundles\index
Processing file: bundles\override
Processing file: bundles\prepend_extension
Processing file: bundles
Processing file: cache
Processing file: components\asset

In FileIncluder.php line 47:

  [RuntimeException]
  Include ".. include:: /components/require_autoload.rst.inc" does not exist or is not readable.


Exception trace:
  at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\FileIncluder.php:47
 Doctrine\RST\FileIncluder->{closure:Doctrine\RST\FileIncluder::includeFiles():43}() at n/a:n/a
 preg_replace_callback() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\FileIncluder.php:41
 Doctrine\RST\FileIncluder->includeFiles() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\Parser\DocumentParser.php:190
 Doctrine\RST\Parser\DocumentParser->prepareDocument() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\Parser\DocumentParser.php:208
 Doctrine\RST\Parser\DocumentParser->parseLines() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\Parser\DocumentParser.php:153
 Doctrine\RST\Parser\DocumentParser->parse() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\Parser.php:179
 Doctrine\RST\Parser->parseLocal() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\Parser.php:163
 Doctrine\RST\Parser->parse() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\Parser.php:205
 Doctrine\RST\Parser->parseFile() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\Builder\ParseQueueProcessor.php:81
 Doctrine\RST\Builder\ParseQueueProcessor->processFile() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\Builder\ParseQueueProcessor.php:65
 Doctrine\RST\Builder\ParseQueueProcessor->process() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\Builder.php:214
 Doctrine\RST\Builder->parse() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\doctrine\rst-parser\lib\Builder.php:151
 Doctrine\RST\Builder->build() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\symfony-tools\docs-builder\src\DocBuilder.php:27
 SymfonyDocsBuilder\DocBuilder->build() at C:\Users\sunli\Documents\code\symfony-docs\_build\build.php:46
 Closure->{closure:C:\Users\sunli\Documents\code\symfony-docs\_build\build.php:17}() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\symfony\console\Command\Command.php:324
 Symfony\Component\Console\Command\Command->run() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\symfony\console\Application.php:1078
 Symfony\Component\Console\Application->doRunCommand() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\symfony\console\Application.php:324
 Symfony\Component\Console\Application->doRun() at C:\Users\sunli\Documents\code\symfony-docs\_build\vendor\symfony\console\Application.php:175
 Symfony\Component\Console\Application->run() at C:\Users\sunli\Documents\code\symfony-docs\_build\build.php:84

build-docs [--generate-fjson-files] [--disable-cache]

I checked, the file does exist in /component/. I'm on Windows 10 and use PHP 8.4.5, and tested it on branch 7.3. I've also tried all the branches until getting back to 5.0 and I'm encountering the same error.
I've already checked the line mentionned, the error seems being from the method absoluteRelativePath() in Environment.php in doctrine/rst-parser/lib, and it looks like it resolves the path incorrectly.
Instead of getting something like this:
"C:\Users\sunli\Documents\code\symfony-docs/components/require_autoload.rst.inc"
it returns something like this (a folder is duplicated):
"C:\Users\sunli\Documents\code\symfony-docs/components/components/require_autoload.rst.inc"

I tried to solve the error locally, but each time I was doing an hacky fix, another problem was happening so I did not push it any further.

Sorry If I created the issue in the wrong repository! Thanks in advance for your answers.

@OskarStark
Copy link
Contributor

Hmm, it works on my Mac, but can you try to add --disable-cache option?

@RisingSunLight42
Copy link
Author

Hmm, it works on my Mac, but can you try to add --disable-cache option?

The same error occurs with --disable-cache.

@RisingSunLight42
Copy link
Author

I tried running it on a Docker container to see if there was any change, it indeeds takes some times before crashing, but it stills crash

/doc/_build # php build.php
 Building all Symfony Docs...

 // cache: enabled / output file type(s): HTML

 // Tip: add the --disable-cache option to this command to force the re-build of all docs.


In FileIncluder.php line 47:
                                                                                                                        
" does not exist or is not readable.  ms/types/options/choice_translation_domain.rst.inc
                                                                                                                        

@RisingSunLight42
Copy link
Author

Well I managed to get around the problem by running a Ubuntu 24 distro with WSL on my machine, kinda annoying but that's fine 👍

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

2 participants