Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bansan85
Copy link
Contributor

Fixes #47602

Based on #24119

  • 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.

@bansan85 bansan85 force-pushed the 47602-libcoap branch 3 times, most recently from 16e56fc to e45e04a Compare October 20, 2025 14:33
@bansan85 bansan85 marked this pull request as draft October 20, 2025 14:33
@bansan85
Copy link
Contributor Author

Why does CI fails with:

CMake Error at CMakeLists.txt:726 (configure_file):
  No such file or directory
CMake Error at CMakeLists.txt:726 (configure_file):
  Permission denied

?

CMakeLists.txt:726:

configure_file(${CMAKE_CURRENT_LIST_DIR}/tests/test_common.h.in
               ${CMAKE_CURRENT_LIST_DIR}/tests/test_common.h)

Is there a problem in the CI that breaks the use of configure_file with an output in ${CMAKE_CURRENT_LIST_DIR} ?

If nobody knows, I will comment the line. Its purpose is tests only.

@BillyONeal
Copy link
Member

That will cause the debug and release builds to stomp on each other because you're writing back to the source directory.

You can either not write to the source directory like that (ideally), or you can add DISABLE_PARALLEL_CONFIGURE.

${FEATURE_OPTIONS}
-DENABLE_DOCS=OFF
-DDTLS_BACKEND=openssl
-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON)
Copy link
Member

Choose a reason for hiding this comment

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

@bansan85
Copy link
Contributor Author

@BillyONeal Thanks for the review. The CI should pass now. I will remove the draft tag when CI will succeed.

@BillyONeal
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@bansan85 bansan85 marked this pull request as ready for review October 21, 2025 20:40
@BillyONeal
Copy link
Member

@microsoft-github-policy-service rerun

2 similar comments
@BillyONeal
Copy link
Member

@microsoft-github-policy-service rerun

@bansan85
Copy link
Contributor Author

@microsoft-github-policy-service rerun

# A false condition hardcodes CMAKE_BINARY_DIR:
# CMakeLists.txt:811
# $<$<AND:$<BOOL:${COAP_WITH_LIBTINYDTLS}>,$<BOOL:${USE_VENDORED_TINYDTLS}>>:${CMAKE_BINARY_DIR}/include/tinydtls>
set(VCPKG_POLICY_SKIP_ABSOLUTE_PATHS_CHECK enabled)
Copy link
Member

Choose a reason for hiding this comment

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

Please patch this out rather than setting a VCPKG_POLICY

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment on lines 22 to 23
# There is a configure_file with output in source file.
DISABLE_PARALLEL_CONFIGURE
Copy link
Member

Choose a reason for hiding this comment

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

It's probably worth trying to patch this to fix it. Could you apply obgm/libcoap@0bd03b6 as a patch? For example, starting with:

vcpkg_download_distfile(DLLEXPORT_PATCH
    URLS https://github.com/obgm/libcoap/commit/0bd03b658ed2d75fdb7cb8f6add201b39b428298.patch?full_index=1
    FILENAME obgm-remove-self-configure-file-0bd03b658ed2d75fdb7cb8f6add201b39b428298.patch
    SHA512 0  #fix this to the real SHA :)
)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch. It will fix it.

Comment on lines +21 to +26
"dtls": {
"description": "compile with dtls support",
"dependencies": [
"openssl"
]
},
Copy link
Member

Choose a reason for hiding this comment

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

Can you speak to https://learn.microsoft.com/vcpkg/contributing/maintainer-guide#default-features-should-enable-behaviors-not-apis ? It seems very likely that this fails that requirement.

In particular, just because upstream has a way to change the thing does not mean the vcpkg port needs a feature hooked up for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I took a look in source code. dtls doesn't change API. There is just functions like coap_tls_is_supported / coap_dtls_is_supported that will return 0 or 1 but I didn't found new functions.

I enabled it by default because previous MR did it.

And I would like to have a feature to be able to not depend on openssl.

@BillyONeal BillyONeal marked this pull request as draft October 23, 2025 19:27
@bansan85 bansan85 marked this pull request as ready for review November 3, 2025 14:15
Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

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

Thanks!

@BillyONeal BillyONeal merged commit 98cfb0c into microsoft:master Nov 3, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[New Port Request] libcoap

2 participants