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

[llvm] fix debug build #17078

Closed
wants to merge 1 commit into from
Closed

Conversation

abique
Copy link
Contributor

@abique abique commented Apr 4, 2021

LLVM did no build in debug because the include directory was removed.
I'm not sure this behavior is correct (llvm port). Yet I did add the policy so it builds.

@PhoebeHui
Copy link
Contributor

@abique, could you report an issue for this? I'm unsure what failures that you encountered.

@abique
Copy link
Contributor Author

abique commented Apr 6, 2021

@PhoebeHui the build failed because the include directory was empty.

@@ -254,10 +254,12 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/tools)

set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This allows the debug build to complete with an empty include folder.

@yurybura
Copy link
Contributor

yurybura commented Apr 6, 2021

@PhoebeHui the build failed because the include directory war empty.

Hello @abique, could you tell which directory is empty? Could you provide also install command to reproduce your issue?
All known empty directories should be removed. You can find the following code:

# Remove empty include directory include/clang-tidy/plugin
file(GLOB_RECURSE INCLUDE_CLANG_TIDY_PLUGIN_FILES "${CURRENT_PACKAGES_DIR}/include/clang-tidy/plugin/*")
if(NOT INCLUDE_CLANG_TIDY_PLUGIN_FILES)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/clang-tidy/plugin")
endif()

# Remove empty include directory /include/flang/Config
file(GLOB_RECURSE INCLUDE_FLANG_CONFIG_FILES "${CURRENT_PACKAGES_DIR}/include/flang/Config/*")
if(NOT INCLUDE_FLANG_CONFIG_FILES)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/flang/Config")
endif()

@abique
Copy link
Contributor Author

abique commented Apr 6, 2021

Build in debug, see the portfile it is doing:
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

@PhoebeHui
Copy link
Contributor

@abique, Removing debug/include folder is by design in vcpkg, it will check the folder in post-build validation step. When you use the port, it will use the headers from include folder.

Include files should not be duplicated into the /debug/include directory. If this cannot be disabled in the project cmake, use
    file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)

@abique
Copy link
Contributor Author

abique commented Apr 7, 2021

In my case I did build the debug with a custom toolchain/triplet with only debug.

@abique
Copy link
Contributor Author

abique commented Apr 7, 2021

Could it be that it is a vcpkg error instead?
The scenario to reproduce it would be to install a library in debug without the release version.

@PhoebeHui
Copy link
Contributor

@abique, this is a known common issue in vcpkg see #6045.

I would suggest to use overlay or custom ports instead.

@abique
Copy link
Contributor Author

abique commented Apr 12, 2021

Is it unsupported to install only the debug version of a port?

@PhoebeHui
Copy link
Contributor

@abique, only install debug or release version of a port may all have issues, or not, it depends what the port that was used. We hope this issue would be solved in future, however, currently we would suggest to solve this issue by using overlay or custom ports.

@abique
Copy link
Contributor Author

abique commented Apr 13, 2021

I understand.
I close this issue.
Thank you :)

@abique abique closed this Apr 13, 2021
@abique abique deleted the llvm-debug-build-fix branch July 12, 2021 05:56
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