Skip to content

[yasm/yasm-tool] Incorporate yasm-tool into yasm#18816

Closed
JackBoosY wants to merge 27 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/18746
Closed

[yasm/yasm-tool] Incorporate yasm-tool into yasm#18816
JackBoosY wants to merge 27 commits intomicrosoft:masterfrom
JackBoosY:dev/jack/18746

Conversation

@JackBoosY
Copy link
Contributor

@JackBoosY JackBoosY commented Jul 5, 2021

Since port yasm and yasm-tool repo is same and generate the same files, remove port yasm-tool and switch the related dependency item yasm-tool to yasm.
Add option DYNAMIC_DEPENDS to vcpkg_copy_tool and vcpkg_copy_tool_dependencies to copy the dynamic dependencies (Dynamically load dependencies in code) too tools/${PORT}.

Fixes #18746.

@JackBoosY JackBoosY added category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist category:port-bug The issue is with a library, which is something the port should already support info:internal labels Jul 5, 2021
@JackBoosY
Copy link
Contributor Author

cc @BillyONeal

@PhoebeHui PhoebeHui added the requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. label Jul 5, 2021
@JackBoosY
Copy link
Contributor Author

JackBoosY commented Jul 5, 2021

Note that if the DYNAMIC_DEPENDS change is approved, all ports that call vcpkg_copy_tool_dependencies should be modified.
(Already done that, didn't push to this branch yet)

@JackBoosY JackBoosY requested a review from BillyONeal July 5, 2021 09:32
@JackBoosY JackBoosY added info:world-rebuild category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly labels Jul 5, 2021
@JackBoosY JackBoosY marked this pull request as ready for review July 5, 2021 09:51
@cenit
Copy link
Contributor

cenit commented Jul 6, 2021

note also the DEPENS typo (should be corrected into DEPENDS - or even better DEPENDENCIES?)

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.

I agree with @dg0yt 's feedback

@JackBoosY JackBoosY changed the title [yasm/yasm-tool] Remove port yasm-tool [yasm/yasm-tool] Incorporate yasm-tool into yasm Dec 14, 2021
@JackBoosY
Copy link
Contributor Author

Successfully tested the following affected ports:

  1. mpg123 requires yasm_tool_helper
  2. alac requires vcpkg_copy_tool_dependencies
  3. cpuinfo requires vcpkg_copy_tools

@JackBoosY JackBoosY marked this pull request as ready for review December 14, 2021 09:52
@JackBoosY JackBoosY added the requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. label Dec 14, 2021
@JackBoosY
Copy link
Contributor Author

Ping @dg0yt @ras0219-msft @BillyONeal for review again.

@PhoebeHui PhoebeHui added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Dec 20, 2021
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.

I think this is a good change in concept; I didn't realize that we already had a yasm port that produced the yasm binaries when I added yasm-tool and friends, and smashing that all together is great. However, I don't understand the value we gain by adding things to a shared helper over it, particularly in a way that mixes positional and named parameters.

Can the yasm-tool port just contain the right renames itself?
If that is unreasonable for some reason or we expect this to be common, can we add a new function that copies these dynamic DLL dependencies rather than piggybacking on vcpkg_copy_tool_dependencies and its associated applocal.ps1 baggage?

vcpkg_copy_tool_dependencies(<${CURRENT_PACKAGES_DIR}/tools/${PORT}>)
vcpkg_copy_tool_dependencies(
<${CURRENT_PACKAGES_DIR}/tools/${PORT}>
[DEPENDENCIES <dep1>...]
Copy link
Member

Choose a reason for hiding this comment

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

This documentation suggests that the function uses named arguments but the implementation appears to use positional arguments.

Why can't the yasm port issue the right file(COPY calls itself rather than modifying a shared helper like this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The yasm example shows that there are still other ports that use the same method (load_library) to depend on other libraries, which cann't be analysis by dumpbin.
So this is a common change.

Copy link
Member

Choose a reason for hiding this comment

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

I mean, there are ports that do that, yes, but I'm not seeing what's made clearer about this vs. just issuing the file(COPYs, and doing it like this creates the problems I listed below about mixing positional and named parameters.

function(vcpkg_copy_tool_dependencies tool_dir)
if(ARGC GREATER 1)
cmake_parse_arguments(PARSE_ARGV 0 arg "" "" "DEPENDENCIES")
if(ARGC GREATER 2)
Copy link
Member

Choose a reason for hiding this comment

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

ARGC is going to be greater than 2 if tool_dir and DEPENDENCIES are both used; I don't think we should be mixing up positional and named parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

tool_dir should only be passed one value. what is your opinion?

Copy link
Member

Choose a reason for hiding this comment

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

I don't understand this response. tool_dir is only passed one value, but given

vcpkg_copy_tool_dependencies("C:/this/is/tool_dir" DEPENDENCIES "foo.dll")

ARGC is 3 so we're going to print that warning, which seems unintended.

Copy link
Member

Choose a reason for hiding this comment

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

image

These can't be correct


configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-port-config.cmake.in"
"${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-port-config.cmake" @ONLY)
SET(VCPKG_POLICY_EMPTY_PACKAGE enabled) No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

Should this print a warning that it's now defunct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

According to Robert's comment, we should not remove any ports.
So I think that's okay, both yasm-tool or yasm[tools] can be used.

Copy link
Member

Choose a reason for hiding this comment

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

We can't remove it because that would break people's scripts and stuff, but we can warn that they aren't using the canonical one.

@BillyONeal BillyONeal added requires:author-response and removed info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. labels Dec 22, 2021
@JackBoosY JackBoosY requested a review from BillyONeal December 23, 2021 13:57
@PhoebeHui PhoebeHui marked this pull request as draft January 30, 2022 02:10
@JackBoosY JackBoosY removed the requires:vcpkg-team-review This PR or issue requires someone on the vcpkg team to take a further look. label Jan 30, 2022
@JackBoosY
Copy link
Contributor Author

In favor of #23218.

@JackBoosY JackBoosY closed this Feb 22, 2022
@JackBoosY JackBoosY deleted the dev/jack/18746 branch February 22, 2022 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-bug The issue is with a library, which is something the port should already support category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist category:tool-update The issue is with build tool or build script, which requires update or should be executed correctly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[yasm] Dependent library of yasm binary is missing

7 participants