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 do I use libyal in combination with vcpkg ports? #97

Closed
eyalgolan1337 opened this issue May 1, 2024 · 10 comments
Closed

How do I use libyal in combination with vcpkg ports? #97

eyalgolan1337 opened this issue May 1, 2024 · 10 comments
Assignees
Labels

Comments

@eyalgolan1337
Copy link

Hey, I'm attempting to port a large number of libyal libraries to the package manager vcpkg.
Libraries ports in vcpkg cannot contain bundled libraries not ported by vcpkg as those can create collisions.
This means for every libyal library I want to port I need to port all of it's dependencies (libcerror, libclocale, etc...) this is fine and works perfectly fine in Linux where you can supply the --with-libcerror=yes flag, but there is no such alternative for Windows.

I implemented a vcpkg wrapper for the msvcpp-convert utility, and use it to build on Windows - mirroring the upstream way to build for Windows.
You can take a look at my libcdatetime VCPKG port PR to see an example.
Currently as it stands, the library fails building on Windows because the bundled libcerror that comes with libcdatetime conflicts with the existing libcerror port.
Would love your help in getting this working, porting libyal to vcpkg would make it more accessible and allow porting other libraries that use libyal.

Thanks!

@joachimmetz
Copy link
Member

Libraries ports in vcpkg cannot contain bundled libraries not ported by vcpkg as those can create collisions.

Unfortunately this is not how the libraries are intended to be used.

@joachimmetz joachimmetz self-assigned this May 1, 2024
@joachimmetz joachimmetz changed the title Way to build Windows library without using bundled libyal libraries How do I use libyal in combination with vcpkg ports? May 1, 2024
@eyalgolan1337
Copy link
Author

Libraries ports in vcpkg cannot contain bundled libraries not ported by vcpkg as those can create collisions.

Unfortunately this is not how the libraries are intended to be used.

It's supported on linux/mingw though, using the --with- flag, why the inconsistency?

@joachimmetz
Copy link
Member

It's supported on linux/mingw though, using the --with- flag, why the inconsistency?

so --with- allows to use either a shared library version of the dependency or it will fallback on the local version of dependency. You indicated that "vcpkg cannot contain bundled libraries", so this is not an inconsistency but a limitation of vcpkg that conflicts with intended use case.

@eyalgolan1337
Copy link
Author

It's supported on linux/mingw though, using the --with- flag, why the inconsistency?

so --with- allows to use either a shared library version of the dependency or it will fallback on the local version of dependency. You indicated that "vcpkg cannot contain bundled libraries", so this is not an inconsistency but a limitation of vcpkg that conflicts with intended use case.

vcpkg can contain ports of libraries containing bundled libraries as long as you can override the dependency and use your own version of that bundled library - there are many such cases.
Most libraries contain some kind of bundled dependency but they supply a way to either use a local dependency or the bundled one (much like the --with- flag), my issue is that there is no such option for the msvcpp build system.

In the PR I linked you could see I ported libcerror (dependency of libcdatetime) and then use the vcpkg port of libcerror instead of the bundled libcerror library that comes with libcdatetime.
This work perfectly in posix build systems, on Windows though there is no such flag.

@joachimmetz
Copy link
Member

joachimmetz commented May 1, 2024

This work perfectly in posix build systems, on Windows though there is no such flag.

You are conflating Windows with msvscpp. MinGW and CygWin also run on Windows

vcpkg can contain ports of libraries containing bundled libraries as long as you can override the dependency and use your own version of that bundled library - there are many such cases.

Then vcpkg must have some mechanism similar to configure (autotools) to set up the (msvscpp) build files?

@eyalgolan1337
Copy link
Author

MinGW and CygWin are already supported within the vcpkg port, it's the specifically the msbuild part.
vcpkg indeed has a way to configure, it invokes msbuild - in order to use it I first call your msvcpp-convert script.

@joachimmetz
Copy link
Member

vcpkg indeed has a way to configure, it invokes msbuild - in order to use it I first call your msvcpp-convert script.

And what mechanism does vcpkg provide? you likely need to change https://github.com/libyal/vstools so that it can leverage this mechanism

To my knowledge msbuild has limited support for build configurations compared to autotools. E.g. how do you test if you have the right version of the library as dependency?

@eyalgolan1337
Copy link
Author

vcpkg indeed has a way to configure, it invokes msbuild - in order to use it I first call your msvcpp-convert script.

And what mechanism does vcpkg provide? you likely need to change https://github.com/libyal/vstools so that it can leverage this mechanism

To my knowledge msbuild has limited support for build configurations compared to autotools. E.g. how do you test if you have the right version of the library as dependency?

The mechanism is simply calling msbuild, passing options etc... (I linked the reference above).
Why would I need to change vstools? I wrapped it in vcpkg and I use it to convert the vcproj files into files I can build with msbuild.

@joachimmetz
Copy link
Member

The mechanism is simply calling msbuild, passing options etc...

autotools does more, it checks the version of the dependency and sees if the necessary functions are available. It sets up the build configuration. The functionality of msbuild sounds comparable to make, there is more to the build process. msvscpp supports advanced configuration, not sure how portable this is for msbuild. You might need to make changes how it generates the visual studio project files.

@joachimmetz
Copy link
Member

No additional replies from original reporter, assuming question was answered. Closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants