microsoft / vcpkg

C++ Library Manager for Windows, Linux, and MacOS
MIT License
22.01k stars 6.12k forks source link

[tomlplusplus] Add new port #10786

Closed traversaro closed 3 years ago

traversaro commented 4 years ago

Describe the pull request This PR adds a port for the tomlplusplus library. Furthermore, as tomlplusplus installs a CMake configuration file generated by meson, it also fixes the vcpkg_fixup_cmake_targets function to correctly deal with CMake configuration files generated by meson, see https://github.com/mesonbuild/meson/issues/6955 for more info.

traversaro commented 4 years ago

fyi @marzer @GiulioRomualdi

marzer commented 4 years ago

Oh, nice! @traversaro any chance you could update this PR to sync with the current HEAD of toml++? I've been doing some bugfixing and maintenance stuff over the last few days that I've just locked in as minor release v1.2.3.

traversaro commented 4 years ago

Oh, nice! @traversaro any chance you could update this PR to sync with the current HEAD of toml++? I've been doing some bugfixing and maintenance stuff over the last few days that I've just locked in as minor release v1.2.3.

Done! For reference, unless there are some changes in the build system, updating to a new version is just a matter of update the version in the CONTROL and portfile.cmake files, and the hash in the portfile.cmake file.

marzer commented 4 years ago

@traversaro Nice, thanks for the info!

Cheney-W commented 4 years ago

/azp run

azure-pipelines[bot] commented 4 years ago
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.
Cheney-W commented 4 years ago

/azp run

azure-pipelines[bot] commented 4 years ago
Azure Pipelines could not run because the pipeline triggers exclude this branch/path.
Cheney-W commented 4 years ago

/azp run

azure-pipelines[bot] commented 4 years ago
Azure Pipelines successfully started running 1 pipeline(s).
Cheney-W commented 4 years ago

@traversaro Thanks for your PR! tomlplusplus installation failed in following triplets: arm-uwp arm64-windows x64-uwp x64-linux x64-osx Is this result expected? If yes, could you please update the vcpkg/scripts/ci.baseline.txt; if not, could you please fix this issue?

traversaro commented 4 years ago

That is indeed not expected, at least x64-linux was tested explicitly and it was working fine, I will check the CI logs.

traversaro commented 4 years ago

@Cheney-W I tried the port for x64-linux locally on Ubuntu 18.04 and it works fine. How can I get the artifacts with the log error? They seem not to be available in https://dev.azure.com/vcpkg/c1ee48cb-0df2-4ab3-8384-b1df5a79fe53/_build/results?buildId=34726 .

Cheney-W commented 4 years ago

@traversaro You could get the log with following steps: findlog

traversaro commented 4 years ago

Thanks @Cheney-W ! The x64-linux failure message is:

-- Downloading https://github.com/marzer/tomlplusplus/archive/v1.2.3.tar.gz...
-- Extracting source /ci/myagent/_work/3/s/downloads/marzer-tomlplusplus-v1.2.3.tar.gz
-- Using source at /ci/myagent/_work/3/s/buildtrees/tomlplusplus/src/v1.2.3-915b44652d
CMake Error at scripts/cmake/vcpkg_find_acquire_program.cmake:340 (message):
  Could not find meson.  Please install it via your package manager:

      sudo apt-get install meson
Call Stack (most recent call first):
  scripts/cmake/vcpkg_configure_meson.cmake:94 (vcpkg_find_acquire_program)
  ports/tomlplusplus/portfile.cmake:9 (vcpkg_configure_meson)
  scripts/ports.cmake:90 (include)

So I guess this is something that should be addressed on the CI machine, if you think it is not feasible I will mark `x64-linux as a a failing triplet.

Cheney-W commented 4 years ago

@traversaro I tried to install tomlplusplus in my side, and I got the following error after installed meson, I used Ubuntu 18.04.4 LTS (GNU/Linux 5.0.0-1036-azure x86_64) vcpkg/buildtrees/tomlplusplus/config-x64-linux-dbg-out.log:

The Meson build system
Version: 0.45.1
Source dir: vcpkg/buildtrees/tomlplusplus/src/v1.2.3-915b44652d
Build dir: vcpkg/buildtrees/tomlplusplus/x64-linux-dbg
Build type: native build
meson_options.txt:1:0: ERROR: Unknown type feature.
A full log can be found at vcpkg/buildtrees/tomlplusplus/x64-linux-dbg/meson-logs/meson-log.txt

vcpkg/buildtrees/tomlplusplus/x64-linux-dbg/meson-logs/meson-log.txt:

Build started at 2020-04-30T06:01:55.176244
Main binary: /usr/bin/python3
Python system: Linux
The Meson build system
Version: 0.45.1
Source dir: vcpkg/buildtrees/tomlplusplus/src/v1.2.3-915b44652d
Build dir: vcpkg/buildtrees/tomlplusplus/x64-linux-dbg
Build type: native build
meson_options.txt:1:0: ERROR: Unknown type feature.
marzer commented 4 years ago

@Cheney-W meson needs to be version 0.47 or higher

(See https://mesonbuild.com/Build-options.html)

traversaro commented 4 years ago

In that case, probably indeed it make sense to mark x64-linux as unsupported (at least for the CI) and mark it as supported when the CI gets updated to use Ubuntu 20.04 .

Cheney-W commented 4 years ago

@traversaro
About x64-linux, I agree to add tomlplusplus:x64-linux=fail to vcpkg/scripts/ci.baseline.txt. About other failed triplets, could you please fix them?

traversaro commented 4 years ago

@traversaro About x64-linux, I agree to add tomlplusplus:x64-linux=fail to vcpkg/scripts/ci.baseline.txt. About other failed triplets, could you please fix them?

Sorry for the delay. I checked the other triplets and they seems to be failing due to missing support for cross-compilation in https://github.com/microsoft/vcpkg/blob/5deea3b975fe62990973d73a102de818d83ba20c/scripts/cmake/vcpkg_configure_meson.cmake . I would soon look into that and either fix it or add them to the list of expected failures.

traversaro commented 4 years ago

@Cheney-W for the time being I just explicitly disabled the unsupported platforms, and the relative issues are:

As on Linux the port can be successfully installed if you have a recent meson (for example if you are on a recent distro or you installed meson via pip) I added it to the ci.baseline.txt, but i did not explicitly disabled build on Linux via vcpkg_fail_port_install .

Cheney-W commented 4 years ago

@traversaro Thanks for your reply! Could you please add linux into vcpkg_fail_port_install first? You could add some comments about the meson issue in linux before the vcpkg_fail_port_install line. And we will remove linux from vcpkg_fail_port_install once the issue https://github.com/microsoft/vcpkg/issues/11230 and https://github.com/microsoft/vcpkg/issues/6645 is fixed. BTW, could you please add Supports into the control file?

traversaro commented 4 years ago

@traversaro Thanks for your reply! Could you please add linux into vcpkg_fail_port_install first? You could add some comments about the meson issue in linux before the vcpkg_fail_port_install line. And we will remove linux from vcpkg_fail_port_install once the issue #11230 and #6645 is fixed. BTW, could you please add Supports into the control file?

Done in https://github.com/microsoft/vcpkg/commit/ddf14285c401a8c396f1ab8a4cc683f2344bf549 .

Cheney-W commented 4 years ago

/azp run

azure-pipelines[bot] commented 4 years ago
Azure Pipelines successfully started running 1 pipeline(s).
Cheney-W commented 4 years ago

Blocked by CI issue, there is PR: https://github.com/microsoft/vcpkg/pull/11545 trying to fix this issue.

traversaro commented 4 years ago

Blocked by CI issue, there is PR: #11545 trying to fix this issue.

Thanks!

Cheney-W commented 4 years ago

/azp run

azure-pipelines[bot] commented 4 years ago
Azure Pipelines successfully started running 1 pipeline(s).
traversaro commented 4 years ago

I may be wrong, but the CI failures seems not to be related with this PR.

traversaro commented 4 years ago

I rebased the PR on the latest master, and updated it to the latest tomlplusplus release 1.3.0 ( https://github.com/marzer/tomlplusplus/releases/tag/v1.3.0 ).

traversaro commented 4 years ago

x64_osx CI faiilure seems to be unrelated to the content of the PR.

Cheney-W commented 4 years ago

/azp run

azure-pipelines[bot] commented 4 years ago
Azure Pipelines successfully started running 1 pipeline(s).
Cheney-W commented 4 years ago

/azp run

azure-pipelines[bot] commented 4 years ago
Azure Pipelines successfully started running 1 pipeline(s).
dan-shaw commented 4 years ago

/azp run

azure-pipelines[bot] commented 4 years ago
Azure Pipelines successfully started running 1 pipeline(s).
Cheney-W commented 4 years ago

@BillyONeal
qwt:x64-windows failed due to download the source failed, I have tested it in my local machine and it could be installed successfully. So could you please help remove the tomstone of qwt?

BillyONeal commented 4 years ago

Yeah, sorry, I wanted to have a solution that let you target individual hashes for this before the end of the day today but ran out of time (I'm almost asleep as I type this). For now you can push a commit that changes https://github.com/microsoft/vcpkg/blob/250e35a961f6faea691e2266613e671a61bb3ab6/scripts/azure-pipelines/azure-pipelines.yml#L7 to true (and then remove it before merging) or queue a prbuild that does that in the web interface.

Cheney-W commented 3 years ago

/azp run

azure-pipelines[bot] commented 3 years ago
Azure Pipelines successfully started running 1 pipeline(s).
Cheney-W commented 3 years ago

/azp run

azure-pipelines[bot] commented 3 years ago
Azure Pipelines successfully started running 1 pipeline(s).
traversaro commented 3 years ago

I have no idea about what is going on, but thanks a lot @Cheney-W @BillyONeal for the work!

BillyONeal commented 3 years ago

It looks like your 'meson related workaround' breaks other ports.

marzer commented 3 years ago

Thanks for staying on this @traversaro!

@BillyONeal what're the chances of the linux build servers getting a newer version of meson, per https://github.com/microsoft/vcpkg/pull/10786#issuecomment-621695450?

BillyONeal commented 3 years ago

@BillyONeal what're the chances of the linux build servers getting a newer version of meson, per #10786 (comment)?

If someone contributes an edit to provison-image.ps1 that does it, the VM will eventually be updated with it

BillyONeal commented 3 years ago

Sorry, I meant .sh: https://github.com/microsoft/vcpkg/blob/master/scripts/azure-pipelines/linux/provision-image.sh

marzer commented 3 years ago

Ah, thanks. That seems pretty straight-forward. I might do that myself.