Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 311209 - app-forensics/afflib: Verify and potentially improve Python-related code
Summary: app-forensics/afflib: Verify and potentially improve Python-related code
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Forensics Herd [disbanded]
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 308257
  Show dependency tree
 
Reported: 2010-03-24 19:40 UTC by Arfrever Frehtes Taifersar Arahesis (RETIRED)
Modified: 2011-11-26 01:34 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild patch (afflibv.patch,2.02 KB, patch)
2011-11-15 13:02 UTC, Ian Delaney (RETIRED)
Details | Diff
revised ebuild patch (afflibv.patch,2.01 KB, patch)
2011-11-17 02:06 UTC, Ian Delaney (RETIRED)
Details | Diff
revised ebuild patch (afflibv.patch,2.01 KB, patch)
2011-11-18 14:31 UTC, Ian Delaney (RETIRED)
Details | Diff
revised ebuild patch (afflib.patch,2.42 KB, patch)
2011-11-21 12:42 UTC, Ian Delaney (RETIRED)
Details | Diff
revised ebuild patch (afflib.patch,2.42 KB, patch)
2011-11-24 20:58 UTC, Ian Delaney (RETIRED)
Details | Diff
revised ebuild patch (afflib.patch,5.07 KB, patch)
2011-11-24 21:20 UTC, Ian Delaney (RETIRED)
Details | Diff
afflib-3.6.12-python-module.patch (afflib-3.6.12-python-module.patch,422 bytes, patch)
2011-11-26 00:40 UTC, Arfrever Frehtes Taifersar Arahesis
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arfrever Frehtes Taifersar Arahesis (RETIRED) gentoo-dev 2010-03-24 19:40:57 UTC
- If this package can be used as a library and installs Python modules
  (*.so or *.py) into directories specific to given versions of Python,
  then consider supporting installation for multiple Python versions.
  Please read section "Types of packages" in documentation [1].

- Ensure that the ebuilds do not use deprecated functions or variables.

- Please check if Python 3 is supported by this package. You can temporarily
  set Python 3 as main active version of Python to properly test if this
  package supports Python 3.

- If this package does not support Python 3:
  - Specify dependency on Python 2.
    You can use PYTHON_DEPEND helper variable, which should be set before
    inheriting of python eclass.

  - If this package cannot support installation for multiple versions of
    Python, then set active version of Python using
    python_set_active_version().

  - Ensure that shebangs in installed scripts specify correct version of
    Python. If shebangs are too generic (e.g. '#!/usr/bin/python'), then you
    can use python_convert_shebangs() to convert shebangs.
    (Wrapper scripts generated by python_generate_wrapper_scripts() do not
    require any changes.)

  - To ensure that changes applied to the ebuilds are sufficient, please
    temporarily set Python 3 as main active version of Python and test if
    this package can be properly installed and if it works at run time.

Please see documentation [1] for more details.
[1] http://www.gentoo.org/proj/en/Python/developersguide.xml
Comment 1 Ian Delaney (RETIRED) gentoo-dev 2011-11-15 13:02:19 UTC
Created attachment 292627 [details, diff]
ebuild patch
Comment 2 Arfrever Frehtes Taifersar Arahesis 2011-11-16 19:03:55 UTC
(In reply to comment #1)

This package fails to build with Python 3.
Please don't attach untested patches.
Comment 3 Ian Delaney (RETIRED) gentoo-dev 2011-11-17 02:06:11 UTC
* QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * pyaff.c:276:5: warning: dereferencing type-punned pointer will break strict-aliasing rules

 * Please do not file a Gentoo bug and instead report the above QA
 * issues directly to the upstream developers of this software.
 * Homepage: http://www.afflib.org/
 * checking 29 files for package collisions
>>> Merging app-forensics/afflib-3.6.8 to /

 * QA Notice: Static libraries have been found in Python site-packages
 *            directories. Build system should be modified to not generate
 *            these files and object files generated only for these files.
 * /usr/lib64/python2.7/site-packages/pyaff.a

afflib 3.6.12 doesn't build with Python 3.
afflib 3.6.8 builds with pythons 2 && 3
Comment 4 Ian Delaney (RETIRED) gentoo-dev 2011-11-17 02:06:39 UTC
Created attachment 292835 [details, diff]
revised ebuild patch
Comment 5 Arfrever Frehtes Taifersar Arahesis 2011-11-18 01:26:11 UTC
(In reply to comment #4)

PYTHON_DEPEND="python? 2"

Changes in afflib-3.6.12.ebuild add 2 assignments to PYTHON_DEPEND. Please delete second assignment.

pkg_setup() {
	if use python; then
		python_set_active_version 2
		python_pkg_setup
	fi
}

Modify build system to not create "pyaff.a".
Comment 6 Ian Delaney (RETIRED) gentoo-dev 2011-11-18 14:31:31 UTC
Created attachment 292989 [details, diff]
revised ebuild patch

Modify build system to not create "pyaff.a".
eeek.  I had to knock out the prior patch to get this to work, which suggest the prior patch was flawed.  

* QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
 * pyaff.c:276:5: warning: dereferencing type-punned pointer will break strict-alia

gentoo64 afflib # USE=doc ebuild  afflib-3.6.12.ebuild clean install

>>> Completed installing afflib-3.6.12 into /mnt/gen2/tmpdir/portage/app-forensics/afflib-3.6.12/image/

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment
   usr/lib64/libafflib.so.0.0.0
ecompressdir: bzip2 -9 /usr/share/doc
ecompressdir: bzip2 -9 /usr/share/man

Finally above no QA message; in BOTH.
The 3.6.8 version 

* QA Notice: Unrecognized configure options:
 * 
 *      configure: WARNING: unrecognized options: --disable-libewf
 *      configure: WARNING: unrecognized options: --disable-libewf
Comment 7 Arfrever Frehtes Taifersar Arahesis 2011-11-20 03:25:30 UTC
(In reply to comment #6)

This patch is identical to previous patch.
Comment 8 Ian Delaney (RETIRED) gentoo-dev 2011-11-21 12:42:26 UTC
Created attachment 293299 [details, diff]
revised ebuild patch

had to figure it all again, don't know how I missed saving the updated version, again
Comment 9 Arfrever Frehtes Taifersar Arahesis 2011-11-23 17:29:58 UTC
(In reply to comment #8)

PYTHON_DEPEND="python? 2"

Comment #3 mentions warning about pyaff.a in app-forensics/afflib-3.6.8.
app-forensics/afflib-3.6.12 doesn't have this problem.
Comment 10 Ian Delaney (RETIRED) gentoo-dev 2011-11-24 20:58:40 UTC
Created attachment 293641 [details, diff]
revised ebuild patch

The portion 
diff -ur /mnt/gen2/old-portage/app-forensics/afflib//files/afflib-3.6.12-python-module.patch ../afflib//files/afflib-3.6.12-python-module.patch
in the patch is likely superfluous.
files/pyaff.patch is appnded to the ebuild patch; 2 in 1

Arfever said

warning about pyaff.a in app-forensics/afflib-3.6.8.
app-forensics/afflib-3.6.12 doesn't have this problem.

I fixed it for both, don't you see.  Didn't explain before.  The afflib-3.6.12-python-module.patch for 3.6.12 I have commented out to achieve the fox, forget the datails now, but it also addressed pyaff/Makefile.am; it had to 'go'.
See the  epatch "${FILESDIR}"/pyaff.patch is present in both; afflib-3.6.12 doesn't have this problem because the patch works on both.  I don't wish to delete an existing patch from a current ebuild, so have commented it out.
How's that for value?
Comment 11 Ian Delaney (RETIRED) gentoo-dev 2011-11-24 21:20:45 UTC
Created attachment 293653 [details, diff]
revised ebuild patch

changed systems via chroot, forgot change of local location for prior version,
bash: changed: command not found  sorry  for the noise
Comment 12 Tim Harder gentoo-dev 2011-11-24 22:21:03 UTC
Fixed in CVS for 3.6.12. I had the changes done locally back when the version was added and was waiting for the python eclass to work with EAPI 4.

I'm not applying fixes for 3.6.8 and in general if you're working on patches for these types of bugs you usually only need to fix the latest version. Thanks.
Comment 13 Ian Delaney (RETIRED) gentoo-dev 2011-11-25 08:21:40 UTC
roger, thanks Tim
Comment 14 Arfrever Frehtes Taifersar Arahesis 2011-11-25 21:59:02 UTC
afflib-3.6.12-python-module.patch should add "-shared" also in pyaff_la_CFLAGS.

It is possible to support installation for multiple Python ABIs.
Comment 15 Arfrever Frehtes Taifersar Arahesis 2011-11-25 22:49:56 UTC
(In reply to comment #12)
> Fixed in CVS for 3.6.12.

You introduced the following warnings caused by autotools-utils_src_compile():

/var/tmp/portage/app-forensics/afflib-3.6.12/temp/environment: line 1029: pushd: /var/tmp/portage/app-forensics/afflib-3.6.12/work/afflib-3.6.12_build: No such file or directory
...
/var/tmp/portage/app-forensics/afflib-3.6.12/temp/environment: line 1031: popd: directory stack empty
Comment 16 Tim Harder gentoo-dev 2011-11-26 00:24:28 UTC
(In reply to comment #14)
> afflib-3.6.12-python-module.patch should add "-shared" also in pyaff_la_CFLAGS.

That flag only applies to linking.
 
> It is possible to support installation for multiple Python ABIs.

Sure, but enabling that causes a failure with using python_set_active_version and I'd rather just build one version since only the python 2.* series is supported anyway.

> You introduced the following warnings caused by autotools-utils_src_compile

Fixed.
Comment 17 Arfrever Frehtes Taifersar Arahesis 2011-11-26 00:40:09 UTC
Created attachment 293785 [details, diff]
afflib-3.6.12-python-module.patch

(In reply to comment #16)
> (In reply to comment #14)
> > afflib-3.6.12-python-module.patch should add "-shared" also in
> > pyaff_la_CFLAGS.
> 
> That flag only applies to linking.

No. Read 'libtool --help --mode=compile'. Enable "static-libs" USE flag and you will notice that pyaff.c is compiled twice:
- Into .libs/pyaff_la-pyaff.o (PIC version)
- Into pyaff_la-pyaff.o (non-PIC version)

Only .libs/pyaff_la-pyaff.o is later used.

I'm attaching updated afflib-3.6.12-python-module.patch, which causes that pyaff.c is compiled only into .libs/pyaff_la-pyaff.o.
Comment 18 Tim Harder gentoo-dev 2011-11-26 01:34:02 UTC
(In reply to comment #14)
> afflib-3.6.12-python-module.patch should add "-shared" also in pyaff_la_CFLAGS.

Fixed.