Page MenuHomeFreeBSD

x11/polybar: fix build when defaults to python3.6.
ClosedPublic

Authored by rigoletto on Jan 7 2019, 2:02 PM.

Details

Summary

PR 234682

  • fix build with python 3.6 as default python interpreter
  • add gnome to USES (PORTLINT request)
Test Plan

Due to some still unknown reason it is failing with build_fs_violation in poudriere:

=>> Checking for filesystem violations... done
=>> Error: Filesystem touched during build:
extra: usr/local/lib/python3.6/site-packages/xcbgen/__init__.pyc
extra: usr/local/lib/python3.6/site-packages/xcbgen/xtypes.pyc
extra: usr/local/lib/python3.6/site-packages/xcbgen/expr.pyc
extra: usr/local/lib/python3.6/site-packages/xcbgen/align.pyc
extra: usr/local/lib/python3.6/site-packages/xcbgen/error.pyc
extra: usr/local/lib/python3.6/site-packages/xcbgen/matcher.pyc
extra: usr/local/lib/python3.6/site-packages/xcbgen/state.pyc
build of x11/polybar | polybar-3.3.0 ended at Tue Jan  8 00:46:51 -02 2019
build time: 00:00:29
!!! build failure encountered !!!
[00:00:41] Error: Build failed in phase: build_fs_violation
[00:00:41] Cleaning up
[00:00:41] Unmounting file systems

EDIT: also happens on 11.2. I hasn't to set python3.6 as default before.

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

rigoletto created this revision.Jan 7 2019, 2:02 PM
rigoletto edited the test plan for this revision. (Show Details)Jan 7 2019, 2:19 PM
rigoletto edited the summary of this revision. (Show Details)
tcberner added inline comments.Jan 7 2019, 5:13 PM
x11/polybar/files/patch-lib_xpp_CMakeLists.txt
8 ↗(On Diff #52625)

We also have python3. 7 and so on.

I think it might be better to patch in some value given by the framework rather than choosing one.

rigoletto marked an inline comment as done.Jan 7 2019, 11:34 PM
rigoletto updated this revision to Diff 52653.

Add support for all supported python versions.

rigoletto edited the test plan for this revision. (Show Details)Jan 8 2019, 2:47 AM

Add support for all supported python versions.

The thing is, doing it like this you now need to remember to update the patch whenever a new verison appears. This seems too tedious :) -- How about just s/python2 python2.7 python3 python/pyhton${PYTHON_VERSION}/ in the file on that line?

rigoletto added a comment.EditedJan 9 2019, 2:54 PM

Add support for all supported python versions.

The thing is, doing it like this you now need to remember to update the patch whenever a new verison appears. This seems too tedious :) -- How about just s/python2 python2.7 python3 python/pyhton${PYTHON_VERSION}/ in the file on that line?

I was willing to upstream, but maybe isn't worth it. :-)

rigoletto edited the test plan for this revision. (Show Details)Jan 9 2019, 4:54 PM
rigoletto added a comment.EditedJan 9 2019, 4:57 PM
post-patch:
        ${REINPLACE_CMD} -e 's|python2 python2.7 python3 python|${PYTHON_VERSION}|g' \
                ${WRKSRC}/lib/xpp/CMakeLists.txt

This indeed does not work. ${PYTHON_VERSION} is being substituted to python2.7 even with python3.6 as default. Probably because:

USES= python:2.7,build
post-patch:
        ${REINPLACE_CMD} -e 's|python2 python2.7 python3 python|${PYTHON_VERSION}|g' \
                ${WRKSRC}/lib/xpp/CMakeLists.txt

This indeed does not work. ${PYTHON_VERSION} is being substituted to python2.7 even with python3.6 as default. Probably because:

USES= python:2.7,build

Yes that would make it use python2.7 no matter what you have set as default.

+-    COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/generators/cpp_client.py -p "${PYTHON_XCBGEN}"
++    COMMAND ${PYTHON_EXECUTABLE} -B ${PROJECT_SOURCE_DIR}/generators/cpp_client.py -p "${PYTHON_XCBGEN}"

try this ^ for the pyc issue.

rigoletto updated this revision to Diff 52780.Jan 11 2019, 7:59 PM

Fix build_fs_violation.

Thanks to tcberner. :-D

rigoletto updated this revision to Diff 52781.Jan 11 2019, 8:01 PM

Cleaning unneeded lines.

tcberner added inline comments.Jan 12 2019, 5:02 AM
x11/polybar/Makefile
82 ↗(On Diff #52781)

^ only MAKE_ENV is needed, and as you are already patching the CMakeLists.txt, you can add the -B there :) and drop these Varaibles here

rigoletto marked an inline comment as done.Jan 12 2019, 3:23 PM
rigoletto updated this revision to Diff 52794.

Parsing -B instead of using Makefile variables. :-D

tcberner accepted this revision.Jan 13 2019, 6:44 PM

Looks good to me.

This revision is now accepted and ready to land.Jan 13 2019, 6:44 PM
This revision was automatically updated to reflect the committed changes.