Bug 230651 - multimedia/mpv: Build fails with default Python != 2.7
Summary: multimedia/mpv: Build fails with default Python != 2.7
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Carlos J. Puga Medina
URL: https://github.com/mpv-player/mpv/iss...
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-15 15:42 UTC by Tobias Kortkamp
Modified: 2018-08-15 21:39 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (cpm)


Attachments
patch (1.12 KB, patch)
2018-08-15 17:23 UTC, Carlos J. Puga Medina
no flags Details | Diff
Proposed patch (since 477278 revision) (1.63 KB, patch)
2018-08-15 20:57 UTC, lightside
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Kortkamp freebsd_committer freebsd_triage 2018-08-15 15:42:00 UTC
With DEFAULT_VERSIONS+=python=3.7 the build fails with

===>  Configuring for mpv-0.29.0_2,1
Traceback (most recent call last):
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Node.py", line 576, in ant_iter
    raise StopIteration
StopIteration

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Scripting.py", line 165, in waf_entry_point
    run_commands()
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Scripting.py", line 262, in run_commands
    parse_options()
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Scripting.py", line 214, in parse_options
    Context.create_context('options').execute()
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Options.py", line 271, in execute
    super(OptionsContext, self).execute()
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Context.py", line 205, in execute
    self.recurse([os.path.dirname(g_module.root_path)])
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Context.py", line 287, in recurse
    user_function(self)
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/mpv-0.29.0/wscript", line 927, in options
    opt.load('compiler_c')
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Context.py", line 197, in load
    fun(self)
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Tools/compiler_c.py", line 102, in options
    opt.load_special_tools('c_*.py', ban=['c_dumbpreproc.py'])
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Context.py", line 613, in load_special_tools
    lst = self.root.find_node(waf_dir).find_node('waflib/extras').ant_glob(var)
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Node.py", line 669, in ant_glob
    ret = [x for x in self.ant_iter(accept=accept, pats=[to_pat(incl), to_pat(excl)], maxdepth=kw.get('maxdepth', 25), dir=dir, src=src, remove=kw.get('remove', True))]
  File "/construction/home/tobias/ports/head/multimedia/mpv/work/waf-waf-1.9.8/waflib/Node.py", line 669, in <listcomp>
    ret = [x for x in self.ant_iter(accept=accept, pats=[to_pat(incl), to_pat(excl)], maxdepth=kw.get('maxdepth', 25), dir=dir, src=src, remove=kw.get('remove', True))]
RuntimeError: generator raised StopIteration

I currently force use of Python 2.7 via USES=python:2.7 to work around it.
Comment 1 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-08-15 17:23:09 UTC
Created attachment 196225 [details]
patch

- Update waf to 2.0.9
- Pacify portlint
Comment 2 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-08-15 17:36:19 UTC
(In reply to Tobias Kortkamp from comment #0)

It seems that waf-2.0.9 solves the python 3 issue.
Comment 3 Tobias Kortkamp freebsd_committer freebsd_triage 2018-08-15 18:22:53 UTC
(In reply to Carlos J. Puga Medina from comment #2)
Thanks, this seems to work fine!

The patch is using waf 2.0.9 but it also works fine with the newer waf 2.0.10
from https://waf.io/.
Comment 4 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-08-15 18:35:54 UTC
(In reply to Tobias Kortkamp from comment #3)

Good to know, but we must keep the waf version synchronized with bootstrap.py to avoid other issues.

https://github.com/mpv-player/mpv/blob/master/bootstrap.py#L8
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-08-15 19:35:46 UTC
A commit references this bug:

Author: cpm
Date: Wed Aug 15 19:34:41 UTC 2018
New revision: 477278
URL: https://svnweb.freebsd.org/changeset/ports/477278

Log:
  - Add MASTER_SITES to fetch waf because the previous GH repository has been moved
  - Update waf to 2.0.9 that includes fixes to build Mpv with Python 3 [1]
  - Add OPENAL option [2]
  - Bump PORTREVISION

  PR:		230651 [1], 230650 [2]
  Reported by:	tobik

Changes:
  head/multimedia/mpv/Makefile
  head/multimedia/mpv/distinfo
Comment 6 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-08-15 19:37:23 UTC
Committed, thanks!
Comment 7 lightside 2018-08-15 20:57:20 UTC
Created attachment 196231 [details]
Proposed patch (since 477278 revision)

Hello.

According to description on previous GitHub site for waf source code:
https://github.com/waf-project/waf
the source code was "Moved to https://gitlab.com/ita1024/waf/"

There are available tags for various release versions:
https://gitlab.com/ita1024/waf/tags

Why not to use waf-2.0.9 tag instead?
https://gitlab.com/ita1024/waf/tags/waf-2.0.9

The link to download is available:
https://gitlab.com/ita1024/waf/-/archive/waf-2.0.9/waf-waf-2.0.9.tar.gz

% curl -LI https://gitlab.com/ita1024/waf/-/archive/waf-2.0.9/waf-waf-2.0.9.tar.gz
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 15 Aug 2018 20:46:30 GMT
Content-Type: application/octet-stream
Content-Length: 662544
Accept-Ranges: bytes
Cache-Control: private
Content-Disposition: attachment; filename="waf-waf-2.0.9.tar.gz"
Content-Transfer-Encoding: binary
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-Request-Id: d4bbb614-d7d4-410e-8bca-cce58312e55a
X-Runtime: 0.045270
X-Ua-Compatible: IE=edge
X-Xss-Protection: 1; mode=block
Strict-Transport-Security: max-age=31536000
Content-Security-Policy: object-src 'none'; worker-src https://assets.gitlab-static.net https://gitlab.com blob:; script-src 'self' 'unsafe-inline' 'unsafe-eval' https://assets.gitlab-static.net https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/ https://apis.google.com; style-src 'self' 'unsafe-inline' https://assets.gitlab-static.net; img-src * data: blob:; frame-src 'self' https://www.google.com/recaptcha/ https://content.googleapis.com https://content-compute.googleapis.com https://content-cloudbilling.googleapis.com https://content-cloudresourcemanager.googleapis.com https://*.codesandbox.io; frame-ancestors 'self'; connect-src 'self' https://assets.gitlab-static.net wss://gitlab.com https://sentry.gitlap.com https://customers.gitlab.com; report-uri https://sentry-infra.gitlap.com/api/3/csp-report/?sentry_key=a664fdde83424b43a991f25fa7c78987
% fetch -q https://gitlab.com/ita1024/waf/-/archive/waf-2.0.9/waf-waf-2.0.9.tar.gz
% sha256 waf-waf-2.0.9.tar.gz
SHA256 (waf-waf-2.0.9.tar.gz) = 137b3a2be1e4412f36f9c8e4c33c6e390dd020ba6da27aa24dc4b00407f8ca98
% tar -tf waf-waf-2.0.9.tar.gz | grep waf-light
waf-waf-2.0.9/waf-light

Attached new patch.
Comment 8 Carlos J. Puga Medina freebsd_committer freebsd_triage 2018-08-15 21:20:45 UTC
(In reply to lightside from comment #7)

1) Please, file a new PR for this change.

2) What is the problem with the current MASTER_SITES?

http://www.freehackers.org/~tnagy/release/ is the official website and it is maintained by the main developer.
Comment 9 lightside 2018-08-15 21:39:35 UTC
Comment on attachment 196231 [details]
Proposed patch (since 477278 revision)

(In reply to comment #8)
> Please, file a new PR for this change.
I attached the patch in the same PR where related changes was proposed (attachment #196225 [details]).

(In reply to comment #8)
> http://www.freehackers.org/~tnagy/release/ is the official website and it is
> maintained by the main developer.
I thought that the official site is https://waf.io where https://waf.io/waf-2.0.9.tar.bz2 also available.

% curl -LI https://waf.io/waf-2.0.9.tar.bz2
HTTP/1.1 200 OK
Server: waf.io
Date: Wed, 15 Aug 2018 21:27:44 GMT
Content-Type: application/octet-stream
Content-Length: 645737
Last-Modified: Mon, 09 Jul 2018 14:52:00 GMT
Connection: keep-alive
ETag: "5b437690-9da69"
Strict-Transport-Security: max-age=31536000; includeSubdomains
X-Frame-Options: SAMEORIGIN
Referrer-Policy: no-referrer
X-Content-Type-Options: nosniff
X-Xss-Protection: 1; mode=block;
Content-Security-Policy: default-src 'self' 'unsafe-inline'
Accept-Ranges: bytes
% fetch -q https://waf.io/waf-2.0.9.tar.bz2
% sha256 waf-2.0.9.tar.bz2 
SHA256 (waf-2.0.9.tar.bz2) = cb40489da7a78384dbc8281e6bc3e88005885a5d07de5bf75c29514e05830277
% tar -tf waf-2.0.9.tar.bz2 | grep waf-light
waf-2.0.9/waf-light

Now I read, that http://www.freehackers.org/%7Etnagy/release/ site mentioned as a mirror in README.md file:
https://gitlab.com/ita1024/waf/blob/waf-2.0.9/README.md

Therefore, I obsoleted attachment #196231 [details].
Thanks for explanation.