User tests: Successful: Unsuccessful:
Pull Request for Issue # .
This pull request (PR) adds removal of .git folders and .php_cs files from 3rd party libraries in general and of the "tests" folder or the composer dependency "tobscure/json-api" in particular to the build script "build/build.php" so that these files and folders which are not needed on a J4 installation will not be included in the full installation or update packages.
It also adds the "libraries/vendor/webmozart/assert/.php_cs" file to the list of files to be deleted on update in administrator/components/com_admin/script.php.
When having updated the list of files and folders to be deleted on update with my PR #37287 before the 4.0.1 release, I had done that as usual based on a comparison of a full package built with the build script on the 4.1-dev branch at that time and the full installation package of the previous 4.0.0 release (and of course also another comparison with a 3.10-dev package, but that doesn't matter here).
The result was that the file ".php_cs" and subfolders ".git" and "tests" of the "tobscure/json-api" dependency were detected as removed and so added to script.php with PR #37287 as this file and these folders are not needed on a J4 installation.
See here
and here
It's development stuff from of this dependency and so it was right to remove it.
But now the same check for the current 4.1-dev branch and the 4.0.2 release has shown that this stuff was included again in the release packages, while the 4.1-dev nightly builds and also the 4.2-dev nightly builds and the 4.2.0-alpha1 packages do not include that.
See here a comparison of the latest 4.1-dev nightly installation package (left side) with the 4.0.2 release installation package (right side):
The ".git" and "tests" subfolders are not expanded in the above image, they contain a lot of files.
With the 4.1 update packages it's the same.
The 4.2 packages are all ok, regardless if nightly or latest alpha.
So it seems to depend on the build environment if that stuff is in the package or not. I was never able to get it into a package when I made local builds with php ./build/build.php --remote=HEAD --exclude-gzip --exclude-bzip2
, so up to now only @bembelimen could reproduce the issue.
I have now decided to do it like we did with other vendor stuff in past and added code to the build script for removing these files and folders from the build result before we pack the packages.
For the ".git" subfolder and the ".php_cs" file I've decided to do that in general for all vendor libraries and not only that one. This results in one more file "libraries/vendor/webmozart/assert/.php_cs" which is detected by the comparison mentioned at the beginning for the list of files to be deleted on update, and so this PR here adds that file to the list.
Requirement: It needs a development environment with Linux or WSL on Windows because the build/build.php script doesn't work on Windows without WSL.
On a clean, current 4.1-dev branch in a command shell in the Joomla root folder, run php ./build/build.php --remote=HEAD --exclude-gzip --exclude-bzip2
.
Check the content of the "build/tmp/packages/Joomla_4.1.3-dev-Development-Full_Package.zip" package if it contains the following folders and files:
Revert all local changes:
git clean -d -x -f
git checkout .
Fetch the changes of this PR into a new branch named "test-pr-37458":
git fetch upstream pull/37458/head:test-pr-37458
with "upstream" being the remote for this repository here. If you don't have such a remote, you can add it with
git remote add upstream https://github.com/joomla/joomla-cms.git
before executing the above "fetch" command.
Checkout the new branch from step 4:
git checkout test-pr-37458
Run php ./build/build.php --remote=HEAD --exclude-gzip --exclude-bzip2
.
Check the content of the "build/tmp/packages/Joomla_4.1.3-dev-Development-Full_Package.zip" package like in step 2 above.
Result: See section "Expected result AFTER applying this Pull Request" below.
File "libraries/vendor/webmozart/assert/.php_cs" is in the package.
Depending on your build environment and which parameters you have used for the build script, the following files and folders might be in the package:
File "libraries/vendor/webmozart/assert/.php_cs" is not in the package.
The following files and folders are not in the package:
None.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_admin Repository |
Testing instructions are complete now.
I have tested this item
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-05-01 11:32:40 |
Closed_By | ⇒ | bembelimen | |
Labels |
Added:
PBF
?
|
Thx
Will complete testing instructions tomorrow.