Bug 226221 - GH_TUPLE fails to deal with submodules inside a submodule
Summary: GH_TUPLE fails to deal with submodules inside a submodule
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-26 17:40 UTC by Guangyuan Yang
Modified: 2018-03-05 10:35 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guangyuan Yang freebsd_committer freebsd_triage 2018-02-26 17:40:17 UTC
When fetching pdf-viewer (a submodule of the port) with GH_TUPLE as following:

GH_TUPLE=       electron:pdf-viewer:a5251e4:pdf_viewer/vendor/pdf_viewer

pdf-viewer's files will be extracted to work/electron-4dab824/vendor/pdf_viewer, which is expected.

When fetching pdf-viewer and grit (a submodule of pdf-viewer) with GH_TUPLE as following:

GH_TUPLE=       electron:pdf-viewer:a5251e4:pdf_viewer/vendor/pdf_viewer \
                yzgyyang:grit:9536fb6:grit/vendor/pdf_viewer/vendor/grit

I expect that pdf-viewer will be extracted first to work/electron-4dab824/vendor/pdf_viewer and grit be extracted later to work/electron-4dab824/vendor/pdf_viewer/vendor/grit. However, in this case, pdf-viewer got extracted to work/electron-4dab824/vendor/pdf_viewer/pdf-viewer-a5251e4/ while grit still be extracted to work/electron-4dab824/vendor/pdf_viewer/vendor/grit.

Specifically, please use this for testing: https://github.com/yzgyyang/freebsd-ports-electron/tree/7fc215740fad181fd946009cc4e0f605a62a09fc
Comment 1 Mathieu Arnold freebsd_committer freebsd_triage 2018-02-27 13:16:29 UTC
Mmmmm, yeah, I am not surprised this does not work. It was not designed taking this into account sub-sub modules.
The renaming targets are not ordered, and, well, it may work if they run in the right order though.
I will have to think about it.
Comment 2 Mathieu Arnold freebsd_committer freebsd_triage 2018-02-27 14:46:18 UTC
A proposed fix is in review D14532.
Comment 3 commit-hook freebsd_committer freebsd_triage 2018-03-01 12:59:47 UTC
A commit references this bug:

Author: mat
Date: Thu Mar  1 12:58:53 UTC 2018
New revision: 463301
URL: https://svnweb.freebsd.org/changeset/ports/463301

Log:
  Fix a sub-submodule extraction problem with GH_SUBDIR.

  The problem is that GH_SUBDIR are handled in a somewhat random manner.  (The
  truth is that in the end of things, they end up being sorted by the group name
  being used in the GH_TUPLE.)

  So if you have a submodule in bar/foo, and a sub-submodule in bar/foo/baz, it
  may happen that foo/bar/baz is handled before foo/bar and then things are
  messed up.

  This makes it so the GH_SUBDIR target handling is sorted first by the
  number of / in the path.  (So, bar/foo is always handled before
  bar/foo/baz.)

  PR:		226221
  Reported by:	ygy
  Sponsored by:	Absolight
  Differential Revision:	https://reviews.freebsd.org/D14532

Changes:
  head/Mk/bsd.sites.mk
Comment 4 commit-hook freebsd_committer freebsd_triage 2018-03-05 08:30:00 UTC
A commit references this bug:

Author: mat
Date: Mon Mar  5 08:29:33 UTC 2018
New revision: 463628
URL: https://svnweb.freebsd.org/changeset/ports/463628

Log:
  Fix a regression on 10.3 introduced in r463301.

  PR:		226221
  Reported by:	mmokhi
  Sponsored by:	Absolight

Changes:
  head/Mk/bsd.sites.mk
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-03-05 10:35:48 UTC
A commit references this bug:

Author: mat
Date: Mon Mar  5 10:35:36 UTC 2018
New revision: 463643
URL: https://svnweb.freebsd.org/changeset/ports/463643

Log:
  Bring in the sub-submodule extraction problem fix from USE_GITHUB.

  PR:		226221
  Sponsored by:	Absolight

Changes:
  head/Mk/bsd.sites.mk