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

flare-capa cannot be installed with python >=3.9 and python-flirt 0.9.x #2552

Open
tfluehmann opened this issue Jan 8, 2025 · 1 comment

Comments

@tfluehmann
Copy link

tfluehmann commented Jan 8, 2025

Description

The flare-capa python library is not compatible with python version >= 3.10 and raises an issue during the installation.
It only works if python-flirt is fixed to 0.8.x. None of the newer versions are compatible with python-flirt 0.9.x.

Steps to Reproduce

pyproject.toml

[tool.poetry]
name = "capa-test"
version = "1.0.0"
description = ""

[tool.poetry.dependencies]
python = ">=3.9,<=3.12"
flare-capa = "8.0.1"

Dockerfile

ARG PYTHON_VERSION=3.11.4
FROM python:${PYTHON_VERSION} AS base

RUN python3 -m pip install poetry
ENV HOME=/app/capa
WORKDIR $HOME
COPY pyproject.toml $HOME
RUN poetry lock

RUN poetry install

Finally when I try to run the docker build command:

docker build -t capa .

I get the following error:

[+] Building 8.4s (10/10) FINISHED                                                                                                                                                                                                                                                                                                                                                                                docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                                                                                                                                                                                        0.1s
 => => transferring dockerfile: 233B                                                                                                                                                                                                                                                                                                                                                                                        0.0s
 => [internal] load metadata for docker.io/library/python:3.11.4                                                                                                                                                                                                                                                                                                                                                            0.8s
 => [internal] load .dockerignore                                                                                                                                                                                                                                                                                                                                                                                           0.1s
 => => transferring context: 2B                                                                                                                                                                                                                                                                                                                                                                                             0.0s
 => [1/6] FROM docker.io/library/python:3.11.4@sha256:85b3d192dddbc96588b719e86991e472b390805a754681a38132de1977d8e429                                                                                                                                                                                                                                                                                                      0.0s
 => [internal] load build context                                                                                                                                                                                                                                                                                                                                                                                           0.1s
 => => transferring context: 235B                                                                                                                                                                                                                                                                                                                                                                                           0.0s
 => CACHED [2/6] RUN python3 -m pip install poetry                                                                                                                                                                                                                                                                                                                                                                          0.0s
 => CACHED [3/6] WORKDIR /app/capa                                                                                                                                                                                                                                                                                                                                                                                          0.0s
 => [4/6] COPY pyproject.toml /app/capa                                                                                                                                                                                                                                                                                                                                                                                     0.2s
 => [5/6] RUN poetry lock                                                                                                                                                                                                                                                                                                                                                                                                   3.7s
 => ERROR [6/6] RUN poetry install                                                                                                                                                                                                                                                                                                                                                                                          3.1s 
------                                                                                                                                                                                                                                                                                                                                                                                                                           
 > [6/6] RUN poetry install:                                                                                                                                                                                                                                                                                                                                                                                                     
0.904 Installing dependencies from lock file                                                                                                                                                                                                                                                                                                                                                                                     
1.050                                                                                                                                                                                                                                                                                                                                                                                                                            
1.050 Package operations: 36 installs, 0 updates, 0 removals                                                                                                                                                                                                                                                                                                                                                                     
1.051                                                                                                                                                                                                                                                                                                                                                                                                                            
1.051   - Installing pyasn1 (0.5.1)
1.175   - Installing cxxfilt (0.3.0)
1.176   - Installing mdurl (0.1.2)
1.177   - Installing msgpack (1.0.8)
1.178   - Installing pyasn1-modules (0.3.0)
1.178   - Installing pycparser (2.22)
1.178   - Installing six (1.17.0)
1.180   - Installing sortedcontainers (2.4.0)
1.181   - Installing typing-extensions (4.12.2)
1.315   - Installing annotated-types (0.7.0)
1.316   - Installing funcy (2.0)
1.316   - Installing ida-netnode (3.0)
1.317   - Installing intervaltree (3.1.0)
1.318   - Installing markdown-it-py (3.0.0)
1.319   - Installing pefile (2024.8.26)
1.319   - Installing pydantic-core (2.27.2)
1.321   - Installing pygments (2.19.1)
1.322   - Installing python-flirt (0.9.0)
1.323   - Installing ruamel-yaml-clib (0.2.12)
1.333   - Installing vivisect (1.2.1)
1.906 
1.906   RuntimeError
1.906 
1.906   Unable to find installation candidates for python-flirt (0.9.0)
1.906 
1.906   at /usr/local/lib/python3.11/site-packages/poetry/installation/chooser.py:86 in choose_for
1.913        82│ 
1.913        83│             links.append(link)
1.913        84│ 
1.913        85│         if not links:
1.913     →  86│             raise RuntimeError(f"Unable to find installation candidates for {package}")
1.913        87│ 
1.913        88│         # Get the best link
1.913        89│         chosen = max(links, key=lambda link: self._sort_key(package, link))
1.913        90│ 
1.913 
1.913 Cannot install python-flirt.
1.913 
------
Dockerfile:10
--------------------
   8 |     RUN poetry lock
   9 |     
  10 | >>> RUN poetry install
  11 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c poetry install" did not complete successfully: exit code: 1

Expected behavior:

The installation is successful if I just want to install the library without specifying anything else.

Actual behavior:

The installation of the library does not work when python-flirt is not specified at all or is not 0.8.x.

Versions

I've tried it with capa 7.3.0 up to 8.0.1
Additionally with python3.9.x, python3.10.x, python3.11.x and python3.12.x.

@williballenthin
Copy link
Collaborator

Thanks for the thorough bug report! I'll take a look tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants