Skip to content

Add new post check for share folder - #675

Closed
Jack·Boos·Yu (JackBoosY) wants to merge 20 commits into
microsoft:mainfrom
JackBoosY:dev/jack/new-lint-postbuild-check
Closed

Add new post check for share folder#675
Jack·Boos·Yu (JackBoosY) wants to merge 20 commits into
microsoft:mainfrom
JackBoosY:dev/jack/new-lint-postbuild-check

Conversation

@JackBoosY

Copy link
Copy Markdown
Contributor

Check for non-lowercase share folder.

Comment thread src/vcpkg/postbuildlint.cpp Outdated
Comment thread src/vcpkg/postbuildlint.cpp Outdated
Comment thread src/vcpkg/postbuildlint.cpp
Comment thread src/vcpkg/postbuildlint.cpp Outdated
Comment thread src/vcpkg/postbuildlint.cpp Outdated
Comment thread src/vcpkg/postbuildlint.cpp Outdated
@JackBoosY

Copy link
Copy Markdown
Contributor Author

Robert Schumacher (@ras0219-msft) For regression, should I split the message to fix it?

* Move FolderNameMismatchedCasing to messages.h / messages.cpp
* Remove trailing \n
* Regenerate jsons

@BillyONeal Billy O'Neal (BillyONeal) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I fixed the build failures and I think the change is overall good. Because it adds a new post-build lint we need to pre-run it on the catalog to double check that the world won't break when deployed. Robert Schumacher (@ras0219-msft) Can you confirm you're OK with this now and I can kick that off?

@BillyONeal

Copy link
Copy Markdown
Member

Robert Schumacher (@ras0219-msft) For regression, should I split the message to fix it?

The error was complaining that the localized message ended with \n, thus being likely to create a bug that was present here where it was passed to println doubling the terminal \ns. This check was added in #553

@ras0219-msft

Copy link
Copy Markdown
Collaborator

LGTM. Billy O'Neal (@BillyONeal) if you could kick off the test that would be great!

@dg0yt

Copy link
Copy Markdown
Contributor

Well, you can just use the file lists from CI... I find

  • more than 7000 installed files matching :/share/[A-Z]
  • more then 600 CMake configs, by :/share/[A-Z].+/.*onfig.cmake
  • more then 60 port dirs, by :/share/[A-Z].+/vcpkg_abi

@autoantwort

Copy link
Copy Markdown
Contributor

Why folders in the share folder should be always lowercase?

@BillyONeal

Copy link
Copy Markdown
Member

Well, you can just use the file lists from CI... I find

  • more than 7000 installed files matching :/share/[A-Z]
  • more then 600 CMake configs, by :/share/[A-Z].+/.*onfig.cmake
  • more then 60 port dirs, by :/share/[A-Z].+/vcpkg_abi

Good point!

Why folders in the share folder should be always lowercase?

The name vcpkg creates is always, for example, share/${PORT}/vcpkg_abi_info.txt, and ${PORT} is always lowercase. When there are capital ones, it means that users will get different behavior on case sensitive vs. case insensitive file systems, which has been the source of a lot of broken behavior. (like 'works on linux but not windows because the directory names differed only in case')

@BillyONeal

Billy O'Neal (BillyONeal) commented Sep 19, 2022

Copy link
Copy Markdown
Member

Why folders in the share folder should be always lowercase?

Example we want the new check to block microsoft/vcpkg#26284 (comment)

@dg0yt

Copy link
Copy Markdown
Contributor

Port ogre installs resources to share/OGRE. To be patched?

@dg0yt

Copy link
Copy Markdown
Contributor

Port ogre installs resources to share/OGRE. To be patched?

This mirrors the headers in include/OGRE and the plugins in lib/OGRE.

…ev/jack/new-lint-postbuild-check

# Conflicts:
#	include/vcpkg/base/messages.h
#	locales/messages.en.json
#	locales/messages.json
#	src/vcpkg/base/messages.cpp
@ras0219-msft

Copy link
Copy Markdown
Collaborator

Port ogre installs resources to share/OGRE. To be patched?

That's a great point. We do need a policy setting to control the check. Then, we should evaluate whether ogre should disable the policy or whether patching is appropriate. I don't think that matching lib/OGRE/ or include/OGRE/ is by itself sufficient, but if there is an expectation of hardcoded paths containing share/OGRE/ then we may need to simply accept the differences per host platform.

@ras0219-msft

Copy link
Copy Markdown
Collaborator

Jack·Boos·Yu (@JackBoosY) Once again, thank you for all your hard work on vcpkg! Would you like to continue this PR or should we take ownership and bring it to completion?

@JackBoosY

Copy link
Copy Markdown
Contributor Author

Robert Schumacher (@ras0219-msft) I will continue this PR.

@JackBoosY

Copy link
Copy Markdown
Contributor Author

Looks good now.

@dg0yt

Copy link
Copy Markdown
Contributor

It still needs a policy to disable it, and changes to app. 60 ports.

@JackBoosY

Copy link
Copy Markdown
Contributor Author

@dg0yt

Copy link
Copy Markdown
Contributor

The feedback is only four days old (#675 (comment))

We do need a policy setting to control the check.

@JackBoosY

Copy link
Copy Markdown
Contributor Author

The feedback is only four days old (#675 (comment))

We do need a policy setting to control the check.

Ah I'm blind...

@JackBoosY

Copy link
Copy Markdown
Contributor Author

So what about the 60+ ports / port OGRE?

@dg0yt

Copy link
Copy Markdown
Contributor

FTR at least to open PRs add new ports with mixed case directories via vpckg_cmake_config_fixup(PACKAGE_NAME <Mixed>). Maybe it would be a good idea to start with improving this function: Convert input PACKAGE_NAME to lower case directory name where feasible.

@JackBoosY

Jack·Boos·Yu (JackBoosY) commented Feb 28, 2023

Copy link
Copy Markdown
Contributor Author

FTR at least to open PRs add new ports with mixed case directories via vpckg_cmake_config_fixup(PACKAGE_NAME <Mixed>). Maybe it would be a good idea to start with improving this function: Convert input PACKAGE_NAME to lower case directory name where feasible.

Will do that after microsoft/vcpkg#29880 microsoft/vcpkg#29882 microsoft/vcpkg#29883 microsoft/vcpkg#29884 and microsoft/vcpkg#29918 are merged.

@JackBoosY

Copy link
Copy Markdown
Contributor Author

Depends on microsoft/vcpkg#31053

@BillyONeal

Copy link
Copy Markdown
Member

This is a check we wanted but it doesn't seem that we'll be able to given the backcompat problems reported above :(

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.

6 participants