Skip to content

Error when building doc locally #20848

Closed
Closed
@RisingSunLight42

Description

@RisingSunLight42

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Waiting feedbackhasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions