LYN-6882 release builds are executing code in asserts (#4305)

* adding Windows/release to PR-validation builds

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* changing trace back to expand to nothing for release

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* typo

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* more fixes

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* fixing some more unused variable cases

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* renaming file in ScriptCanvas that causes a msbuild warning

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>

* reverting a previous change

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
monroegm-disable-blank-issue-2
Esteban Papp 4 years ago committed by GitHub
parent 91925d0f65
commit f3e6adce7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -262,17 +262,17 @@ namespace AZ
#else // !AZ_ENABLE_TRACING
#define AZ_Assert(...) AZ_UNUSED(__VA_ARGS__);
#define AZ_Error(...) AZ_UNUSED(__VA_ARGS__);
#define AZ_ErrorOnce(...) AZ_UNUSED(__VA_ARGS__);
#define AZ_Warning(...) AZ_UNUSED(__VA_ARGS__);
#define AZ_WarningOnce(...) AZ_UNUSED(__VA_ARGS__);
#define AZ_TracePrintf(...) AZ_UNUSED(__VA_ARGS__);
#define AZ_TracePrintfOnce(...) AZ_UNUSED(__VA_ARGS__);
#define AZ_Verify(...) AZ_UNUSED(__VA_ARGS__);
#define AZ_VerifyError(...) AZ_UNUSED(__VA_ARGS__);
#define AZ_VerifyWarning(...) AZ_UNUSED(__VA_ARGS__);
#define AZ_Assert(...)
#define AZ_Error(...)
#define AZ_ErrorOnce(...)
#define AZ_Warning(...)
#define AZ_WarningOnce(...)
#define AZ_TracePrintf(...)
#define AZ_TracePrintfOnce(...)
#define AZ_Verify(expression, ...) AZ_UNUSED(expression)
#define AZ_VerifyError(window, expression, ...) AZ_UNUSED(expression)
#define AZ_VerifyWarning(window, expression, ...) AZ_UNUSED(expression)
#endif // AZ_ENABLE_TRACING

@ -290,7 +290,7 @@ namespace AzToolsFramework
absoluteIconPath = AZ::IO::FixedMaxPath(AZ::Utils::GetEnginePath()) / TreeIconPathOneChild;
break;
}
bool pixmapLoadedSuccess = pixmap.load(absoluteIconPath.c_str());
[[maybe_unused]] bool pixmapLoadedSuccess = pixmap.load(absoluteIconPath.c_str());
AZ_Assert(pixmapLoadedSuccess, "Error loading Branch Icons in SearchEntryDelegate");
m_branchIcons[static_cast<EntryBranchType>(branchType)] = pixmap;

@ -579,10 +579,13 @@ namespace AzToolsFramework
Template& targetTemplate = targetTemplateReference->get();
#if defined(AZ_ENABLE_TRACING)
Template& sourceTemplate = sourceTemplateReference->get();
AZStd::string_view instanceName(instanceIterator->name.GetString(), instanceIterator->name.GetStringLength());
const AZStd::string& targetTemplateFilePath = targetTemplate.GetFilePath().Native();
const AZStd::string& sourceTemplateFilePath = sourceTemplate.GetFilePath().Native();
#endif
LinkId newLinkId = CreateUniqueLinkId();
Link newLink(newLinkId);
@ -911,8 +914,10 @@ namespace AzToolsFramework
return false;
}
#if defined(AZ_ENABLE_TRACING)
Template& sourceTemplate = sourceTemplateReference->get();
Template& targetTemplate = targetTemplateReference->get();
#endif
AZStd::string_view instanceName(instanceIterator->name.GetString(), instanceIterator->name.GetStringLength());

@ -1160,7 +1160,7 @@ namespace AzToolsFramework
AZStd::string unsavedPrefabFileName = unsavedPrefabFileLabel->property("FilePath").toString().toUtf8().data();
AzToolsFramework::Prefab::TemplateId unsavedPrefabTemplateId =
s_prefabSystemComponentInterface->GetTemplateIdFromFilePath(unsavedPrefabFileName.data());
bool isTemplateSavedSuccessfully = s_prefabLoaderInterface->SaveTemplate(unsavedPrefabTemplateId);
[[maybe_unused]] bool isTemplateSavedSuccessfully = s_prefabLoaderInterface->SaveTemplate(unsavedPrefabTemplateId);
AZ_Error("Prefab", isTemplateSavedSuccessfully, "Prefab '%s' could not be saved successfully.", unsavedPrefabFileName.c_str());
}
}

@ -627,8 +627,10 @@ namespace O3DELauncher
AZ_TracePrintf("Launcher", "Application is configured for VFS");
AZ_TracePrintf("Launcher", "Log and cache files will be written to the Cache directory on your host PC");
#if defined(AZ_ENABLE_TRACING)
constexpr const char* message = "If your game does not run, check any of the following:\n"
"\t- Verify the remote_ip address is correct in bootstrap.cfg";
#endif
if (mainInfo.m_additionalVfsResolution)
{
AZ_TracePrintf("Launcher", "%s\n%s", message, mainInfo.m_additionalVfsResolution)

@ -164,7 +164,10 @@ namespace AssetUtilsInternal
AZ::SettingsRegistryMergeUtils::DumperSettings apDumperSettings;
apDumperSettings.m_prettifyOutput = true;
AZ_PUSH_DISABLE_WARNING(5233, "-Wunknown-warning-option") // Older versions of MSVC toolchain require to pass constexpr in the
// capture. Newer versions issue unused warning
apDumperSettings.m_includeFilter = [&AssetProcessorUserSettingsRootKey](AZStd::string_view path)
AZ_POP_DISABLE_WARNING
{
// The AssetUtils only updates the following keys in the registry
// Dump them all out to the setreg file

@ -64,9 +64,11 @@ namespace TestImpact
return !name.starts_with("DISABLED_") && name.find("/DISABLED_") == AZStd::string::npos;
};
AZ_PUSH_DISABLE_WARNING(5233, "-Wunknown-warning-option") // Older versions of MSVC toolchain require to pass constexpr
// in the capture. Newer versions issue unused warning
const auto getDuration = [Keys](const AZ::rapidxml::xml_node<>* node)
AZ_POP_DISABLE_WARNING
{
AZ_UNUSED(Keys);
const AZStd::string duration = node->first_attribute(Keys[DurationKey])->value();
return AZStd::chrono::milliseconds(static_cast<AZStd::sys_time_t>(AZStd::stof(duration) * 1000.f));
};
@ -79,9 +81,11 @@ namespace TestImpact
for (auto testcase_node = testsuite_node->first_node(Keys[TestCaseKey]); testcase_node;
testcase_node = testcase_node->next_sibling())
{
AZ_PUSH_DISABLE_WARNING(5233, "-Wunknown-warning-option") // Older versions of MSVC toolchain require to pass constexpr in the capture.
// Newer versions issue unused warning
const auto getStatus = [Keys](const AZ::rapidxml::xml_node<>* node)
AZ_POP_DISABLE_WARNING
{
AZ_UNUSED(Keys);
const AZStd::string status = node->first_attribute(Keys[StatusKey])->value();
if (status == Keys[RunKey])
{

@ -860,8 +860,9 @@ namespace UnitTest
{
continue;
}
#if defined(AZ_ENABLE_TRACING)
auto formatInfo = CPixelFormats::GetInstance().GetPixelFormatInfo(pixelFormat);
#endif
ColorSpace sourceColorSpace = srcImage->HasImageFlags(EIF_SRGBRead) ? ColorSpace::sRGB : ColorSpace::linear;
ICompressorPtr compressor = ICompressor::FindCompressor(pixelFormat, sourceColorSpace, true);

@ -228,9 +228,9 @@ namespace AZ
response.m_createJobOutputs.push_back(jobDescriptor);
} // for all request.m_enabledPlatforms
const AZStd::sys_time_t createJobsEndStamp = AZStd::GetTimeNowMicroSecond();
const u64 createJobDurationMicros = createJobsEndStamp - shaderAssetBuildTimestamp;
AZ_TracePrintf(ShaderAssetBuilderName, "CreateJobs for %s took %llu microseconds", fullPath.c_str(), createJobDurationMicros );
AZ_TracePrintf(
ShaderAssetBuilderName, "CreateJobs for %s took %llu microseconds", fullPath.c_str(),
AZStd::GetTimeNowMicroSecond() - shaderAssetBuildTimestamp);
response.m_result = AssetBuilderSDK::CreateJobsResultCode::Success;
}

@ -370,7 +370,7 @@ namespace AZ
//It is possible for certain back ends to run out of SRG memory (due to fragmentation) in which case
//we try to compact and re-compile SRGs.
RHI::ResultCode resultCode = m_device->CompactSRGMemory();
[[maybe_unused]] RHI::ResultCode resultCode = m_device->CompactSRGMemory();
AZ_Assert(resultCode == RHI::ResultCode::Success, "SRG compaction failed and this can lead to a gpu crash.");
}

@ -1078,7 +1078,9 @@ namespace AZ
template<typename T>
void ModelAssetBuilderComponent::ValidateStreamSize([[maybe_unused]] size_t expectedVertexCount, [[maybe_unused]] const AZStd::vector<T>& bufferData, [[maybe_unused]] AZ::RHI::Format format, [[maybe_unused]] const char* streamName) const
{
#if defined(AZ_ENABLE_TRACING)
size_t actualVertexCount = (bufferData.size() * sizeof(T)) / RHI::GetFormatSize(format);
#endif
AZ_Error(s_builderName, expectedVertexCount == actualVertexCount, "VertexStream '%s' does not match the expected vertex count. This typically means multiple sub-meshes have mis-matched vertex stream layouts (such as one having more uv sets than the other) but are assigned the same material in the dcc tool so they were merged.", streamName);
}

@ -417,14 +417,16 @@ namespace AZ
template const Color& MaterialFunctor::EditorContext::GetMaterialPropertyValue<Color> (const MaterialPropertyIndex& index) const;
template const Data::Instance<Image>& MaterialFunctor::EditorContext::GetMaterialPropertyValue<Data::Instance<Image>> (const MaterialPropertyIndex& index) const;
void CheckPropertyAccess(const MaterialPropertyIndex& index, const MaterialPropertyFlags& materialPropertyDependencies, [[maybe_unused]] const MaterialPropertiesLayout& materialPropertiesLayout)
void CheckPropertyAccess([[maybe_unused]] const MaterialPropertyIndex& index, [[maybe_unused]] const MaterialPropertyFlags& materialPropertyDependencies, [[maybe_unused]] const MaterialPropertiesLayout& materialPropertiesLayout)
{
#if defined(AZ_ENABLE_TRACING)
if (!materialPropertyDependencies.test(index.GetIndex()))
{
const MaterialPropertyDescriptor* propertyDescriptor = materialPropertiesLayout.GetPropertyDescriptor(index);
AZ_Error("MaterialFunctor", false, "Material functor accessing an unregistered material property '%s'.",
propertyDescriptor ? propertyDescriptor->GetName().GetCStr() : "<unknown>");
}
#endif
}
const MaterialPropertyValue& MaterialFunctor::RuntimeContext::GetMaterialPropertyValue(const MaterialPropertyIndex& index) const

@ -21,7 +21,7 @@ namespace AZ
(*errorHandler)(error_msg);
}
void PngImage_user_warning_fn(png_structp /*png_ptr*/, png_const_charp warning_msg)
void PngImage_user_warning_fn(png_structp /*png_ptr*/, [[maybe_unused]] png_const_charp warning_msg)
{
AZ_Warning("PngFile", false, "%s", warning_msg);
}
@ -301,7 +301,7 @@ AZ_POP_DISABLE_WARNING
return true;
}
void PngFile::DefaultErrorHandler(const char* message)
void PngFile::DefaultErrorHandler([[maybe_unused]] const char* message)
{
AZ_Error("PngFile", false, "%s", message);
}

@ -253,10 +253,12 @@ namespace BenchmarkAssetBuilder
// and 2 bytes of storage for text-based formats.
// This is just an approximate total size because there's a bit of additional overhead
// for asset headers and the other fields in the generated asset.
#if defined(AZ_ENABLE_TRACING)
uint64_t approximateTotalStorageBytes =
(settingsPtr->m_assetStorageType == AZ::DataStream::StreamType::ST_BINARY)
? UINT64_C(1) * totalGeneratedBytes
: UINT64_C(2) * totalGeneratedBytes;
#endif
AZ_TracePrintf(AssetBuilderSDK::InfoWindow,
"Benchmark asset generation will generate %" PRIu64 " assets "

@ -154,7 +154,9 @@ namespace ScriptCanvasEditor
const ScriptEvents::ScriptEvent& definition = data->m_definition;
#if defined(AZ_ENABLE_TRACING)
bool recategorize = previousDefinition ? definition.GetCategory().compare(previousDefinition->GetCategory()) != 0 : false;
#endif
AZ_Warning("ScriptCanvas", !recategorize, "Unable to recategorize ScriptEvents events while open. Please close and re-open the Script Canvas Editor to see the new categorization");
if (definition.GetName().empty())

@ -11,7 +11,7 @@
#include <AzCore/std/containers/vector.h>
#include <ScriptEvents/ScriptEventParameter.h>
#include <ScriptEvents/ScriptEventMethod.h>
#include <ScriptEvents/ScriptEventsMethod.h>
#include <ScriptEvents/Internal/VersionedProperty.h>
namespace ScriptEvents

@ -6,7 +6,7 @@
*
*/
#include "ScriptEvents/ScriptEventMethod.h"
#include "ScriptEvents/ScriptEventsMethod.h"
#include <AzCore/RTTI/BehaviorContext.h>
#include <AzCore/Serialization/SerializeContext.h>

@ -26,7 +26,7 @@
#include <ScriptEvents/Internal/VersionedProperty.h>
#include <ScriptEvents/ScriptEventParameter.h>
#include <ScriptEvents/ScriptEventMethod.h>
#include <ScriptEvents/ScriptEventsMethod.h>
#include <ScriptEvents/ScriptEventsAsset.h>
#include "ScriptEventTestUtilities.h"

@ -10,7 +10,7 @@ set(FILES
Source/ScriptEventsSystemComponent.h
Source/ScriptEventsSystemComponent.cpp
Source/ScriptEventParameter.cpp
Source/ScriptEventMethod.cpp
Source/ScriptEventsMethod.cpp
Source/ScriptEventsAssetRef.cpp
Include/ScriptEvents/ScriptEventsGem.h
Include/ScriptEvents/ScriptEventsAsset.h
@ -23,7 +23,7 @@ set(FILES
Include/ScriptEvents/ScriptEventDefinition.h
Include/ScriptEvents/ScriptEventDefinition.cpp
Include/ScriptEvents/ScriptEvent.h
Include/ScriptEvents/ScriptEventMethod.h
Include/ScriptEvents/ScriptEventsMethod.h
Include/ScriptEvents/ScriptEvent.cpp
Include/ScriptEvents/ScriptEventParameter.h
Include/ScriptEvents/ScriptEventSystem.h

@ -73,7 +73,9 @@ namespace WhiteBox
for (AZ::u32 i = 0; i < triangleCount; ++i)
{
#if defined(AZ_ENABLE_TRACING)
const auto& trianglePositions = trianglesPositions[i];
#endif
const auto& triangleUVs = trianglesUVs[i];
const auto& triangleEdges = trianglesEdges[i];

@ -10,7 +10,11 @@
include_guard()
set(LY_PROJECTS "" CACHE STRING "List of projects to enable, this can be a relative path to the engine root or an absolute path")
# Passing ${LY_PROJECTS} as the default since in project-centric LY_PROJECTS is defined by the project and
# we want to pick up that one as the value of the variable.
# Ideally this cache variable would be defined before the project sets LY_PROJECTS, but that would mean
# it would have to be defined in each project.
set(LY_PROJECTS "${LY_PROJECTS}" CACHE STRING "List of projects to enable, this can be a relative path to the engine root or an absolute path")
#! ly_add_target_dependencies: adds module load dependencies for this target.
#

@ -306,6 +306,7 @@
},
"release_vs2019": {
"TAGS": [
"default",
"nightly-incremental",
"nightly-clean",
"weekly-build-metrics"

Loading…
Cancel
Save