<div dir="ltr"><div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Thu, Sep 27, 2018 at 5:38 PM Kaleb S. KEITHLEY <<a href="mailto:kkeithle@redhat.com">kkeithle@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 9/26/18 8:28 PM, Shyam Ranganathan wrote:<br>
> Hi,<br>
> <br>
> With the introduction of default python 3 shebangs and the change in<br>
> <a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a> to correct these to py2 if the build is being attempted on<br>
> a machine that does not have py3, there are a couple of issues<br>
> uncovered. Here is the plan to fix the same, suggestions welcome.<br>
> <br>
> Issues:<br>
> - A configure job is run when creating the dist tarball, and this runs<br>
> on non py3 platforms, hence changing the dist tarball to basically have<br>
> py2 shebangs, as a result the release-new build job always outputs py<br>
> files with the py2 shebang. See tarball in [1]<br>
> <br>
> - All regression hosts are currently py2 and so if we do not run the py<br>
> shebang correction during configure (as we do not build and test from<br>
> RPMS), we would be running with incorrect py3 shebangs (although this<br>
> seems to work, see [2]. @kotresh can we understand why?)<br>
<br>
Is it because we don't test any of the python in the regression tests?<br>
<br></blockquote><div>Geo-replication do have regression tests but not sure about glusterfind, events.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Or because when we do, we invoke python scripts with `python foo.py` or<br>
`$PYTHON foo.py` everywhere? The shebangs are ignored when scripts are<br>
invoked this way.<br>
</blockquote><div>The reason why geo-rep is passing is for the same reason mentioned. Geo-rep</div><div>python file is invoked from a c program always prefixing it with python as follows.</div><div><br></div><div>python = getenv("PYTHON");<br> if (!python)<br> python = PYTHON;<br> nargv[j++] = python;<br> nargv[j++] = GSYNCD_PREFIX "/python/syncdaemon/" GSYNCD_PY;<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
> <br>
> Plan to address the above is detailed in this bug [3].<br>
> <br>
> The thought is,<br>
> - Add a configure option "--enable-py-version-correction" to configure,<br>
> that is disabled by default<br>
<br>
"correction" implies there's something that's incorrect. How about<br>
"conversion" or perhaps just --enable-python2<br>
<br>
> <br>
> - All regression jobs will run with the above option, and hence this<br>
> will correct the py shebangs in the regression machines. In the future<br>
> as we run on both py2 and py3 machines, this will run with the right<br>
> python shebangs on these machines.<br>
> <br>
> - The packaging jobs will now run the py version detection and shebang<br>
> correction during actual build and packaging, Kaleb already has put up a<br>
> patch for the same [2].<br>
> <br>
> Thoughts?<br>
> <br>
<br>
Also note that until --enable-whatever is added to configure(.ac), if<br>
you're building and testing any of the python bits on RHEL or CentOS<br>
you'll need to convert the shebangs. Perhaps the easiest way to do that<br>
now (master branch and release-5 branch) is to build+install rpms.<br>
<br>
If you're currently doing<br>
<br>
`git clone; ./autogen.sh; ./configure; make; make install`<br>
<br>
then change that to<br>
<br>
`git clone; ./autogen.sh; ./configure; make -C extras/LinuxRPMS<br>
glusterrpms`<br>
<br>
and then yum install those rpms. The added advantage is that it's easier<br>
to remove rpms than anything installed with `make install`.<br>
<br>
If you're developing on Fedora (hopefully 27 or later) or Debian or<br>
Ubuntu you don't need to do anything different as they all have python3.<br>
<br>
--<br>
<br>
Kaleb<br>
_______________________________________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a><br>
<a href="https://lists.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">https://lists.gluster.org/mailman/listinfo/gluster-devel</a><br>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Thanks and Regards,<br></div>Kotresh H R<br></div></div></div></div>