Fixes for release builds with DCO fix (#5164)

* This set of changes is work toward allowing release builds to work with asset bundler generated bundles and legacy, non-prefab levels. This requires some other in-flight changes before this work is complete.

    Updated engine seed list + fixed automated test
    ComponentApplicationLifecycle has the ability to automatically register events if asked to register a handler and the event doesn't exist. This is only intended for cases where you need to register a handler early in startup before the settings registry file is loaded.
    Added two new lifecycle events: One after the system entity has been activated, and one after the system interface has been created.
    If you load an archive before the system entity has been activated, archive.cpp caches information about those archives until that time, so it can finish registration. This is because the serialization system and BundlingSystemComponent both need to be available to do this registration, but the bundles have to be loaded before those are initialized so that the settings registry file can be loaded.
    Fixed an error were mounted pak files were searching for levels.pak and not level.pak, and not finding them. I'm pretty sure this logic doesn't do anything functional either way, but I've been testing legacy levels with this change and they work now.
    Moved wildcard pak loading to where engine.pak is loaded. This is because the settings registry file that defines the IO stack to spin up must be available early in application startup, and this file must be within a mounted pak file. If you're using asset bundler generated bundles, they need to be loaded at this time so that file can be loaded.
    Atom's BootstrapSystemComponent.cpp no longer initializes on AssetCatalogLoaded, and instead initializes on the ApplicationLifecycle event SystemInterfaceCreated. This is because the base assetcatalog.xml file is really just a development time concept, this file should not be used in packaged release builds, because those builds will make use of delta catalogs in each bundle loaded. The asset catalog contains the list of all assets that were in the cache at development time, and this contains content that developers don't want to ship, and they may want to specifically hide from their customers, so data miners don't find secrets about upcoming game content.

Recovering from a branch that had incorrect DCO

Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com>

* Fixed an incorrect ebus disconnect and removed an include that's no longer needed

Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com>

* Fixed a copy and paste typo from trying to recover the previous pull request

Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com>

* Updated product IDs for the settings registry builder to no longer collide with the JSON builder. Now they are based on a hash of the configuration.
Updated the engine default seed list to include the new asset ID info for the renamed bootstrap file

Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com>

* Updated the path to the application lifecycle events, because runtime settings aren't included in the merged bootstrap file.
Addressed some feedback on printing out a string view on an error

Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com>

* Removed a test that uses old assets that aren't relevant. We may not need this test anymore, but if we do we've backlogged a task to create a new test to cover this behavior without using old assets.

Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com>

* Renamed SystemInterfaceCreated event to LegacySystemInterfaceCreated
Removed SystemEntityActivated event. Now that I have the rest of the fixes in this pull request, this new event wasn't needed, the already existing SystemComponentsActivated event does what I need.
Changed list to vector

Signed-off-by: stankowi <4838196+AMZN-stankowi@users.noreply.github.com>
This commit is contained in:
AMZN-stankowi
2021-11-02 09:03:38 -07:00
committed by GitHub
parent 797b8248e5
commit 6d592d78cd
19 changed files with 470 additions and 794 deletions
@@ -47,82 +47,6 @@ class TestsAssetProcessorBatch_DependenycyTests(object):
"""
AssetProcessorBatch Dependency tests
"""
@pytest.mark.test_case_id("C16877166")
@pytest.mark.BAT
@pytest.mark.assetpipeline
# fmt:off
def test_WindowsMacPlatforms_RunAPBatch_NotMissingDependency(self, ap_setup_fixture, asset_processor,
workspace):
# fmt:on
"""
Engine Schema
This test case has a conditional scenario depending on the existence of surfacetypes.xml in a project.
Some projects have this file and others do not. Run the conditional scenario depending on the existence
of the file in the project
libs/materialeffects/surfacetypes.xml is listed as an entry engine_dependencies.xml
libs/materialeffects/surfacetypes.xml is not listed as a missing dependency
in the 'assetprocessorbatch' console output
Test Steps:
1. Assets are pre-processed
2. Verify that engine_dependencies.xml exists
3. Verify engine_dependencies.xml has surfacetypes.xml present
4. Run Missing Dependency scanner against the engine_dependenciese.xml
5. Verify that Surfacetypes.xml is NOT in the missing depdencies output
6. Add the schema file which allows our xml parser to understand dependencies for our engine_dependencies file
7. Process assets
8. Run Missing Dependency scanner against the engine_dependenciese.xml
9. Verify that surfacetypes.xml is in the missing dependencies out
"""
env = ap_setup_fixture
BATCH_LOG_PATH = env["ap_batch_log_file"]
asset_processor.create_temp_asset_root()
asset_processor.add_relative_source_asset(os.path.join("Assets", "Engine", "Engine_Dependencies.xml"))
asset_processor.add_scan_folder(os.path.join("Assets", "Engine"))
asset_processor.add_relative_source_asset(os.path.join("Assets", "Engine", "Libs", "MaterialEffects", "surfacetypes.xml"))
# Precondition: Assets are all processed
asset_processor.batch_process()
DEPENDENCIES_PATH = os.path.join(asset_processor.temp_project_cache(), "engine_dependencies.xml")
assert os.path.exists(DEPENDENCIES_PATH), "The engine_dependencies.xml does not exist."
surfacetypes_in_dependencies = False
surfacetypes_missing_logline = False
# Read engine_dependencies.xml to see if surfacetypes.xml is present
with open(DEPENDENCIES_PATH, "r") as dependencies_file:
for line in dependencies_file.readlines():
if "surfacetypes.xml" in line:
surfacetypes_in_dependencies = True
logger.info("Surfacetypes.xml was listed in the engine_dependencies.xml file.")
break
if not surfacetypes_in_dependencies:
logger.info("Surfacetypes.xml was not listed in the engine_dependencies.xml file.")
_, output = asset_processor.batch_process(capture_output=True,
extra_params="--dsp=%engine_dependencies.xml")
log = APOutputParser(output)
for _ in log.get_lines(run=-1, contains=["surfacetypes.xml", "Missing"]):
surfacetypes_missing_logline = True
assert surfacetypes_missing_logline, "Surfacetypes.xml not seen in the batch log as missing."
# Add the schema file which allows our xml parser to understand dependencies for our engine_dependencies file
asset_processor.add_relative_source_asset(os.path.join("Assets", "Engine", "Schema", "enginedependency.xmlschema"))
asset_processor.batch_process()
_, output = asset_processor.batch_process(capture_output=True,
extra_params="--dsp=%engine_dependencies.xml")
log = APOutputParser(output)
surfacetypes_missing_logline = False
for _ in log.get_lines(run=-1, contains=["surfacetypes.xml", "Missing"]):
surfacetypes_missing_logline = True
assert not surfacetypes_missing_logline, "Surfacetypes.xml not seen in the batch log as missing."
schemas = [
("C16877167", ".ent"),
("C16877168", "Environment.xml"),