Bug 202609 - www/chromium: convert to option helpers
Summary: www/chromium: convert to option helpers
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:
Keywords: patch
Depends on: 202608
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-24 02:35 UTC by Jan Beich
Modified: 2017-06-30 19:07 UTC (History)
1 user (show)

See Also:
cpm: maintainer-feedback+


Attachments
v0 (unsorted) (4.89 KB, patch)
2015-08-24 02:35 UTC, Jan Beich
no flags Details | Diff
v0.1 (4.88 KB, patch)
2015-08-24 02:52 UTC, Jan Beich
no flags Details | Diff
v1 (unsorted) (4.83 KB, patch)
2015-08-24 07:47 UTC, Jan Beich
no flags Details | Diff
QA: poudriere testport -j 93i386 (212.47 KB, application/x-gzip)
2015-08-24 07:49 UTC, Jan Beich
no flags Details
QA: poudriere testport -j 102amd64 (212.05 KB, application/x-gzip)
2015-08-24 07:49 UTC, Jan Beich
no flags Details
QA with TEST=on: poudriere testport -j 101i386 (513.32 KB, text/plain)
2015-08-24 08:01 UTC, Jan Beich
no flags Details
v1 against review D3410 (unsorted) (4.80 KB, patch)
2015-08-24 11:26 UTC, Jan Beich
no flags Details | Diff
QA for D3410 flavor: poudriere testport -j 93amd64 (213.46 KB, application/x-gzip)
2015-08-24 14:04 UTC, Jan Beich
no flags Details
v1 against r395468 (4.81 KB, patch)
2015-08-28 12:46 UTC, Jan Beich
no flags Details | Diff
v2 against r444567 (5.11 KB, patch)
2017-06-28 11:57 UTC, Carlos J. Puga Medina
no flags Details | Diff
v2 against r444690 (5.11 KB, patch)
2017-06-30 00:07 UTC, Carlos J. Puga Medina
no flags Details | Diff
v2 against r444769 (5.77 KB, patch)
2017-06-30 18:20 UTC, Carlos J. Puga Medina
no flags Details | Diff
v2 against r444769 (5.72 KB, patch)
2017-06-30 18:41 UTC, Carlos J. Puga Medina
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2015-08-24 02:35:42 UTC
Created attachment 160282 [details]
v0 (unsorted)

Proof of concept implementation based on bug 202608. It aggressively converts everything possible into helpers to avoid including bsd.port.mk 3x times.

I didn't test yet. ;)
Comment 1 Jan Beich freebsd_committer freebsd_triage 2015-08-24 02:52:49 UTC
Created attachment 160283 [details]
v0.1

CHOSEN_COMPILER_TYPE is defined too late, after bsd.options.mk is already parsed. I think we can replace it with COMPILER_TYPE since 8.x is EOL. FAVORITE_COMPILER=gcc doesn't convert USES=compiler:c++11-lib into USES=compiler:gcc-c++11-lib, anyway.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2015-08-24 07:47:49 UTC
Created attachment 160291 [details]
v1 (unsorted)

Missed .include bsd.compiler.mk. Now tested.
Comment 3 Jan Beich freebsd_committer freebsd_triage 2015-08-24 07:49:26 UTC
Created attachment 160292 [details]
QA: poudriere testport -j 93i386
Comment 4 Jan Beich freebsd_committer freebsd_triage 2015-08-24 07:49:45 UTC
Created attachment 160293 [details]
QA: poudriere testport -j 102amd64
Comment 5 Jan Beich freebsd_committer freebsd_triage 2015-08-24 08:01:29 UTC
Created attachment 160294 [details]
QA with TEST=on: poudriere testport -j 101i386

Unless I'm missing something the following error looks unrelated. According to components/storage_monitor.gypi 'storage_monitor_test_support' target has another set of of *_linux.cc 'sources' which aren't excluded for 'os_bsd == 1'.

  In file included from ../../components/storage_monitor/test_media_transfer_protocol_manager_linux.cc:5:
  In file included from ../../components/storage_monitor/test_media_transfer_protocol_manager_linux.h:8:
  ../../device/media_transfer_protocol/media_transfer_protocol_manager.h:16:2: error: "Only used on Linux and ChromeOS"
  #error "Only used on Linux and ChromeOS"
   ^
  ../../components/storage_monitor/test_media_transfer_protocol_manager_linux.cc:7:10: fatal error: 'device/media_transfer_protocol/mtp_file_entry.pb.h' file not found
  #include "device/media_transfer_protocol/mtp_file_entry.pb.h"
           ^
  2 errors generated.
Comment 6 Jan Beich freebsd_committer freebsd_triage 2015-08-24 11:26:18 UTC
Created attachment 160304 [details]
v1 against review D3410 (unsorted)

Mostly mechanical conversion. Quoting is different, so TEST option has to preserve word splitting when copying TEST_TARGETS values used in .for loop in regression-test.
Comment 7 Jan Beich freebsd_committer freebsd_triage 2015-08-24 14:04:03 UTC
Created attachment 160306 [details]
QA for D3410 flavor: poudriere testport -j 93amd64
Comment 8 Jan Beich freebsd_committer freebsd_triage 2015-08-28 12:46:07 UTC
Created attachment 160437 [details]
v1 against r395468

review D3410 landed with slightly different syntax. Also, I was wrong about quoting difference with my version: ${opt}_VARS=SOME="foo bar ... qux" honors word-splitting fine.
Comment 9 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-06-28 11:57:49 UTC
Created attachment 183881 [details]
v2 against r444567
Comment 10 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-06-28 12:01:35 UTC
Take a final look if you want :)

Thank you, Jan
Comment 11 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-06-30 00:07:46 UTC
Created attachment 183931 [details]
v2 against r444690

- Re-add missing "Makefile.tests"
Comment 12 Jan Beich freebsd_committer freebsd_triage 2017-06-30 18:05:53 UTC
Comment on attachment 183931 [details]
v2 against r444690

> +DEBUG_MAKE_ENV=		V=1

Does it have any effect nowadays? Verbose builds should be unconditional since ports r421635.

>  .include <bsd.port.pre.mk>

Nothing later in the file relies on USES for flow control (.if/.for) or target names/prerequisites (foo: a b c), so you can either replace bsd.port.pre.mk with bsd.port.options.mk or drop it via bmake syntax e.g.,

-.include <bsd.port.pre.mk>
[...]
 # Work around base r261801
-.if ${OPSYS} == FreeBSD && ${OSVERSION} < 1100508
-GN_ARGS+=	extra_cxxflags="-D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1"
-.endif
+GN_ARGS+=	${${OPSYS} == FreeBSD && ${OSVERSION} < 1100508:? \
+		  extra_cxxflags="-D_LIBCPP_TRIVIAL_PAIR_COPY_CTOR=1":}

> +TEST_VARS=		RUN_TESTS="${TEST_TARGETS}"
[...]
>  test regression-test: build
> -.for t in ${TEST_TARGETS}
> +.for t in ${RUN_TESTS}

IIRC, this disables tests if they haven't been built. After ports r398125 it can be simplified to

-TEST_VARS=		RUN_TESTS="${TEST_TARGETS}"
[...]
-test regression-test: build
+do-test-TEST-on:
 .for t in ${TEST_TARGETS}

> +CC=			clang40
> +CXX=			clang++40
> +EXTRA_PATCHES+=		${FILESDIR}/extra-patch-clang

Can you move it higher in the file, just above the first GN_ARGS occurence? Also drop USES=compiler as CC/CXX are set manually while ${COMPILER_TYPE}, ${CHOSEN_COMPILER_TYPE}, ${COMPILER_VERSION} are unused. It would avoid pointless call to ${CC} --version which may not yet be installed.
Comment 13 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-06-30 18:20:13 UTC
Created attachment 183953 [details]
v2 against r444769
Comment 14 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-06-30 18:24:02 UTC
(In reply to Jan Beich from comment #12)

All the changes you have requested have been made.

I have chosen to replace bsd.port.pre.mk with bsd.port.options.mk
Comment 15 Jan Beich freebsd_committer freebsd_triage 2017-06-30 18:33:29 UTC
Looks fine except for the following.

$ portlint -C
FATAL: Makefile: [79]: use a tab (not space) after a variable name
FATAL: Makefile: [80]: use a tab (not space) after a variable name
WARN: Makefile: [81]: use a tab (not space) after a variable name

> -# TODO: move this big extra to small ones
> -EXTRA_PATCHES+=	${FILESDIR}/extra-patch-clang

TODO comment was lost. Intentional?
Comment 16 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-06-30 18:41:18 UTC
Created attachment 183954 [details]
v2 against r444769

- Pet portlint

FATAL: Makefile: [79]: use a tab (not space) after a variable name
FATAL: Makefile: [80]: use a tab (not space) after a variable name
WARN: Makefile: [81]: use a tab (not space) after a variable name
Comment 17 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-06-30 18:42:20 UTC
(In reply to Jan Beich from comment #15)

Yes, I have intentionally deleted the comment.

Thanks Jan
Comment 18 commit-hook freebsd_committer freebsd_triage 2017-06-30 19:05:57 UTC
A commit references this bug:

Author: cpm
Date: Fri Jun 30 19:05:32 UTC 2017
New revision: 444774
URL: https://svnweb.freebsd.org/changeset/ports/444774

Log:
  www/chromium: convert to option helpers

  - Drop USES=compiler as CC/CXX are set manually
  - Switch to option helpers
  - Cleanup Makefile

  PR:		202609
  Submitted by:	jbeich (based on)

Changes:
  head/www/chromium/Makefile
Comment 19 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-06-30 19:07:08 UTC
Committed, thanks!