Release builder doesn't work with symbolic links

Affected version
2.1.X

Z61

Well-known member
When running 2.1 beta 4 (it may also affect all versions of 2.1), I cannot build an add-on that uses a symbolic link to its root folder. This was not the case with any version of 2.0.

Output when trying to build with symbolic link:
Code:
ErrorException: [E_WARNING] mkdir(): No such file or directory
            
src\XF\Util\File.php:281
Stack:
Code:
#0 [internal function]: XF::handlePhpError(2, '[E_WARNING] mkd...', 'C:\\laragon\\www\\...', 281, Array)
#1 src\XF\Util\File.php(281): mkdir('C:/laragon/www/...')
#2 src\XF\Util\File.php(324): XF\Util\File::createDirectory('C:/laragon/www/...', false)
#3 src\XF\Service\AddOn\ReleaseBuilder.php(139): XF\Util\File::copyFile('C:\\laragon\\www\\...', 'C:\\laragon\\www\\...', false)
#4 src\XF\Service\AddOn\ReleaseBuilder.php(47): XF\Service\AddOn\ReleaseBuilder->prepareFilesToCopy()
#5 src\XF\Container.php(274): XF\Service\AddOn\ReleaseBuilder->__construct(Object(XF\Cli\App), Object(XF\AddOn\AddOn))
#6 src\XF\App.php(1560): XF\Container->createObject('XF\\Service\\AddO...', Array)
#7 src\XF\Container.php(228): XF\App->XF\{closure}('XF\\Service\\AddO...', Array, Object(XF\Container))
#8 src\XF\App.php(2762): XF\Container->create('service', 'XF:AddOn\\Releas...', Array)
#9 src\XF\Cli\Command\AddOn\BuildRelease.php(74): XF\App->service('XF:AddOn\\Releas...', Object(XF\AddOn\AddOn))
#10 src\vendor\symfony\console\Command\Command.php(255): XF\Cli\Command\AddOn\BuildRelease->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 src\vendor\symfony\console\Application.php(946): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 src\vendor\symfony\console\Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(XF\Cli\Command\AddOn\BuildRelease), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 src\vendor\symfony\console\Application.php(148): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 src\XF\Cli\Runner.php(63): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 cmd.php(15): XF\Cli\Runner->run()
#16 {main}

When outputting the partialPath before the function runs mkdir, the path that breaks is


When building a non-symlinked add-on:
Code:
λ php cmd.php xf-addon:build-release Z61/Classifieds
Performing add-on export.

Exporting data for Classifieds to C:\laragon\www\xf2\src\addons\Z61\Classifieds\_data.
26/26 [============================] 100%
Written successfully.
Attempting to validate addon.json file...
JSON file validates successfully!

Building release ZIP.

Writing release ZIP to C:\laragon\www\xf2\src\addons\Z61\Classifieds\_releases.

Release written successfully.
 
Last edited:

DragonByte Tech

Well-known member
It's worth pointing out that Windows has very questionable support for symlinks in general. I used to develop on Windows, and I made heavy use of symlinks when vB3/vB4 was the development focus.

Randomly, the web server would fail to resolve random symlinks, causing errors that would go away on a refresh.

In short, I would strongly recommend you do not rely on symlinks when using Windows for development.
 

Z61

Well-known member
It's worth pointing out that Windows has very questionable support for symlinks in general. I used to develop on Windows, and I made heavy use of symlinks when vB3/vB4 was the development focus.

Randomly, the web server would fail to resolve random symlinks, causing errors that would go away on a refresh.

In short, I would strongly recommend you do not rely on symlinks when using Windows for development.
Thanks for the response, until 2.1, I have yet to have any issues with symlinks. So it seems relatively anecdotal either way. Do you use a dedicated linux/osx machine these days or what do you do?
 

Jake B.

Well-known member
Manifestation might be a bit different, but I think this may ultimately be the same issue as reported here:


(Which yes, has been open for some time.)

Though worth checking, are you also using Windows symlinks (as referenced in that bug report)? Or is this a *nix symlink?

Replying here to keep it all in one place, using MacOS
 

Z61

Well-known member
I've experienced a different version of this issue when using macOS. On macOS, I find that depending on which side I made the link (code folder or addon folder in xf2) I will build with differing results, most of the time unusable.
 
Top