-
Notifications
You must be signed in to change notification settings - Fork 71
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
resourceListCreator: Different order of input resources leads to different results #274
Closed
1 of 6 tasks
RandomByte opened this issue
Nov 16, 2020
· 0 comments
· Fixed by SAP/ui5-builder#551 · May be fixed by SAP/ui5-builder#553
Closed
1 of 6 tasks
resourceListCreator: Different order of input resources leads to different results #274
RandomByte opened this issue
Nov 16, 2020
· 0 comments
· Fixed by SAP/ui5-builder#551 · May be fixed by SAP/ui5-builder#553
Labels
bug
Something isn't working
Comments
RandomByte
added a commit
to SAP/ui5-builder
that referenced
this issue
Nov 24, 2020
…stic Stop analyzing debug-resources if they correspond to a non-debug resource. However, try to analyze the "source" version of a resource's content if possible. In some cases the dependency analysis has problems with minified code. Finally, copy any dependency information of a non-debug resource to the corresponding debug-resource. This ensures that we generate the same resources.json, independently from the order of debug and non-debug resources supplied to the resourceListCreator processor. Resolves SAP/ui5-tooling#274
RandomByte
added a commit
to SAP/ui5-builder
that referenced
this issue
Nov 24, 2020
…stic Stop analyzing debug-resources if they correspond to a non-debug resource. However, try to analyze the "source" version of a resource's content if possible. In some cases the dependency analysis has problems with minified code. Finally, copy any dependency information of a non-debug resource to the corresponding debug-resource. This ensures that we generate the same resources.json, independently from the order of debug and non-debug resources supplied to the resourceListCreator processor. Resolves SAP/ui5-tooling#274
RandomByte
added a commit
to SAP/ui5-builder
that referenced
this issue
Nov 26, 2020
…stic Stop analyzing debug-resources if they correspond to a non-debug resource. Only analze the non-debug resource and copy any dependency information to the corresponding debug-resource. While this might not be the best approach given that analyzing the source ("debug") version of a resource might result in finding more dependencies (i.e. those mangled during minification), this change ensures that we generate the same resources.json, independently from the order of debug and non-debug resources supplied to the resourceListCreator processor. Resolves SAP/ui5-tooling#274
RandomByte
added a commit
to SAP/ui5-builder
that referenced
this issue
Nov 26, 2020
…stic Stop analyzing debug-resources if they correspond to a non-debug resource. Only analyze the non-debug resource and copy any dependency information to the corresponding debug-resource. While this might not be the best approach given that analyzing the source ("debug") version of a resource might result in finding more dependencies (i.e. those mangled during minification), this change ensures that we generate the same resources.json, independently from the order of debug and non-debug resources supplied to the resourceListCreator processor. Resolves SAP/ui5-tooling#274
RandomByte
added a commit
to SAP/ui5-builder
that referenced
this issue
Nov 30, 2020
…stic Stop analyzing debug-resources if they correspond to a non-debug resource. Only analyze the non-debug resource and copy any dependency information to the corresponding debug-resource. While this might not be the best approach given that analyzing the source ("debug") version of a resource might result in finding more dependencies (i.e. those mangled during minification), this change ensures that we generate the same resources.json, independently from the order of debug and non-debug resources supplied to the resourceListCreator processor. Resolves SAP/ui5-tooling#274
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected Behavior
The order of resources as provided by
workspace.byGlob
should have no effect on the producedresources.json
.Current Behavior
Due to the minor randomization applied in byGlob (https://github.com/SAP/ui5-fs/blob/70d9cf42abc34faa73a86e2ccb75279a806c82d2/lib/AbstractReader.js#L45-L50), we spotted rare occurrences of differences in the generated
resources.json
in the current pomahawk voter.This indicates that the correct generation of a resources.json currently depends on a certain order of resources. I'm still not sure what that order is.
Note that on my system, in >99% of all executions an equal resources.json has been produced. However, we do not know yet whether the content of that specific version is actually correct.
Example 1
Example 2
Example 3
Steps to reproduce the issue
Even though we already identified the mentioned pseudo-randomization as the cause (while not root cause), for future reference here's how we reproduced this locally. Basically we generated a lot of resources.json files and compared their sizes.
Note that it's probably easier to reproduce this now by reversing the order of resources in https://github.com/SAP/ui5-fs/blob/70d9cf42abc34faa73a86e2ccb75279a806c82d2/lib/AbstractReader.js#L45-L50 or by searching for
-dbg
resources and swapping them with their non--dbg
counterparts.1. Helper Scripts
start.sh
do-it.sh
2. Patch ui5-builder (optional)
If possible, patch the UI5 Builder at https://github.com/SAP/ui5-builder/blob/bc4a197090bfd9c2062d4dad92dc9b5b2eff147a/lib/builder/builder.js#L375 to only write out the resources.json
3. Execute builds
Execute
start.sh
in a library of your choice. For example sap.ui.core.4. Compare sizes of resulting JSON files
ls -lS resources-*
5. Cleanup once done analyzing
Cleanup
rm resources-* rm -rf logs dist
Context
ui5 --version
when using the CLI):v2.6.4
v14.15.0
6.14.8
macOS
Affected components (if known)
The text was updated successfully, but these errors were encountered: