Problem/Motivation
The updates were not working for me.
It would create a directory in my project root and then copy the files there instead of overwriting my core files.
I figure out what happening is that \Drupal\automatic_updates\Services\InPlaceUpdate::getTempDirectory()
was returning /tmp/
but the "real" path was actually /private/tmp/
I am using a Mac and I think this is default behavior.
The extracting of the archive worked correctly but in \Drupal\automatic_updates\Services\InPlaceUpdate::processUpdate)_
there is
$file_real_path = $this->getFileRealPath($file);
$file_path = substr($file_real_path, strlen($this->getTempDirectory() . self::ARCHIVE_DIRECTORY));
$project_real_path = $this->getProjectRealPath($file_path, $project_root);
Since in the 2nd line we have $file_real_path, which is the "real" path and has "/private/
", but $this->getTempDirectory()
does not have /private/
then $file_path
would be incorrect and also $project_real_path
Proposed resolution
In \Drupal\automatic_updates\Services\InPlaceUpdate::getTempDirectory()
use \SplFileInfo::getRealPath()
to return the "real path".
Remaining tasks
Patch
Comment | File | Size | Author |
---|---|---|---|
#2 | 3156467-2.patch | 845 bytes | tedbow |
Comments
Comment #2
tedbowHere is the fix
With this automatic updates work for me from 8.9.0 to 8.9.1
Comment #3
tedbowComment #4
tedbowComment #5
Wim LeersI think this is an obscure enough edge case that we can consider this out of scope for MVP. Do you agree, @tedbow?
Comment #6
Wim LeersInPlaceUpdate
no longer exists, so the patch no longer applies.And actually … we ran into this too over at #3328234: Improve test DX *and* confidence: stop using VFS.
AFAICT if we can get #3328234 to work, then that proves that Automatic Updates now is correctly handling this, and that it actually was fixed a long time ago (which makes sense, given that most development of this module happens on macOS and #2 dates back ~2.5 years).
I think that would mean that we can mark this
.But this requires somebody who knows the history of this project, so … RTBC'ing and assigning to @tedbow so he can hopefully close this out 🤞
Comment #7
Wim Leers#3334552: Ensure that intentionally failed test stage directories are deleted after tests complete landed, #6 is still accurate AFAICT.
Comment #8
Wim LeersSee #3319507-44: Add symlink support to Composer Stager 2.0, require that version, and simplify UX & tests accordingly — this is blocked on an upstream feature/bugfix in
php-tuf/composer-stager
.