public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t] man/build: Fix dependency handling
Date: Fri, 24 May 2019 08:28:29 +0300	[thread overview]
Message-ID: <20190524052829.31177-1-arkadiusz.hiler@intel.com> (raw)

build_man is a 'feature' option, which means that we get an opaque
object, so comparing it to 'yes' is always false.

It should have been 'if build_man.enabled()'.

But going even further we can prune the whole check, as rst2man is
defined as follows:

rst2man = find_program('rst2man-3', 'rst2man', required : build_man)

From the patch overhauling those options:

    get_option() on a feature returns opaque object that can be passed as
    a 'required' argument of a dependency. Auto is equivalent to 'required
    : false', enabled is equivalent to 'required : true' and disabled
    introduces new behavior forcing the dependency to be considered not
    found.

This would cause the build to fail if build_man is enabled (aka
'required') and rst2man is not found. So...

if rst2man.found()
  # rst2man found
  # buildu buildu
else
  # rst2man not found, but considered optional because
  # we haven't erred out on find_program
  if build_man.enabled() # cannot be, it's optional!
    error('...')
  endif
endif

We can get rid of the whole else block here.

Cc: Antonio Argenziano <antonio.argenziano@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 man/meson.build | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/man/meson.build b/man/meson.build
index 0f0a6dd4..2c1396af 100644
--- a/man/meson.build
+++ b/man/meson.build
@@ -38,10 +38,6 @@ if rst2man.found()
 				install : true,
 				install_dir : join_paths(mandir, 'man1'))
 	endforeach
-	build_info += 'Build man pages: true'
-else
-	if build_man == 'yes'
-		error('Cannot build man pages due to missing dependencies')
-	endif
-	build_info += 'Build man pages: false'
 endif
+
+build_info += 'Build man pages: @0@'.format(rst2man.found())
-- 
2.21.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

             reply	other threads:[~2019-05-24  5:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-24  5:28 Arkadiusz Hiler [this message]
2019-05-24  5:50 ` [igt-dev] ✓ Fi.CI.BAT: success for man/build: Fix dependency handling Patchwork
2019-05-24  6:46 ` [igt-dev] [PATCH i-g-t] " Ser, Simon
2019-05-24 14:46 ` Antonio Argenziano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190524052829.31177-1-arkadiusz.hiler@intel.com \
    --to=arkadiusz.hiler@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox