<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Indeed a wildcard exception (ie, a mere <span> `except:`) </span>seems more future proof.</p>
<p><br>
</p>
<p><span style="font-size: 12pt;">Jose</span><br>
</p>
<p><br>
</p>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Eric Engestrom <eric.engestrom@imgtec.com><br>
<b>Sent:</b> Wednesday, August 2, 2017 14:46<br>
<b>To:</b> Tobias Klausmann<br>
<b>Cc:</b> mesa-dev@lists.freedesktop.org; Emil Velikov; Jose Fonseca<br>
<b>Subject:</b> Re: [Mesa-dev] [PATCH] build: Don't bail on OSError in git_sha1_gen.py</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">On Wednesday, 2017-08-02 03:05:42 +0200, Tobias Klausmann wrote:<br>
> When building sandboxed, we may encounter additional errors. Ignore the errors,<br>
> as we are in a constrained environment.<br>
> <br>
> This can be observed when building latest git with OBS.<br>
> <br>
> Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de><br>
<br>
R-b and pushed, thanks.<br>
<br>
As I mentioned on IRC, I think we should make this a catch-all `except:`,<br>
as I don't expect there will be any exception where we'll do something<br>
other than `pass` (and we can always special-case it if/when this changes).<br>
<br>
Emil, Jose, thoughts?<br>
<br>
> ---<br>
> bin/git_sha1_gen.py | 3 +++<br>
> 1 file changed, 3 insertions(+)<br>
> <br>
> diff --git a/bin/git_sha1_gen.py b/bin/git_sha1_gen.py<br>
> index 6d13db1e16..fe30084a4f 100755<br>
> --- a/bin/git_sha1_gen.py<br>
> +++ b/bin/git_sha1_gen.py<br>
> @@ -16,5 +16,8 @@ try:<br>
> except subprocess.CalledProcessError as e:<br>
> # don't print anything if git fails<br>
> pass<br>
> +except OSError as eos:<br>
> + # don't fail on inaccessible files when sandboxed<br>
> + pass<br>
> else:<br>
> sys.stdout.write('#define MESA_GIT_SHA1 "git-%s"\n' % git_sha1.rstrip())<br>
> -- <br>
> 2.13.3<br>
> <br>
</div>
</span></font></div>
</div>
</body>
</html>