Skip to content

Commit

Permalink
pg stub: cleanup: remove platforms; add installs_libs no; comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mascguy committed Aug 13, 2022
1 parent 03e0403 commit ef9ce94
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions _resources/port1.0/group/stub-1.0.tcl
Expand Up @@ -17,8 +17,8 @@
# long_description my_long_description
#
# Optional Declarations:
# * maintainers - defaults to 'none'
# * homepage - default is empty
# * maintainers - default: nomaintainer
# * homepage - default: empty
#
# Options:
# * stub.subport_name - override subport name, for README location
Expand All @@ -37,7 +37,6 @@ namespace eval stub {}
options stub.subport_name
default stub.subport_name ${subport}

platforms darwin
license none

# For maintainers and homepage, don't overwrite if already set
Expand All @@ -50,9 +49,11 @@ if {![info exists PortInfo(homepage)]} {
homepage
}

supported_archs noarch
installs_libs no

distfiles
patchfiles
supported_archs noarch
use_configure no

build {}
Expand Down

4 comments on commit ef9ce94

@jmroot
Copy link
Member

@jmroot jmroot commented on ef9ce94 Aug 14, 2022

Choose a reason for hiding this comment

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

If this portgroup is always going to set supported_archs noarch and installs_libs no, it needs to be made very clear that it cannot be used for stubs that stand in for a library dependency. That is, if instead of app A depending directly on library B, you instead have A -> stub -> B. This is because ports need to depend directly on what they use directly, and if they don't, several things including arch checking and license checking break. In the example, A will end up linked to B despite only depending on stub. This can still work, but only if arch and license checking reach B transitively, which is exactly what these options prevent.

@mascguy
Copy link
Member Author

Choose a reason for hiding this comment

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

If this portgroup is always going to set supported_archs noarch and installs_libs no, it needs to be made very clear that it cannot be used for stubs that stand in for a library dependency. That is, if instead of app A depending directly on library B, you instead have A -> stub -> B. This is because ports need to depend directly on what they use directly, and if they don't, several things including arch checking and license checking break. In the example, A will end up linked to B despite only depending on stub. This can still work, but only if arch and license checking reach B transitively, which is exactly what these options prevent.

Great point, we should provide an option for each in the pg. I'll also review the ports I changed, to see if there are any cases where this applies. (There may indeed be one or two, but can't say for sure just yet )

Regardless, I'll tackle this all first thing tomorrow. Thanks for the heads-up!

@mascguy
Copy link
Member Author

Choose a reason for hiding this comment

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

Great point, we should provide an option for each in the pg. I'll also review the ports I changed, to see if there are any cases where this applies. (There may indeed be one or two, but can't say for sure just yet )

Regardless, I'll tackle this all first thing tomorrow. Thanks for the heads-up!

Updated pg stub to support this case, via option stub.lib_dep. Also updated port msgpack, since it falls into this category.

@mascguy
Copy link
Member Author

Choose a reason for hiding this comment

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

Updated pg stub to support this case, via option stub.lib_dep. Also updated port msgpack, since it falls into this category.

And let me know if there's anything else we can do to improve this pg!

Please sign in to comment.