Giter VIP home page Giter VIP logo

Comments (16)

ofek avatar ofek commented on June 6, 2024

Can you please try rebuilding with one of the variant options? https://ofek.dev/pyapp/latest/config/#cpython

from pyapp.

sandangel avatar sandangel commented on June 6, 2024

Let me give it a try

from pyapp.

sandangel avatar sandangel commented on June 6, 2024

@ofek it doesn't work too. now the command change to:

clang -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64-v4 -fPIC -fPIC -I/root/.local/share/pyapp/myapp/15114544842415842793/2.0.5/python/include/python3.11 -I/tmp/pip-build-env-d572aapz/overlay/lib/python3.11/site-packages/numpy/core/include -c hdbscan/_hdbscan_tree.c -o build/temp.linux-x86_64-cpython-311/hdbscan/_hdbscan_tree.o

Notice the -march now became x86-64-v4.

from pyapp.

ofek avatar ofek commented on June 6, 2024

Try v1

from pyapp.

sandangel avatar sandangel commented on June 6, 2024

@ofek v1 does not have -march=x86-64-v1 issue, however, it still does not detect gcc and still requires clang. I tried v2 v3 v4, will have both issues.

from pyapp.

ofek avatar ofek commented on June 6, 2024

I think it might be an issue with that particular package:

As far as why that first error is gone, it's related to the CPU architecture https://gregoryszorc.com/docs/python-build-standalone/main/running.html

I don't know exactly what's happening in your case but would it help if you could set runtime environment variables at build time?

from pyapp.

sandangel avatar sandangel commented on June 6, 2024

hi @ofek , I'm not sure what do you mean by setting runtime env var at build time?

I don't think the problem is with that particular package because I was able to install it using normal python, not python from the python distribution. I also tried external pip, but it still does not work. I guess I will need to keep using the CC=gcc flag?

from pyapp.

ofek avatar ofek commented on June 6, 2024

Can you please give me more details about your environment?

What I meant was would it be useful to you if you could inject environment variables into the binary such that they would be available at runtime like CC?

from pyapp.

sandangel avatar sandangel commented on June 6, 2024

@ofek oh, I see. I'm building docker image like the example above. So you mean I can use:

ENV CC=gcc

To set the env var? That does not fix the issue that python from distribution does not detect gcc automatically, and I will have to use cpu v1 for the portability. I'm not sure if it will affect performance.

from pyapp.

sandangel avatar sandangel commented on June 6, 2024

Hi, now I got another error:

No default distribution source found

I'm using aarch64 linux, so it should be supported.

from pyapp.

ofek avatar ofek commented on June 6, 2024

Show the full error?

from pyapp.

sandangel avatar sandangel commented on June 6, 2024
Caused by:
  process didn't exit successfully: `/tmp/cargo-installSIy4m9/release/build/pyapp-ce661a8f58de8e66/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-env=PYAPP_PROJECT_DEPENDENCY_FILE=
  cargo:rustc-env=PYAPP__PROJECT_DEPENDENCY_FILE_NAME=
  cargo:rustc-env=PYAPP_PROJECT_NAME=wovey
  cargo:rustc-env=PYAPP_PROJECT_VERSION=2.0.5
  cargo:rustc-env=PYAPP__PROJECT_EMBED_FILE_NAME=wovey-2.0.5-py3-none-any.whl
  
  --- stderr
  thread 'main' panicked at /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pyapp-0.16.0/build.rs:364:5:


  No default distribution source found
  Python version: 3.11
  Platform: linux
  Architecture: aarch64
  ABI: gnu
  Variant: v1


  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `pyapp v0.16.0`, intermediate artifacts can be found at `/tmp/cargo-installSIy4m9`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/root/.local/share/hatch/env/virtual/wovey/9TtSrW0h/wovey-build/lib/python3.11/site-packages/hatchling/__main__.py", line 6, in <module>
    sys.exit(hatchling())
             ^^^^^^^^^^^
  File "/root/.local/share/hatch/env/virtual/wovey/9TtSrW0h/wovey-build/lib/python3.11/site-packages/hatchling/cli/__init__.py", line 26, in hatchling
    command(**kwargs)
  File "/root/.local/share/hatch/env/virtual/wovey/9TtSrW0h/wovey-build/lib/python3.11/site-packages/hatchling/cli/build/__init__.py", line 82, in build_impl
    for artifact in builder.build(
  File "/root/.local/share/hatch/env/virtual/wovey/9TtSrW0h/wovey-build/lib/python3.11/site-packages/hatchling/builders/plugin/interface.py", line 155, in build
    artifact = version_api[version](directory, **build_data)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/root/.local/share/hatch/env/virtual/wovey/9TtSrW0h/wovey-build/lib/python3.11/site-packages/hatchling/builders/binary.py", line 163, in build_bootstrap
    self.cargo_build(install_command, cwd=context_dir, env=env)
  File "/root/.local/share/hatch/env/virtual/wovey/9TtSrW0h/wovey-build/lib/python3.11/site-packages/hatchling/builders/binary.py", line 195, in cargo_build
    raise OSError(message)
OSError: Compilation failed (code 101)
Error: building at STEP "RUN PYAPP_PROJECT_PATH=/app/dist/wovey-$(rye version)-py3-none-any.whl hatch build --target binary": while running runtime: exit status 1

from pyapp.

sandangel avatar sandangel commented on June 6, 2024

The same dockerfile built on x86_64, but failed locally on aarch64

from pyapp.

ofek avatar ofek commented on June 6, 2024

The variant environment variable I think is the issue for ARM, can you try removing that?

from pyapp.

sandangel avatar sandangel commented on June 6, 2024

@ofek , yeah, it looks like variant v1 does not exist for aarch64. It works when I use v3 default. However, v3 make the wheel build error on x86_64, and require CFLAGS. But the CFLAGS does not work on aarch64. :(

from pyapp.

sandangel avatar sandangel commented on June 6, 2024

Ended up setting CFLAGS for now.

from pyapp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.