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

[astr] New port #38734

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft

[astr] New port #38734

wants to merge 8 commits into from

Conversation

bytebunny
Copy link
Contributor

  • Changes comply with the maintainer guide.
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx.
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

@MonicaLiu0311 MonicaLiu0311 self-assigned this May 15, 2024
@MonicaLiu0311 MonicaLiu0311 added the category:new-port The issue is requesting a new library to be added; consider making a PR! label May 15, 2024
@MonicaLiu0311 MonicaLiu0311 changed the title Astr port [astr] New port May 15, 2024
ports/astr/usage Outdated Show resolved Hide resolved
@MonicaLiu0311
Copy link
Contributor

usage:

The package astr provides CMake targets:

     find_package(astr CONFIG REQUIRED)
     target_link_libraries(main PRIVATE a4z::astr)

When testing usage, the following error occurs:

1> [CMake] CMake Error at G:/astr/scripts/buildsystems/vcpkg.cmake:859 (_find_package):
1> [CMake]   Could not find a package configuration file provided by "astr" with any of
1> [CMake]   the following names:
1> [CMake] 
1> [CMake]     astrConfig.cmake
1> [CMake]     astr-config.cmake
1> [CMake] 
1> [CMake]   Add the installation prefix of "astr" to CMAKE_PREFIX_PATH or set
1> [CMake]   "astr_DIR" to a directory containing one of the above files.  If "astr"
1> [CMake]   provides a separate development package or SDK, be sure it has been
1> [CMake]   installed.
1> [CMake] Call Stack (most recent call first):
1> [CMake]   CMakeUsage/CMakeLists.txt:16 (find_package)
1> [CMake] -- Configuring incomplete, errors occurred!

@bytebunny
Copy link
Contributor Author

Could you please check if your vcpkg installation actually contains the astr port? It should be under G:/astr/ports/ I guess.

@a4z
Copy link
Contributor

a4z commented May 15, 2024

this is indeed interesting, looking at the build artifacts from the checks, e.g. https://dev.azure.com/vcpkg/c1ee48cb-0df2-4ab3-8384-b1df5a79fe53/_apis/build/builds/102939/artifacts?artifactName=file%20lists%20for%20x64-windows&api-version=7.1&%24format=zip , the required cmake files exists, see the file listing

astr:x64-windows:/include/a4z/astr.hpp
astr:x64-windows:/include/a4z/filename.hpp
astr:x64-windows:/include/a4z/typename.hpp
astr:x64-windows:/share/astr/astrConfig.cmake
astr:x64-windows:/share/astr/astrConfigVersion.cmake
astr:x64-windows:/share/astr/astrTargets.cmake
astr:x64-windows:/share/astr/copyright
astr:x64-windows:/share/astr/usage
astr:x64-windows:/share/astr/vcpkg.spdx.json
astr:x64-windows:/share/astr/vcpkg_abi_info.txt
doctest:x64-windows:/include/doctest/doctest.h
doctest:x64-windows:/include/doctest/extensions/doctest_mpi.h
doctest:x64-windows:/include/doctest/extensions/doctest_util.h
doctest:x64-windows:/include/doctest/extensions/mpi_reporter.h
doctest:x64-windows:/include/doctest/extensions/mpi_sub_comm.h
doctest:x64-windows:/share/doctest/copyright
doctest:x64-windows:/share/doctest/doctest.cmake
doctest:x64-windows:/share/doctest/doctestAddTests.cmake
doctest:x64-windows:/share/doctest/doctestConfig.cmake
doctest:x64-windows:/share/doctest/doctestConfigVersion.cmake
doctest:x64-windows:/share/doctest/doctestTargets.cmake
doctest:x64-windows:/share/doctest/vcpkg.spdx.json
doctest:x64-windows:/share/doctest/vcpkg_abi_info.txt
vcpkg-cmake-config:x64-windows:/share/vcpkg-cmake-config/copyright
vcpkg-cmake-config:x64-windows:/share/vcpkg-cmake-config/vcpkg-port-config.cmake
vcpkg-cmake-config:x64-windows:/share/vcpkg-cmake-config/vcpkg.spdx.json
vcpkg-cmake-config:x64-windows:/share/vcpkg-cmake-config/vcpkg_abi_info.txt
vcpkg-cmake-config:x64-windows:/share/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
vcpkg-cmake:x64-windows:/share/vcpkg-cmake/copyright
vcpkg-cmake:x64-windows:/share/vcpkg-cmake/vcpkg-port-config.cmake
vcpkg-cmake:x64-windows:/share/vcpkg-cmake/vcpkg.spdx.json
vcpkg-cmake:x64-windows:/share/vcpkg-cmake/vcpkg_abi_info.txt
vcpkg-cmake:x64-windows:/share/vcpkg-cmake/vcpkg_cmake_build.cmake
vcpkg-cmake:x64-windows:/share/vcpkg-cmake/vcpkg_cmake_configure.cmake
vcpkg-cmake:x64-windows:/share/vcpkg-cmake/vcpkg_cmake_install.cmake

however, there is a slightly improved version now already online, and there is also an option to build without tests so the doctest dependency goes away (cmake standard, -DBUILD_TESTING=OFF

I would also like to say thank you for bringing astr to vcpkg, I hope I can help making this PR pass


vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT})

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this header-only?
Then add an early

set(VCPKG_BUILD_TYPE release) # header-only

and

Suggested change
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug" "${CURRENT_PACKAGES_DIR}/lib")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")

is enough.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it is a header-only library,

The suggested change in the CMakeLists.txt file is already part of the 0.2.1 update, which I released earlier today.

@bytebunny , could you please add the 2 changes to the port file,
-DBUILD_TESTING=OFF and set(VCPKG_BUILD_TYPE release) # header-only
and point to the 0.2.1 release, then your PR should validate smoothly.
Thank you so much for your effort!

ports/astr/usage Outdated Show resolved Hide resolved
@MonicaLiu0311
Copy link
Contributor

usage:

The package astr provides CMake targets:

     find_package(astr CONFIG REQUIRED)
     target_link_libraries(main PRIVATE a4z::astr)

When testing usage, the following error occurs:

>------ Build All started: Project: CMakeUsage, Configuration: x64-Debug ------
  MSBuild version 17.9.8+b34f75857 for .NET Framework
  
    1>Checking Build System
    Building Custom Rule C:/Users/monica/source/repos/CMakeUsage/CMakeUsage/CMakeLists.txt
    CMakeUsage.cpp
G:\astr\installed\x64-windows\include\a4z\astr.hpp(152,13): error C2144: syntax error: 'bool' should be preceded by ';' 
    (compiling source file '../../../../CMakeUsage/CMakeUsage.cpp')
    

Build All failed.

@a4z
Copy link
Contributor

a4z commented May 17, 2024

Can you please explain the test setup, @MonicaLiu0311

astr build and tests with all 3 major compiler in github CI
https://github.com/a4z/astr/actions/runs/9100280677

it's used extensive in https://github.com/a4z/zq, which also builds on Linux OSX and Windows
I know about other places that use it even in more cross compile scenarios,

and the line you refere to is total valid (modern) C++
https://github.com/a4z/astr/blob/e897af0cd083c4cf778885e60f14f40e23ddd78b/include/a4z/astr.hpp#L152

so I am confused, astr is a C++20 library, the only explanation is that you test it with a compiler / flags that has not sufficient c++20 support, but that should not be a blocker for packaging

@bytebunny
Copy link
Contributor Author

@MonicaLiu0311, sorry, forgot to remove the previous version. Thank you for spotting it!

@MonicaLiu0311
Copy link
Contributor

The usage test passed on x64-windows (header files found):

astr provides CMake targets:

     find_package(astr CONFIG REQUIRED)
     target_link_libraries(main PRIVATE a4z::astr)

@MonicaLiu0311 MonicaLiu0311 added the info:reviewed Pull Request changes follow basic guidelines label May 17, 2024
@MonicaLiu0311
Copy link
Contributor

This is a new library created two weeks ago, without the same name, similar to #38265.

@vicroms
Copy link
Member

vicroms commented May 23, 2024

Hi @bytebunny

We are considering new acceptance criteria for ports in the vcpkg registry.

Given that this is a new library with no pre-existing user base and it’s not part of a well stablished suite of libraries, we believe that it is a good candidate for self-hosting in a custom registry. Users will still be able to install your library with vcpkg using either the registries or overlay ports features; and you get full control of when you update the port and the changes it includes.

Would you be interested in setting up a custom registry for your library? We can aid setting up your registry and providing instructions for your users to install your vcpkg port.

We are also interested in receiving feedback regarding the suggested alternative if you decide to give it a try.

I'm leaving this PR as a draft to serve as a way of communication with you regarding the suggested alternative of self-hosting this port. Feel free to use this thread to request assistance with said task.

@vicroms vicroms marked this pull request as draft May 23, 2024 04:34
@vicroms vicroms added the requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. label May 23, 2024
@bytebunny
Copy link
Contributor Author

Hi @vicroms,

Would you be interested in setting up a custom registry for your library? We can aid setting up your registry and providing instructions for your users to install your vcpkg port.

The link you provided does not work (https://learn.microsoft.com/en-us/produce/publish-to-a-git-registry).
Did you mean this one: https://learn.microsoft.com/en-us/vcpkg/produce/publish-to-a-git-registry ?

We are also interested in receiving feedback regarding the suggested alternative if you decide to give it a try.

Do you mean the custom registry? We already do that at work. I just thought more people could get the package out-of-the-box.

I'm leaving this PR as a draft to serve as a way of communication with you regarding the suggested alternative of self-hosting this port. Feel free to use this thread to request assistance with said task.

Thank you. It would be helpful to fix the link to the documentation. There is also a second library that uses astr via fetch content that should also be available, this one: https://github.com/a4z/zq

@vicroms
Copy link
Member

vicroms commented May 29, 2024

Thanks for pointing out the broken link, I've fixed it in my original comment.

We are gathering more data on the usage of custom registries and overlay ports as alternatives for packages in the main registry. Is your custom registry private? Would you be willing to provide a public version of the registry?

With a public version of your registry you could provide instructions in astr's README to install the port using the registry (or an overlay port):

To install this library with vcpkg follow these steps:
Add the az4 custom registry to your vcpkg-configuration.json file

"registries" [{
  "kind": "git",
  "repository": "https://github.com/az4/vcpkg-registry",
  "baseline": "<latest commit ID>",
  "packages": [ "astr" ]
}]

You can install this package as an overlay port using these steps:

git clone https://github.com/az4/vcpkg-registry
$env:AZ4_VCPKG_PORTS="C:/path/to/az4-vcpkg-registry/ports"
$env:VCPKG_OVERLAY_PORTS="$env:AZ4_VCPKG_PORTS;$env:VCPKG_OVERLAY_PORTS"
vcpkg install astr

@a4z
Copy link
Contributor

a4z commented Jun 1, 2024

Thank you for the information, @vicroms

There are commercial places using astr with private registries; those can not be shared.

When I find time, I can try to create a mini registry on my GitHub space with astr and zq
and also provide documentation on how to use this.

Since I have to do that in my spare time, I can make no promise about how fast that will happen
but it seems to be a manageable and not too huge task, so probably it will happen before summer (no guarantee, though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:reviewed Pull Request changes follow basic guidelines requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants