vcpkg-tool/azure-pipelines/e2e-assets/test-exe-port-template
Billy O'Neal 8014d4b938
Ensure that all post-build checks have skip policies. (#1405)
Also audited for:
* Consistently following the 'IDE error format' pointing to portfile.cmake.
* Consistently referring to the correct skip policy in the error message where applicable.
* Printing paths and other information relative to ${CURRENT_PACKAGES_DIR} or similar as appropriate.
* Debug before release.
* Don't duplicate messages when a problem happens for both debug and release.

Drive by bugfix:

    if (!build_info.policies.is_enabled(BuildPolicy::ONLY_RELEASE_CRT))
    {
        error_count += check_crt_linkage_of_libs(
            build_info, false, debug_libs, debug_lib_info.value_or_exit(VCPKG_LINE_INFO), msg_sink);
    }

was wrong; ONLY_RELEASE_CRT should mean 'these should all be release', not 'we aren't even going to look at debug'.

It is fixed to:

    error_count += check_crt_linkage_of_libs(build_info.crt_linkage,
                                              build_info.policies.is_enabled(BuildPolicy::ONLY_RELEASE_CRT),
                                              debug_libs,
                                              debug_lib_info.value_or_exit(VCPKG_LINE_INFO),
                                              msg_sink);

here.

Drive-by bugfix:
EMPTY_INCLUDE_FOLDER should not block CMAKE_HELPER_PORT from checking that the include folder is, in fact, empty.

Drive-by bugfix:
        if (!violations.empty())
        {
            msg_sink.println_warning(msgPortBugRestrictedHeaderPaths);
            print_paths(msg_sink, violations);
            msg_sink.println(msgPortBugRestrictedHeaderPaths);     // <-- duplicate!
            return LintStatus::PROBLEM_DETECTED;
        }

Drive-by bugfix:
There were duplicate checks for the lib/cmake and debug/lib/cmake directories which even printed the same message; these have been merged.

Drive-by bugfix:
The existing copyright check emitted nonsense output that included full absolute paths like:
warning: The software license must be available at ${CURRENT_PACKAGES_DIR}/share/cmdline/copyright. vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/D:/b/cmdline//LICENSE")
since at least https://github.com/microsoft/vcpkg-tool/pull/1116/
That check has been basically rewritten to use vcpkg_install_copyright if there's only one src directory, and otherwise give up and print them all

Drive-by bugfix:
Several of the outdated CRTs didn't have the debug versions listed. Also, P was duplicated and there was no R for VC6.
2024-06-07 16:53:59 -07:00
..
build.cmd Ensure that all post-build checks have skip policies. (#1405) 2024-06-07 16:53:59 -07:00
portfile.cmake Ensure that all post-build checks have skip policies. (#1405) 2024-06-07 16:53:59 -07:00
test.c Ensure that all post-build checks have skip policies. (#1405) 2024-06-07 16:53:59 -07:00
vcpkg.json Ensure that all post-build checks have skip policies. (#1405) 2024-06-07 16:53:59 -07:00