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

How to solve the following problems when create new ports? #834

Closed
saedrna opened this issue Mar 22, 2017 · 3 comments
Closed

How to solve the following problems when create new ports? #834

saedrna opened this issue Mar 22, 2017 · 3 comments
Labels
category:documentation To resolve the issue, documentation will need to be updated

Comments

@saedrna
Copy link
Contributor

saedrna commented Mar 22, 2017

Hi,

I would like to add a new port following this tutorial, the library to be ported is OpenSceneGraph(osg), which is also cubersome to be built for new comers. But vcpkg has all the dependencies and it is quite easy to be ported.

The port is successfully configured and built, but I have some post-built problems as below.

1, To remove installation of includes for debug. There is the following warning, I think it is easy to handle as described.

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)

2, To not install exe files to bin. OSG has some handy apps to be built, but how to install them? Absolutely, I could disable by -BUILD_OSG_APPLICATIONS=OFF in the profile.cmake, but how to install them? Because these apps are also often used.

The following EXEs were found in /bin and /debug/bin. EXEs are not valid distribution targets.

    D:/build/vcpkg/packages/openscenegraph_x64-windows/bin/osgarchive.exe
    D:/build/vcpkg/packages/openscenegraph_x64-windows/bin/osgconv.exe
    D:/build/vcpkg/packages/openscenegraph_x64-windows/bin/osgfilecache.exe
    D:/build/vcpkg/packages/openscenegraph_x64-windows/bin/osgversion.exe
    D:/build/vcpkg/packages/openscenegraph_x64-windows/bin/osgviewer.exe
    D:/build/vcpkg/packages/openscenegraph_x64-windows/bin/present3D.exe
    D:/build/vcpkg/packages/openscenegraph_x64-windows/debug/bin/osgarchived.exe
    D:/build/vcpkg/packages/openscenegraph_x64-windows/debug/bin/osgconvd.exe
    D:/build/vcpkg/packages/openscenegraph_x64-windows/debug/bin/osgfilecached.exe
    D:/build/vcpkg/packages/openscenegraph_x64-windows/debug/bin/osgversiond.exe
    D:/build/vcpkg/packages/openscenegraph_x64-windows/debug/bin/osgviewerd.exe
    D:/build/vcpkg/packages/openscenegraph_x64-windows/debug/bin/present3Dd.exe
  1. Plugin dlls are not able to be installed with the following warnings. The plugins are dynamically loaded when reading and writing specific files and as said no exports lib is available for them. How to install them?
The following DLLs have no exports:

    D:/build/vcpkg/packages/openscenegraph_x64-windows/debug/bin/osgPlugins-3.5.5/osgdb_3dcd.dll
    D:/build/vcpkg/packages/openscenegraph_x64-windows/debug/bin/osgPlugins-3.5.5/osgdb_3dsd.dll
    D:/build/vcpkg/packages/openscenegraph_x64-windows/debug/bin/osgPlugins-3.5.5/osgdb_acd.dll
    D:/build/vcpkg/packages/openscenegraph_x64-windows/debug/bin/osgPlugins-3.5.5/osgdb_bmpd.dll
    ...
DLLs without any exports are likely a bug in the build script.
  1. And finally is the error to stop the installation to the installed/x64-windows folder.
-- Performing post-build validation done
Found 4 error(s). Please correct the portfile:
    D:\build\vcpkg\ports\openscenegraph\portfile.cmake
Error: Building package openscenegraph:x64-windows failed with: POST_BUILD_CHECKS_FAILED

Is there are some hints on how to solve this? Or direct me to some existing ports with solution to similar problem?

Thanks,

Han

@alexkaratarakis
Copy link
Contributor

Hi!

  1. Indeed, simply copy-pasting the line towards the end of the portfile (i.e. after the build is complete and the headers/binaries are collected) will work. If there is a way for the build to not install them in the first place, that is even better.

  2. In general, vcpkg deals with libraries, not applications. There are some applications (tools) that are included in the portfolio, but this is because they are used during the build of some other library(an example of this is protobuf).
    I am not familiar with the usage of osg, but I believe -BUILD_OSG_APPLICATIONS=OFF is the right thing here. If you believe the exes are required then:

  • delete the debug versions
  • place the release versions under a folder named tools\ (${CURRENT_PACKAGES_DIR}/tools/)
  1. Let me get back to you on this one!

  2. This is not an additional error, it is just a summary of the previous errors. It will go away, once the others checks pass. You are right that this is not clear, so I have reordered the messages with ca3e3c1 so it will now be like this:

Found 4 error(s). Please correct the portfile:
    D:\build\vcpkg\ports\openscenegraph\portfile.cmake
Error: Building package openscenegraph:x64-windows failed with: POST_BUILD_CHECKS_FAILED
-- Performing post-build validation done

Hopefully this makes it clearer that the message is part of the post-build validation.

@saedrna
Copy link
Contributor Author

saedrna commented Mar 23, 2017

Thanks!

For the third problem, after looking into the toolsrc, I think there is no workaround without add additional options in these lines. I hope I'm wrong, if not, maybe adding some options in vcpkg_configure_cmake or other function may do the work?

   error_count += check_exports_of_dlls(dlls, dumpbin_exe);
   error_count += check_uwp_bit_of_dlls(spec.target_triplet().system(), dlls, dumpbin_exe);
   error_count += check_dll_architecture(spec.target_triplet().architecture(), dlls);

@ras0219-msft
Copy link
Contributor

One option is to move the plugins to the tools\ directory. For example:

file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/openscenegraph)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/bin/osgPlugins-3.5.5 ${CURRENT_PACKAGES_DIR}/tools/openscenegraph/plugins)

This way, the core library (which is expected to be linked into the user's application) will still be fully checked.

However, we generally don't have a strong story for libraries with a plugin architecture today because you can't make a choice at compile time; you have to choose at deployment time. We'd like to make this a better experience in the future!

@ras0219-msft ras0219-msft added the category:documentation To resolve the issue, documentation will need to be updated label Mar 25, 2017
pablospe added a commit to pablospe/vcpkg that referenced this issue Jul 14, 2020
…nd *.bat) to `tools/` otherwise I get `POST_BUILD_CHECKS_FAILED`. I followed this recommendation:

microsoft#834 (comment)

Now the *.bat files need to be fixed with the correct path to `tools/`
strega-nil added a commit that referenced this issue Aug 7, 2020
* [colmap] Add port for COLMAP 3.6-dev.3

* Fixed some errors in portfile

* Fixing some errors in portfile. These changes also move the binary (and *.bat) to `tools/` otherwise I get `POST_BUILD_CHECKS_FAILED`. I followed this recommendation:
#834 (comment)

Now the *.bat files need to be fixed with the correct path to `tools/`

* Update ports/colmap/portfile.cmake

Co-authored-by: Robert Schumacher <[email protected]>

* Update ports/colmap/portfile.cmake

Co-authored-by: Robert Schumacher <[email protected]>

* Update ports/colmap/usage

Co-authored-by: Robert Schumacher <[email protected]>

* First working version, the line `vcpkg_copy_tools(TOOL_NAMES colmap AUTO_CLEAN)` helped.

Now it does work running:

    > <vcpkg-root>\vcpkg\packages\colmap_x64-windows\tools\colmap\colmap.exe
    > <vcpkg-root>\vcpkg\packages\colmap_x64-windows\tools\colmap\colmap.exe gui

ToDo: use `vcpkg.json`.

* Using `vcpkg.json` instead of CONTROL file

* Formatting json file:
./vcpkg.exe x-format-manifest --all

* Changes suggested by @ahojnnes (colmap author). Waiting for the 3.7 release  (probably today) to update the `REF` and `SHA512`

* Changes proposed from @ahojnne to handle the internal colmap variables `DGIT_COMMIT_ID` and `DGIT_COMMIT_DATE`

* Enabling TESTS (changes sent by @ahojnnes)

* Updated to lastest tag to 3.6

* Updating to 3.6

* Ceres was missing suitesparse/lapack

* Update ports/colmap/portfile.cmake (commit suggested by JackBoosY)

Co-authored-by: Jack·Boos·Yu <[email protected]>

* format manifest

* Update ports/colmap/portfile.cmake

Co-authored-by: nicole mazzuca <[email protected]>

Co-authored-by: Robert Schumacher <[email protected]>
Co-authored-by: JackBoosY <[email protected]>
Co-authored-by: Jack·Boos·Yu <[email protected]>
Co-authored-by: nicole mazzuca <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:documentation To resolve the issue, documentation will need to be updated
Projects
None yet
Development

No branches or pull requests

4 participants