Skip to content

[Build] Python build fails because onnxruntime/capi/build_and_package_info.py is missing #24570

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

Open
yurivict opened this issue Apr 26, 2025 · 2 comments
Labels
build build issues; typically submitted using template

Comments

@yurivict
Copy link
Contributor

Describe the issue

This line causes this failure:

FileNotFoundError: [Errno 2] No such file or directory: 'onnxruntime/capi/build_and_package_info.py'

onnxruntime/capi/build_and_package_info.py isn't present in the source tree. None of the dependencies provides it.

Where is onnxruntime/capi/build_and_package_info.py supposed to come from?

Version: 1.21.1
Python-3.11
FreeBSD 14.2

Urgency

No response

Target platform

FreeBSD

Build script

call build

Error / output

* Getting build dependencies for wheel...
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
    main()
  File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 143, in get_requires_for_build_wheel
    return hook(config_settings)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/setuptools/build_meta.py", line 177, in get_requires_for_build_wheel
    return self._get_build_requires(
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/setuptools/build_meta.py", line 159, in _get_build_requires
    self.run_setup()
  File "/usr/local/lib/python3.11/site-packages/setuptools/build_meta.py", line 282, in run_setup
    self).run_setup(setup_script=setup_script)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/setuptools/build_meta.py", line 174, in run_setup
    exec(compile(code, __file__, 'exec'), locals())
  File "setup.py", line 760, in <module>
    save_build_and_package_info(package_name, version_number, cuda_version, rocm_version)
  File "setup.py", line 733, in save_build_and_package_info
    with open(version_path, "w") as f:
         ^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'onnxruntime/capi/build_and_package_info.py'

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_wheel
*** Error code 1

Visual Studio Version

No response

GCC / Compiler Version

No response

@yurivict yurivict added the build build issues; typically submitted using template label Apr 26, 2025
@tianleiwu
Copy link
Contributor

tianleiwu commented Apr 29, 2025

It is saved here:

save_build_and_package_info(package_name, version_number, cuda_version, rocm_version)

when you run setup.py bdist_wheel --wheel_name_suffix=onnxruntime-gpu --cuda_version=12.2 (see full list of parameters here). If you use build.py, setup will be called automatically:
args = [sys.executable, os.path.join(source_dir, "setup.py"), "bdist_wheel"]

@jurajlutter
Copy link

@yurivict The problem is that the intermediate directories are not being created in the build process. When the directory is created (for example, onnxruntime/capi) and the build process is restarted, it continues. This concerns not only onnxruntime/capi but also others down the build process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build build issues; typically submitted using template
Projects
None yet
Development

No branches or pull requests

3 participants