Skip to content

modernize many ports#6578

Closed
cenit wants to merge 0 commit intomicrosoft:masterfrom
cenit:dev/cenit/modernize
Closed

modernize many ports#6578
cenit wants to merge 0 commit intomicrosoft:masterfrom
cenit:dev/cenit/modernize

Conversation

@cenit
Copy link
Copy Markdown
Contributor

@cenit cenit commented May 23, 2019

Work in progress towards the idea of using a FATAL_ERROR for unmerged patches (related to updates that broke them without any notice and has been very dangerous in the past)

@cenit
Copy link
Copy Markdown
Contributor Author

cenit commented May 23, 2019

This pr MUST NOT CONTAIN any improvement nor any update to any port. It is just a review of portfiles to make them adhere better to CMake standards and vcpkg's best practices.
Any help is very appreciated, just let me know if you want to participate

@cenit
Copy link
Copy Markdown
Contributor Author

cenit commented May 23, 2019

This hypothesis of course means that any regression is really unexpected, but will be fixed of course, with the least impact possible on the port itself.
Any big broken port which would emerge, will be treated in a separate PR

endif()

vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/lcm)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

looks like the arguments is not even required if vcpkg_copy_tool_dependencies has a reasonable default

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

which I didn't even check tbh

file(COPY ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/theia)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/theia/license.txt ${CURRENT_PACKAGES_DIR}/share/theia/copyright)
file(COPY ${SOURCE_PATH}/data/camera_sensor_database_license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/theia)
file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

after reaching this file this should probably a function like: vcpkg_install_copyright or vcpkg_install_license just to make it shorter. The only thing required is the source name/location of the file to copy everything else is always the same.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was thinking about the same. Maybe for now just putting the license at the end with the same signature everywhere is enough. It may become very easy later to just replace it with a custom vcpkg function

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we've been using configure_file() in modern ports for this purpose:

configure_file(${SOURCE_PATH}/license.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ok, even if for me configure_file means that the input file will be processed to become the output file. Why? To simplify the signature and have only “to” and “from”?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

configure_file() feels like a hack.

just introduce vcpkg_install_license or vcpkg_copy_license (or name it whatever you find appropiate) which only requires 1 argument which is the relative location of the license to the source_path. Gets rid of all those noise. It could also be made so that it automatically searches for common license filenames.
I mean how many different license names are there in the 1000 ports? 4 to 6 ? We could even call the function searching for the license vcpkg_find_license (just like find_library ;))

${SOURCE_PATH}/license.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY
is just obvious and unnecessary noise.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

vcpkg_install_copyright is a good start, because in the long run copyright should do more checking

Only 4 groups are required:

  1. public domain (no license)
  2. MIT like (no copyleft, can be re licensed)
  3. LGPL like (no copyleft, but needs dll linkage)
  4. GPL like (copyleft, infects, no way out)

Just a few suggestions,

  • Copyright should also be available in the port file, and show up in the search list.
  • Mark problematic ports (Libiconf and liblzma are my favorite enemies currently ;) )
  • Need a way to specify license impact per port feature
  • Care if using a license with a higher number

@cenit
Copy link
Copy Markdown
Contributor Author

cenit commented May 23, 2019

@Neumann-A would you like to join the effort?

@Neumann-A
Copy link
Copy Markdown
Contributor

@cenit sry currently #5543 is binding me too much. I just comment on PRs while waiting that something finishes or when I need a pause from reading through *.log files ;)

@cenit
Copy link
Copy Markdown
Contributor Author

cenit commented May 23, 2019

ok no problem

@Rastaban
Copy link
Copy Markdown
Contributor

I am seeing this on Linux in the CI system with this PR:

./bootstrap-vcpkg.sh: Permission denied

@cenit
Copy link
Copy Markdown
Contributor Author

cenit commented May 24, 2019

It became 644 (permissions) due to using Windows’ git for committing... whoops!

@Fleischner
Copy link
Copy Markdown

Some reviews:

  • The check about path length in some modules seems ill placed. Shouldn't this be moved to the build system scripts into a section with general checks for the platform?

  • I see some repeating patterns where patches need to be applied only for a specific platform. Also patches could be clustered into source patches and build patches.

@heydojo
Copy link
Copy Markdown
Contributor

heydojo commented Jul 20, 2019

It became 644 (permissions) due to using Windows’ git for committing... whoops!

I'd like to advise that someone with access adds a check which ensures the appropriate executable status of all .sh files within the vcpkg tree. Doing so using the CI bot should go some way towards preventing future removal of executable mode status from files which require said status.

@cbezault
Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines
Copy link
Copy Markdown

Pull request contains merge conflicts.

@cbezault
Copy link
Copy Markdown
Contributor

If this is a dead PR we should close it.
Otherwise we should extract the good changes that exist and make new PRs.

@cenit
Copy link
Copy Markdown
Contributor Author

cenit commented Sep 6, 2019

@cbezault I will rebase this PR very soon to continue the work. Sorry for the waiting

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.