rocm-arch / tensorflow-rocm

tensorflow-rocm AUR package
17 stars 12 forks source link

[Warning] setuptools/command/build_py.py:201: _Warning: Package is absent from the `packages` configuration. #51

Closed petronny closed 1 year ago

petronny commented 1 year ago

https://github.com/arch4edu/cactus/actions/runs/5112035031/jobs/9239440792

This warning shows almost for every modules in tensorflow.

/usr/lib/python3.11/site-packages/setuptools/command/build_py.py:201: _Warning: Package 'tensorflow.xla_aot_runtime_src.tensorflow.tsl.platform.default' is absent from the `packages` configuration.
!!

        ********************************************************************************
        ############################
        # Package would be ignored #
        ############################
        Python recognizes 'tensorflow.xla_aot_runtime_src.tensorflow.tsl.platform.default' as an importable package[^1],
        but it is absent from setuptools' `packages` configuration.

        This leads to an ambiguous overall configuration. If you want to distribute this
        package, please make sure that 'tensorflow.xla_aot_runtime_src.tensorflow.tsl.platform.default' is explicitly added
        to the `packages` configuration field.

        Alternatively, you can also rely on setuptools' discovery methods
        (for example by using `find_namespace_packages(...)`/`find_namespace:`
        instead of `find_packages(...)`/`find:`).

        You can read more about "package discovery" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html

        If you don't want 'tensorflow.xla_aot_runtime_src.tensorflow.tsl.platform.default' to be distributed and are
        already explicitly excluding 'tensorflow.xla_aot_runtime_src.tensorflow.tsl.platform.default' via
        `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
        you can try to use `exclude_package_data`, or `include-package-data=False` in
        combination with a more fine grained `package-data` configuration.

        You can read more about "package data files" on setuptools documentation page:

        - https://setuptools.pypa.io/en/latest/userguide/datafiles.html

        [^1]: For Python, any directory (with suitable naming) can be imported,
              even if it does not contain any `.py` files.
              On the other hand, currently there is no concept of package data
              directory, all directories are treated like packages.
        ********************************************************************************

!!
  check.warn(importable)
mpeschel10 commented 1 year ago

If you are troubleshooting why your build failed, I note that your error log for Run arch4edu/cactus/actions/build-package@main ends with:

error: could not write to 'build/lib.linux-x86_64-cpython-311/tensorflow/python/_pywrap_tfcompile.so': No space left on device
==> ERROR: A failure occurred in build().
    Aborting...
Attempted to remove disk file system under "/run/systemd/nspawn/propagate/makepkg", and we can't allow that.
==> ERROR: Build failed, check /mnt/extra-x86_64/makepkg/build

So you're running out of space somewhere. The log spam is only like a megabyte; I don't think that's your problem. Maybe your /tmp tmpfs is too small. I got a similar error building my PKGBUILD at that same point when I only had 8G for /tmp:

...
              On the other hand, currently there is no concept of package data
              directory, all directories are treated like packages.
        ********************************************************************************

!!
  check.warn(importable)
error: [Errno 28] No space left on device

To see how much space you have, run df -h /tmp. 12G is enough for me to build rocm tensorflow for 7 architectures; if your /tmp smaller, run mount -o remount,size=12G /tmp

mpeschel10 commented 1 year ago

To resolve the warnings, try the following command:

  sed -i -E "s/find_packages/find_namespace_packages/" tensorflow-${_pkgver}/tensorflow/tools/pip_package/setup.py

You can add it to the prepare() function in the PKGBUILD or call it from src.

I have confirmed that find_namespace_packages() is a superset of find_packages() and of the packages listed in the log-spam. I have rebuilt my version of the project and my test script runs ok. The package produced with this change is 267 bytes smaller, which is close enough. I have not run the full suite of tensorflow tests. I have not attempted a clean build (rm ~/.cache/bazel).

Source