Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when building from source #306

Closed
jmehami1 opened this issue Aug 20, 2024 · 6 comments
Closed

Error when building from source #306

jmehami1 opened this issue Aug 20, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@jmehami1
Copy link

I followed instructions to build from source as shown here but I'm getting an error when building the bindings using pip install. .

OS: Ubuntu 20.04

Error

Processing ./manif
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      Traceback (most recent call last):
        File "/home/jmehami/Git/test/env/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/home/jmehami/Git/test/env/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/home/jmehami/Git/test/env/lib/python3.8/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-4y0jyr6t/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "/tmp/pip-build-env-4y0jyr6t/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-4y0jyr6t/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 318, in run_setup
          exec(code, locals())
        File "<string>", line 3, in <module>
        File "/tmp/pip-build-env-4y0jyr6t/overlay/lib/python3.8/site-packages/cmake_build_extension/__init__.py", line 5, in <module>
          from . import build_ext_option, sdist_command
        File "/tmp/pip-build-env-4y0jyr6t/overlay/lib/python3.8/site-packages/cmake_build_extension/sdist_command.py", line 10, in <module>
          class GitSdistABC(abc.ABC, setuptools.command.sdist.sdist):
        File "/usr/lib/python3.8/abc.py", line 85, in __new__
          cls = super().__new__(mcls, name, bases, namespace, **kwargs)
      TypeError: Cannot create a consistent method resolution
      order (MRO) for bases ABC, sdist
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Minimal working examples

These are the following instructions to replicate in a virtual environment:

sudo apt install python3-venv
mkdir manif_test
cd manif_test
python -m venv env
source env/bin/activate
pip install --upgrade pip
pip install "pybind11[global]"
sudo apt-get install libeigen3-dev
git clone https://github.com/artivis/manif.git
pip install manif/.

A docker image definition which replicates the issue:

FROM ubuntu:20.04

# Change the default shell to Bash
SHELL [ "/bin/bash" , "-c" ]

# Set environment variables
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get upgrade -y && apt-get install -y \
    python3 \
    python3-pip \
    git \
    libeigen3-dev \
    && rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
    
RUN pip install --upgrade pip

RUN  pip install --no-cache-dir \
 "pybind11[global]==2.13.1"
 
RUN mkdir /temp && cd /temp && git clone https://github.com/artivis/manif.git \
  && cd manif && pip install --no-cache-dir . \
  && rm -rf /temp

Save as file called "dockerfile". Build image using the following command:

docker build --progress=plain -t  manif_test .

Fixes I've tried

  • Building in Ubuntu 22.04
  • Pip Installing wheel
  • Reverting to following commit before this one (was building fine here)
@artivis
Copy link
Owner

artivis commented Aug 23, 2024

Thanks for reporting, I'll look at it over the weekend 👍 .

@artivis artivis self-assigned this Aug 23, 2024
@artivis artivis added the bug Something isn't working label Aug 23, 2024
@artivis
Copy link
Owner

artivis commented Aug 25, 2024

I couldn't reproduce the issue. I fired up a clean 20.04 VM and the pip install went through fine:

$ pip install .
Defaulting to user installation because normal site-packages is not writeable
Processing /home/ubuntu/workspace/src/manif
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: manifpy
  Building wheel for manifpy (pyproject.toml) ... done
  Created wheel for manifpy: filename=manifpy-0.1.dev787+dirty-cp38-cp38-linux_x86_64.whl size=795434 sha256=450d7867ea0458f9155f5fc57bd1542f5ae2415815bf0fb98ac6ee8ad7dca8eb
  Stored in directory: /tmp/pip-ephem-wheel-cache-9c5z6d2y/wheels/e0/88/78/3317458a45a4af3d46b8c1cb22495a3ec206dd37be7fb2d71b
Successfully built manifpy
Installing collected packages: manifpy
Successfully installed manifpy-0.1.dev787+dirty

Hi @diegoferigo, any idea if this issue could come from cmake-build-extension?

@jmehami1 The specific commit you linked shouldn't be an issue. This new addition doesn't have a python binding at the moment. It thus isn't even compiled.

@jmehami1
Copy link
Author

Hi @artivis, thanks for checking it out. I believe the issue was somewhere downstream with the latest Python version. In order to fix it for my project, I didn't upgrade Ubuntu. But I just tried building the docker image in the original issue (which does upgrade Ubuntu), and it's working now, so they must have fixed the bug with the wheel package.
It's working in both 20.04 and 22.04

@diegoferigo
Copy link
Contributor

Thanks for pinging me @artivis. I didn't get what was the configuration of distro/python that was causing the original error. @jmehami1 what do you mean with the following, what update triggered the error?

In order to fix it for my project, I didn't upgrade Ubuntu.

@jmehami1
Copy link
Author

Hi @diegoferigo , all my Ubuntu devices were up-to-date packages at the time of the error. This included the docker image, which had the command "RUN apt-get update && apt-get upgrade -y && apt-get install -y \ ...". I spend the day trying to fix the issue. The only way to build it successfully was through a Ubuntu docker image which did NOT have any updated packages. My Ubuntu devices could not build it at the time. Almost a week later, one of the packages must have been fixed (I don't know which one), but its all working now even if after installing updated packages.
Apologies, I don't have any other information.

@diegoferigo
Copy link
Contributor

Great, thanks for sharing details! Now it's more clear, glad it got fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants