Skip to content
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

Restore printing full paths to files containing absolute paths. #1455

Merged

Conversation

BillyONeal
Copy link
Member

@autoantwort points out that it makes sense for those to be clickable.

He also wants us to drop the note: prefix from newlines if we aren't attached to a tty; I'm not sure if that is correct.

@autoantwort points out that it makes sense for those to be clickable.

He also wants us to drop the note: prefix from newlines if we aren't attached to a tty; I'm not sure if that is correct.
@@ -1283,7 +1283,7 @@ DECLARE_MESSAGE(FilesContainAbsolutePath1,
"followed by a list of found files.",
"There should be no absolute paths, such as the following, in an installed package. To suppress this "
"message, add set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled)")
DECLARE_MESSAGE(FilesContainAbsolutePath2, (), "", "Absolute paths were found in the following files")
DECLARE_MESSAGE(FilesContainAbsolutePath2, (), "", "Absolute paths found here")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DECLARE_MESSAGE(FilesContainAbsolutePath2, (), "", "Absolute paths found here")
DECLARE_MESSAGE(FilesContainAbsolutePath2, (), "", "absolute paths found here")

@@ -966,11 +964,9 @@ foreach ($bad_dir in @('build-dir', 'downloads', 'installed-root', 'package-dir'

$expectedFooter = @"
$($PortfilePath): note: Adding a call to ``vcpkg_fixup_pkgconfig()`` may fix absolute paths in .pc files
note: Absolute paths were found in the following files
$($packagesRoot)$($NativeSlash)vcpkg-policy-absolute-paths_$($Triplet): note: the files are relative to `${CURRENT_PACKAGES_DIR} here
note: include/vcpkg-policy-absolute-paths.h
Copy link
Member Author

@BillyONeal BillyONeal Jul 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit sad to lose the form that a user would say in portfile.cmake in order to edit one of these files but making the paths clickable is probably worth it anyway... should we keep printing ${CURRENT_PACKAGES_DIR} here to make it easier for the user to figure that out?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can see arguments either way... though doesn't this apply to most post-lint checks? Maybe it should be centralized (printed once at the beginning or end of the post-lint checks if any fired)

@autoantwort
Copy link
Contributor

Old style

-- Performing post-build validation
warning: There should be no absolute paths, such as the following, in an installed package:
  /Users/leanderSchulten/git_projekte/vcpkg/packages/netgen_arm64-osx
  /Users/leanderSchulten/git_projekte/vcpkg/vcpkg_installed
  /Users/leanderSchulten/git_projekte/vcpkg/buildtrees/netgen
  /Users/leanderSchulten/git_projekte/vcpkg/downloads
Absolute paths were found in the following files:
  /Users/leanderSchulten/git_projekte/vcpkg/packages/netgen_arm64-osx/debug/lib/python3.11/site-packages/netgen/config.py
error: Found 1 post-build check problem(s). To submit these ports to curated catalogs, please first correct the portfile: /Users/leanderSchulten/git_projekte/vcpkg/ports/netgen/portfile.cmake

Current

-- Performing post-build validation
/Users/leanderSchulten/git_projekte/vcpkg/ports/netgen/portfile.cmake: warning: There should be no absolute paths, such as the following, in an installed package. To suppress this message, add set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled)
note: /Users/leanderSchulten/git_projekte/vcpkg/packages
note: /Users/leanderSchulten/git_projekte/vcpkg/vcpkg_installed
note: /Users/leanderSchulten/git_projekte/vcpkg/buildtrees
note: /Users/leanderSchulten/git_projekte/vcpkg/downloads
note: Absolute paths were found in the following files
/Users/leanderSchulten/git_projekte/vcpkg/packages/netgen_arm64-osx: note: the files are relative to ${CURRENT_PACKAGES_DIR} here
note: debug/lib/python3.11/site-packages/netgen/config.py
/Users/leanderSchulten/git_projekte/vcpkg/ports/netgen/portfile.cmake: warning: Found 1 post-build check problem(s). These are usually caused by bugs in portfile.cmake or the upstream build system. Please correct these before submitting this port to the curated registry.

New

-- Performing post-build validation
/Users/leanderSchulten/git_projekte/vcpkg/ports/netgen/portfile.cmake: warning: There should be no absolute paths, such as the following, in an installed package. To suppress this message, add set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled)
note: /Users/leanderSchulten/git_projekte/vcpkg/packages
note: /Users/leanderSchulten/git_projekte/vcpkg/vcpkg_installed
note: /Users/leanderSchulten/git_projekte/vcpkg/buildtrees
note: /Users/leanderSchulten/git_projekte/vcpkg/downloads
/Users/leanderSchulten/git_projekte/vcpkg/packages/netgen_arm64-osx/debug/lib/python3.11/site-packages/netgen/config.py: note: Absolute paths found here
/Users/leanderSchulten/git_projekte/vcpkg/ports/netgen/portfile.cmake: warning: Found 1 post-build check problem(s). These are usually caused by bugs in portfile.cmake or the upstream build system. Please correct these before submitting this port to the curated registry.

@BillyONeal BillyONeal merged commit 2347a7b into microsoft:main Jul 23, 2024
5 checks passed
@BillyONeal BillyONeal deleted the put-full-paths-back-for-absolute branch July 23, 2024 20:47
BillyONeal added a commit to BillyONeal/vcpkg-tool that referenced this pull request Jul 24, 2024
* In microsoft#1455 I missed making absolute lowercase.
* In microsoft#1408 a lot of whitespace was missed leading to output like

error: building vtk:x64-linux failed with: BUILD_FAILEDSee https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.
BillyONeal added a commit that referenced this pull request Jul 24, 2024
* In #1455 I missed making absolute lowercase.
* In #1408 a lot of whitespace was missed leading to output like

error: building vtk:x64-linux failed with: BUILD_FAILEDSee https://learn.microsoft.com/vcpkg/troubleshoot/build-failures?WT.mc_id=vcpkg_inproduct_cli for more information.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants