Skip to content

[vcpkg_fixup_cmake_targets] Add NO_PREFIX_CORRECTION#12215

Merged
strega-nil merged 6 commits intomicrosoft:masterfrom
Neumann-A:add_option_disable_prefix_correction
Nov 25, 2020
Merged

[vcpkg_fixup_cmake_targets] Add NO_PREFIX_CORRECTION#12215
strega-nil merged 6 commits intomicrosoft:masterfrom
Neumann-A:add_option_disable_prefix_correction

Conversation

@Neumann-A
Copy link
Contributor

In some cases the applied prefix correction of vcpkg_fixup_cmake_targets is wrong.
The option NO_PREFIX_CORRECTION deactivates the correction of the _IMPORT_PREFIX

@JackBoosY JackBoosY self-assigned this Jul 3, 2020
@JackBoosY JackBoosY added the category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed label Jul 3, 2020
#original folder deepness to CURRENT_PACKAGES_DIR in comparison to the moved to folder deepness which
#is always at least (>=) 2, e.g. share/${PORT}. Currently the code assumes it is always 2 although
#this requirement is only true for the *Config.cmake. The targets are not required to be in the same
#folder as the *Config.cmake!
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like it would be best to fix this to handle the targets case instead of adding a switch to disable and then needing to manually write the same fixup code in every port that uses said switch. Do you have an idea of how difficult that would be?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Calculate relative path from CURRENT_PACKAGES_DIR/<targetfilelocation> to CURRENT_PACKAGES_DIR and count the backticks /.. do the same for CURRENT_PACKAGES_DIR/<newtargetfilelocation> to CURRENT_PACKAGES_DIR and also count the /...

The first count gives the number of get_filename_component to replace while the later defines the number of get_filename_component required. If the count is equal no replacement is necessary. It is not too difficult but probably requires a ton of try and error to just get it to work correctly.

I just added NO_PREFIX_CORRECTION as a quick fix since I need it for one of my personal ports. You can always deprecate the parameter later if you have the above mentioned fix. (And probably not a lot of ports require it.)

@JackBoosY
Copy link
Contributor

JackBoosY commented Jul 20, 2020

waiting for merge #12458 .

@JackBoosY JackBoosY added the depends:different-pr This PR or Issue depends on a PR which has been filed label Jul 20, 2020
@JackBoosY
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JackBoosY JackBoosY removed the depends:different-pr This PR or Issue depends on a PR which has been filed label Jul 21, 2020
@JackBoosY
Copy link
Contributor

JackBoosY commented Jul 23, 2020

boost-iostreams:

CMake Error at D:/installed/arm64-windows/share/boost-build/boost-modular-build.cmake:34 (message):
  The x86 boost-build tools must be installed to build for non-x86/x64
  platforms.  Please run `vcpkg install boost-build:x86-windows`.
Call Stack (most recent call first):
  ports/boost-iostreams/portfile.cmake:13 (boost_modular_build)
  scripts/ports.cmake:79 (include)


Error: Building package boost-iostreams:arm64-windows failed with: BUILD_FAILED

I can't get it, we already build boost-build:x86-windows before build test ports.

itk:x64-osx:

FAILED: bin/itkTestDriver 
: && /Library/Developer/CommandLineTools/usr/bin/c++  -fPIC  -mtune=native -march=corei7 -Wall -Wcast-align -Wdisabled-optimization -Wextra -Wformat=2 -Winvalid-pch -Wno-format-nonliteral -Wpointer-arith -Wshadow -Wunused -Wwrite-strings -funit-at-a-time -Wno-strict-overflow -Wno-deprecated -Wno-invalid-offsetof -Wno-undefined-var-template -Woverloaded-virtual  -g -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -fPIE -Xlinker -pie Modules/Core/TestKernel/src/CMakeFiles/itkTestDriver.dir/itkTestDriver.cxx.o  -o bin/itkTestDriver  lib/libITKIOBMP-5.0.a  lib/libITKIOGDCM-5.0.a  lib/libITKIOGIPL-5.0.a  lib/libITKIOJPEG-5.0.a  lib/libITKIOMeshBYU-5.0.a  lib/libITKIOMeshFreeSurfer-5.0.a  lib/libITKIOMeshGifti-5.0.a  lib/libITKIOMeshOBJ-5.0.a  lib/libITKIOMeshOFF-5.0.a  lib/libITKIOMeshVTK-5.0.a  lib/libITKIOMeta-5.0.a  lib/libITKIONIFTI-5.0.a  lib/libITKIONRRD-5.0.a  lib/libITKIOPNG-5.0.a  lib/libITKIOTIFF-5.0.a  lib/libITKIOVTK-5.0.a  lib/libITKCommon-5.0.a  lib/libITKIOImageBase-5.0.a  lib/libITKTestKernel-5.0.a  lib/libITKIOBMP-5.0.a  lib/libITKIOGDCM-5.0.a  lib/libitkgdcmMSFF-5.0.a  lib/libitkgdcmDICT-5.0.a  lib/libitkgdcmIOD-5.0.a  lib/libitkgdcmDSED-5.0.a  lib/libitkgdcmCommon-5.0.a  -framework  CoreFoundation  lib/libitkgdcmjpeg8-5.0.a  lib/libitkgdcmjpeg12-5.0.a  lib/libitkgdcmjpeg16-5.0.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/libopenjp2.a  lib/libitkgdcmcharls-5.0.a  lib/libitkgdcmuuid-5.0.a  lib/libITKIOGIPL-5.0.a  lib/libITKIOJPEG-5.0.a  lib/libITKIOMeshBYU-5.0.a  lib/libITKIOMeshFreeSurfer-5.0.a  lib/libITKIOMeshGifti-5.0.a  lib/libITKgiftiio-5.0.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/libexpat.a  lib/libITKIOMeshOBJ-5.0.a  lib/libITKIOMeshOFF-5.0.a  lib/libITKIOMeshVTK-5.0.a  lib/libITKIOMeshBase-5.0.a  lib/libITKQuadEdgeMesh-5.0.a  lib/libITKMesh-5.0.a  lib/libITKIOMeta-5.0.a  lib/libITKMetaIO-5.0.a  lib/libITKIONIFTI-5.0.a  lib/libITKniftiio-5.0.a  lib/libITKznz-5.0.a  lib/libITKTransform-5.0.a  lib/libITKIONRRD-5.0.a  lib/libITKNrrdIO-5.0.a  lib/libITKIOPNG-5.0.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/libpng16d.a  lib/libITKIOTIFF-5.0.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/libtiffd.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/liblzmad.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/libz.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/libjpeg.a  lib/libITKIOVTK-5.0.a  lib/libITKIOImageBase-5.0.a  lib/libITKCommon-5.0.a  /Users/vagrant/Data/installed/x64-osx/debug/lib/libdouble-conversion.a  lib/libitksys-5.0.a  lib/libITKVNLInstantiation-5.0.a  lib/libitkvnl_algo-5.0.a  lib/libitkvnl-5.0.a  lib/libitkv3p_netlib-5.0.a  lib/libitknetlib-5.0.a  lib/libitkvcl-5.0.a  -lm  -lm && :
Undefined symbols for architecture x86_64:
  "gdcm::Rescaler::SetMinMaxForPixelType(double, double)", referenced from:
      itk::GDCMImageIO::Write(void const*) in libITKIOGDCM-5.0.a(itkGDCMImageIO.cxx.o)
ld: symbol(s) not found for architecture x86_64

…e_prefix_correction

# Conflicts:
#	scripts/cmake/vcpkg_fixup_cmake_targets.cmake
@JackBoosY JackBoosY added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Aug 18, 2020
@JackBoosY JackBoosY requested a review from ras0219-msft August 18, 2020 06:27
@BillyONeal BillyONeal removed the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Aug 18, 2020
# Conflicts:
#	scripts/cmake/vcpkg_fixup_cmake_targets.cmake
@strega-nil
Copy link
Contributor

Merging as the errors are unrelated.

@Neumann-A Neumann-A deleted the add_option_disable_prefix_correction branch November 25, 2020 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants