aws / aws-lambda-builders

Python library to compile, build & package AWS Lambda functions for several runtimes & framework
Apache License 2.0
337 stars 140 forks source link

Bug: sam build --use-container fails to install llama-cpp-python on python 3.10 and above #624

Closed StefanSmith closed 4 months ago

StefanSmith commented 7 months ago

Description:

Installing llama-cpp-python via sam build --use-container fails on python versions beyond 3.9.

The wheel is built by lambda-builders during the build process (with resulting file name llama_cpp_python-0.2.55-cp311-cp311-manylinux_2_26_x86_64.whl) but lambda-builders does not consider this wheel to be compatible because the mapping betwen abi (cp310) and glibc version (major = 2, minor = 26) does not support python versions beyond 3.9.

I am not an expert in manylinux wheels but at first glance it seems like a simple matter of adding entries for cp310, cp311, etc, with value (2, 26).

Steps to reproduce:

Ensure docker is running with adequate RAM to avoid exhausting memory during wheel build. I allocated 16GB. If using Docker Desktop, go to Preferences > Resources and set the Memory to the desired value.

sam init \
  --name bug \
  --architecture x86_64 \
  --runtime python3.10 \
  --package-type Zip \
  --app-template hello-world \
  --no-tracing \
  --no-application-insights

cd bug

echo llama-cpp-python==0.2.55 > hello_world/requirements.txt

sam build --debug --use-container

Observed result:

Using the request object from command line argument
Loading workflow module 'aws_lambda_builders.workflows'
Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'
Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
Registering workflow 'NodejsNpmEsbuildBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm-esbuild', application_framework=None)'
Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
Registering workflow 'RustCargoLambdaBuilder' with capability 'Capability(language='rust', dependency_manager='cargo', application_framework=None)'
Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Running workflow 'PythonPipBuilder'
 Running PythonPipBuilder:ResolveDependencies
calling pip download -r /tmp/samcli/source/requirements.txt --dest /tmp/samcli/scratch --exists-action i
pip stdout: b"Collecting llama-cpp-python==0.2.55\n  Downloading llama_cpp_python-0.2.55.tar.gz (36.8 MB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 36.8/36.8 MB 3.0 MB/s eta 0:00:00\n  Installing build dependencies: started\n  Installing build dependencies: finished with status 'done'\n  Getting requirements to build wheel: started\n  Getting requirements to build wheel: finished with status 'done'\n  Installing backend dependencies: started\n  Installing backend dependencies: finished with status 'done'\n  Preparing metadata (pyproject.toml): started\n  Preparing metadata (pyproject.toml): finished with status 'done'\nCollecting diskcache>=5.6.1\n  Downloading diskcache-5.6.3-py3-none-any.whl (45 kB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 45.5/45.5 kB 4.8 MB/s eta 0:00:00\nCollecting jinja2>=2.11.3\n  Downloading Jinja2-3.1.3-py3-none-any.whl (133 kB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 133.2/133.2 kB 4.6 MB/s eta 0:00:00\nCollecting typing-extensions>=4.5.0\n  Downloading typing_extensions-4.10.0-py3-none-any.whl (33 kB)\nCollecting numpy>=1.20.0\n  Downloading numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 18.2/18.2 MB 4.0 MB/s eta 0:00:00\nCollecting MarkupSafe>=2.0\n  Downloading MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)\nSaved /tmp/samcli/scratch/llama_cpp_python-0.2.55.tar.gz\nSaved /tmp/samcli/scratch/diskcache-5.6.3-py3-none-any.whl\nSaved /tmp/samcli/scratch/Jinja2-3.1.3-py3-none-any.whl\nSaved /tmp/samcli/scratch/numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\nSaved /tmp/samcli/scratch/typing_extensions-4.10.0-py3-none-any.whl\nSaved /tmp/samcli/scratch/MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\nSuccessfully downloaded llama-cpp-python diskcache jinja2 numpy typing-extensions MarkupSafe\n"
pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running pip directly.\n\n[notice] A new release of pip is available: 23.0.1 -> 24.0\n[notice] To update, run: pip install --upgrade pip\n"
Non zero rc (1) from the setup.py egg_info command: b'Traceback (most recent call last):\n  File "<string>", line 1, in <module>\n  File "/var/lang/lib/python3.10/tokenize.py", line 394, in open\n    buffer = _builtin_open(filename, \'rb\')\nFileNotFoundError: [Errno 2] No such file or directory: \'/tmp/tmpwf6xvusn/llama_cpp_python-0.2.55/setup.py\'\n'
Using fallback location for PKG-INFO file in package directory: /tmp/tmpwf6xvusn/llama_cpp_python-0.2.55
Full dependency closure: {diskcache==5.6.3(wheel), markupsafe==2.1.5(wheel), typing-extensions==4.10.0(wheel), jinja2==3.1.3(wheel), llama-cpp-python==0.2.55(sdist), numpy==1.26.4(wheel)}
initial compatible: {diskcache==5.6.3(wheel), markupsafe==2.1.5(wheel), typing-extensions==4.10.0(wheel), jinja2==3.1.3(wheel), numpy==1.26.4(wheel)}
initial incompatible: {llama-cpp-python==0.2.55(sdist)}
Downloading missing wheels: {llama-cpp-python==0.2.55(sdist)}
calling pip download --only-binary=:all: --no-deps --platform manylinux2014_x86_64 --implementation cp --abi cp310 --dest /tmp/samcli/scratch llama-cpp-python==0.2.55
pip stdout: b''
pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running pip directly.\nERROR: Could not find a version that satisfies the requirement llama-cpp-python==0.2.55 (from versions: none)\nERROR: No matching distribution found for llama-cpp-python==0.2.55\n\n[notice] A new release of pip is available: 23.0.1 -> 24.0\n[notice] To update, run: pip install --upgrade pip\n"
compatible wheels after second download pass: {diskcache==5.6.3(wheel), markupsafe==2.1.5(wheel), typing-extensions==4.10.0(wheel), jinja2==3.1.3(wheel), numpy==1.26.4(wheel)}
Build missing wheels from sdists (C compiling True): {llama-cpp-python==0.2.55(sdist)}
calling pip wheel --no-deps --wheel-dir /tmp/samcli/scratch /tmp/samcli/scratch/llama_cpp_python-0.2.55.tar.gz
pip stdout: b"Processing /tmp/samcli/scratch/llama_cpp_python-0.2.55.tar.gz\n  File was already downloaded /tmp/samcli/scratch/llama_cpp_python-0.2.55.tar.gz\n  Installing build dependencies: started\n  Installing build dependencies: finished with status 'done'\n  Getting requirements to build wheel: started\n  Getting requirements to build wheel: finished with status 'done'\n  Installing backend dependencies: started\n  Installing backend dependencies: finished with status 'done'\n  Preparing metadata (pyproject.toml): started\n  Preparing metadata (pyproject.toml): finished with status 'done'\nBuilding wheels for collected packages: llama_cpp_python\n  Building wheel for llama_cpp_python (pyproject.toml): started\n  Building wheel for llama_cpp_python (pyproject.toml): still running...\n  Building wheel for llama_cpp_python (pyproject.toml): still running...\n  Building wheel for llama_cpp_python (pyproject.toml): finished with status 'done'\n  Created wheel for llama_cpp_python: filename=llama_cpp_python-0.2.55-cp310-cp310-manylinux_2_26_x86_64.whl size=2858372 sha256=6381c38e02085a0856d49eac4d907375bdaa009e3a68e08cd83dcb92feb417ed\n  Stored in directory: /root/.cache/pip/wheels/73/e4/d3/f96f79ddebb1bb59ec346098b90fb7015b368d5337de0b2c16\nSuccessfully built llama_cpp_python\n"
pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running pip directly.\n\n[notice] A new release of pip is available: 23.0.1 -> 24.0\n[notice] To update, run: pip install --upgrade pip\n"
compatible after building wheels (no C compiling): {diskcache==5.6.3(wheel), markupsafe==2.1.5(wheel), typing-extensions==4.10.0(wheel), jinja2==3.1.3(wheel), numpy==1.26.4(wheel)}
Build missing wheels from sdists (C compiling False): {llama-cpp-python==0.2.55(sdist)}
calling pip wheel --no-deps --wheel-dir /tmp/samcli/scratch /tmp/samcli/scratch/llama_cpp_python-0.2.55.tar.gz
pip stdout: b"Processing /tmp/samcli/scratch/llama_cpp_python-0.2.55.tar.gz\n  File was already downloaded /tmp/samcli/scratch/llama_cpp_python-0.2.55.tar.gz\n  Installing build dependencies: started\n  Installing build dependencies: finished with status 'done'\n  Getting requirements to build wheel: started\n  Getting requirements to build wheel: finished with status 'done'\n  Installing backend dependencies: started\n  Installing backend dependencies: finished with status 'done'\n  Preparing metadata (pyproject.toml): started\n  Preparing metadata (pyproject.toml): finished with status 'done'\nBuilding wheels for collected packages: llama_cpp_python\n  Building wheel for llama_cpp_python (pyproject.toml): started\n  Building wheel for llama_cpp_python (pyproject.toml): finished with status 'error'\nFailed to build llama_cpp_python\n"
pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running pip directly.\n  error: subprocess-exited-with-error\n  \n  \xc3\x97 Building wheel for llama_cpp_python (pyproject.toml) did not run successfully.\n  \xe2\x94\x82 exit code: 1\n  \xe2\x95\xb0\xe2\x94\x80> [16 lines of output]\n      *** scikit-build-core 0.8.2 using CMake 3.28.3 (wheel)\n      *** Configuring CMake...\n      loading initial cache file /tmp/tmpwi4hey4q/build/CMakeInit.txt\n      CMake Error at /tmp/pip-build-env-d39k2fwi/normal/lib/python3.10/site-packages/cmake/data/share/cmake-3.28/Modules/CMakeDetermineCCompiler.cmake:49 (message):\n        Could not find compiler set in environment variable CC:\n      \n        /var/false.\n      Call Stack (most recent call first):\n        CMakeLists.txt:3 (project)\n      \n      \n      CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage\n      CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage\n      -- Configuring incomplete, errors occurred!\n      \n      *** CMake configuration failed\n      [end of output]\n  \n  note: This error originates from a subprocess, and is likely not a problem with pip.\n  ERROR: Failed building wheel for llama_cpp_python\nERROR: Failed to build one or more wheels\n\n[notice] A new release of pip is available: 23.0.1 -> 24.0\n[notice] To update, run: pip install --upgrade pip\n"
compatible after building wheels (C compiling): {diskcache==5.6.3(wheel), markupsafe==2.1.5(wheel), typing-extensions==4.10.0(wheel), jinja2==3.1.3(wheel), numpy==1.26.4(wheel)}
Final compatible: {diskcache==5.6.3(wheel), jinja2==3.1.3(wheel), numpy==1.26.4(wheel), markupsafe==2.1.5(wheel), typing-extensions==4.10.0(wheel)}
Final incompatible: {llama-cpp-python==0.2.55(wheel)}
Final missing wheels: {llama-cpp-python==0.2.55(sdist)}
PythonPipBuilder:ResolveDependencies failed
Traceback (most recent call last):
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 71, in execute
    package_builder.build_dependencies(
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 157, in build_dependencies
    self._dependency_builder.build_site_packages(requirements_path, artifacts_dir_path, scratch_dir_path)
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 262, in build_site_packages
    raise MissingDependencyError(packages_without_wheels)
aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {llama-cpp-python==0.2.55(sdist)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflow.py", line 372, in run
    action.execute()
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 77, in execute
    raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: {llama-cpp-python==0.2.55(sdist)}
Builder workflow failed
Traceback (most recent call last):
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 71, in execute
    package_builder.build_dependencies(
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 157, in build_dependencies
    self._dependency_builder.build_site_packages(requirements_path, artifacts_dir_path, scratch_dir_path)
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflows/python_pip/packager.py", line 262, in build_site_packages
    raise MissingDependencyError(packages_without_wheels)
aws_lambda_builders.workflows.python_pip.packager.MissingDependencyError: {llama-cpp-python==0.2.55(sdist)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflow.py", line 372, in run
    action.execute()
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflows/python_pip/actions.py", line 77, in execute
    raise ActionFailedError(str(ex))
aws_lambda_builders.actions.ActionFailedError: {llama-cpp-python==0.2.55(sdist)}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/__main__.py", line 117, in main
    builder.build(
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/builder.py", line 170, in build
    return workflow.run()
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflow.py", line 116, in wrapper
    func(self, *args, **kwargs)
  File "/usr/local/opt/lambda-builders/lib/python3.10/site-packages/aws_lambda_builders/workflow.py", line 379, in run
    raise WorkflowFailedError(workflow_name=self.NAME, action_name=action.NAME, reason=str(ex))
aws_lambda_builders.exceptions.WorkflowFailedError: PythonPipBuilder:ResolveDependencies - {llama-cpp-python==0.2.55(sdist)}
2024-03-05 22:47:14,866 | Build inside container returned response {"jsonrpc":
"2.0", "id": 1, "error": {"code": 400, "message":
"PythonPipBuilder:ResolveDependencies - {llama-cpp-python==0.2.55(sdist)}"}}
2024-03-05 22:47:15,228 | Exception raised during the execution

Build Failed

Expected result:

Running the same steps as above but with --runtime python3.9 produces the following successful result.

Using the request object from command line argument
Loading workflow module 'aws_lambda_builders.workflows'
Registering workflow 'CustomMakeBuilder' with capability 'Capability(language='provided', dependency_manager=None, application_framework=None)'
Registering workflow 'DotnetCliPackageBuilder' with capability 'Capability(language='dotnet', dependency_manager='cli-package', application_framework=None)'
Registering workflow 'GoModulesBuilder' with capability 'Capability(language='go', dependency_manager='modules', application_framework=None)'
Registering workflow 'JavaGradleWorkflow' with capability 'Capability(language='java', dependency_manager='gradle', application_framework=None)'
Registering workflow 'JavaMavenWorkflow' with capability 'Capability(language='java', dependency_manager='maven', application_framework=None)'
Registering workflow 'NodejsNpmBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm', application_framework=None)'
Registering workflow 'NodejsNpmEsbuildBuilder' with capability 'Capability(language='nodejs', dependency_manager='npm-esbuild', application_framework=None)'
Registering workflow 'PythonPipBuilder' with capability 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Registering workflow 'RubyBundlerBuilder' with capability 'Capability(language='ruby', dependency_manager='bundler', application_framework=None)'
Registering workflow 'RustCargoLambdaBuilder' with capability 'Capability(language='rust', dependency_manager='cargo', application_framework=None)'
Found workflow 'PythonPipBuilder' to support capabilities 'Capability(language='python', dependency_manager='pip', application_framework=None)'
Running workflow 'PythonPipBuilder'
 Running PythonPipBuilder:ResolveDependencies
calling pip download -r /tmp/samcli/source/requirements.txt --dest /tmp/samcli/scratch --exists-action i
pip stdout: b"Collecting llama-cpp-python==0.2.55\n  Downloading llama_cpp_python-0.2.55.tar.gz (36.8 MB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 36.8/36.8 MB 4.7 MB/s eta 0:00:00\n  Installing build dependencies: started\n  Installing build dependencies: finished with status 'done'\n  Getting requirements to build wheel: started\n  Getting requirements to build wheel: finished with status 'done'\n  Installing backend dependencies: started\n  Installing backend dependencies: finished with status 'done'\n  Preparing metadata (pyproject.toml): started\n  Preparing metadata (pyproject.toml): finished with status 'done'\nCollecting typing-extensions>=4.5.0\n  Downloading typing_extensions-4.10.0-py3-none-any.whl (33 kB)\nCollecting numpy>=1.20.0\n  Downloading numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 18.2/18.2 MB 4.0 MB/s eta 0:00:00\nCollecting jinja2>=2.11.3\n  Downloading Jinja2-3.1.3-py3-none-any.whl (133 kB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 133.2/133.2 kB 4.5 MB/s eta 0:00:00\nCollecting diskcache>=5.6.1\n  Downloading diskcache-5.6.3-py3-none-any.whl (45 kB)\n     \xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81\xe2\x94\x81 45.5/45.5 kB 4.2 MB/s eta 0:00:00\nCollecting MarkupSafe>=2.0\n  Downloading MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)\nSaved /tmp/samcli/scratch/llama_cpp_python-0.2.55.tar.gz\nSaved /tmp/samcli/scratch/diskcache-5.6.3-py3-none-any.whl\nSaved /tmp/samcli/scratch/Jinja2-3.1.3-py3-none-any.whl\nSaved /tmp/samcli/scratch/numpy-1.26.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\nSaved /tmp/samcli/scratch/typing_extensions-4.10.0-py3-none-any.whl\nSaved /tmp/samcli/scratch/MarkupSafe-2.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\nSuccessfully downloaded llama-cpp-python diskcache jinja2 numpy typing-extensions MarkupSafe\n"
pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running pip directly.\n\n[notice] A new release of pip is available: 23.0.1 -> 24.0\n[notice] To update, run: pip install --upgrade pip\n"
Non zero rc (1) from the setup.py egg_info command: b'Traceback (most recent call last):\n  File "<string>", line 1, in <module>\n  File "/var/lang/lib/python3.9/tokenize.py", line 392, in open\n    buffer = _builtin_open(filename, \'rb\')\nFileNotFoundError: [Errno 2] No such file or directory: \'/tmp/tmpqdpmon2k/llama_cpp_python-0.2.55/setup.py\'\n'
Using fallback location for PKG-INFO file in package directory: /tmp/tmpqdpmon2k/llama_cpp_python-0.2.55
Full dependency closure: {typing-extensions==4.10.0(wheel), jinja2==3.1.3(wheel), diskcache==5.6.3(wheel), markupsafe==2.1.5(wheel), numpy==1.26.4(wheel), llama-cpp-python==0.2.55(sdist)}
initial compatible: {typing-extensions==4.10.0(wheel), jinja2==3.1.3(wheel), diskcache==5.6.3(wheel), markupsafe==2.1.5(wheel), numpy==1.26.4(wheel)}
initial incompatible: {llama-cpp-python==0.2.55(sdist)}
Downloading missing wheels: {llama-cpp-python==0.2.55(sdist)}
calling pip download --only-binary=:all: --no-deps --platform manylinux2014_x86_64 --implementation cp --abi cp39 --dest /tmp/samcli/scratch llama-cpp-python==0.2.55
pip stdout: b''
pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running pip directly.\nERROR: Could not find a version that satisfies the requirement llama-cpp-python==0.2.55 (from versions: none)\nERROR: No matching distribution found for llama-cpp-python==0.2.55\n\n[notice] A new release of pip is available: 23.0.1 -> 24.0\n[notice] To update, run: pip install --upgrade pip\n"
compatible wheels after second download pass: {typing-extensions==4.10.0(wheel), jinja2==3.1.3(wheel), diskcache==5.6.3(wheel), markupsafe==2.1.5(wheel), numpy==1.26.4(wheel)}
Build missing wheels from sdists (C compiling True): {llama-cpp-python==0.2.55(sdist)}
calling pip wheel --no-deps --wheel-dir /tmp/samcli/scratch /tmp/samcli/scratch/llama_cpp_python-0.2.55.tar.gz
pip stdout: b"Processing /tmp/samcli/scratch/llama_cpp_python-0.2.55.tar.gz\n  File was already downloaded /tmp/samcli/scratch/llama_cpp_python-0.2.55.tar.gz\n  Installing build dependencies: started\n  Installing build dependencies: finished with status 'done'\n  Getting requirements to build wheel: started\n  Getting requirements to build wheel: finished with status 'done'\n  Installing backend dependencies: started\n  Installing backend dependencies: finished with status 'done'\n  Preparing metadata (pyproject.toml): started\n  Preparing metadata (pyproject.toml): finished with status 'done'\nBuilding wheels for collected packages: llama_cpp_python\n  Building wheel for llama_cpp_python (pyproject.toml): started\n  Building wheel for llama_cpp_python (pyproject.toml): still running...\n  Building wheel for llama_cpp_python (pyproject.toml): still running...\n  Building wheel for llama_cpp_python (pyproject.toml): finished with status 'done'\n  Created wheel for llama_cpp_python: filename=llama_cpp_python-0.2.55-cp39-cp39-manylinux_2_26_x86_64.whl size=2858388 sha256=93b977c75f6a5af9b6f2bdfb2d544c266c398a9e64b65cda2feef8f92ea8943b\n  Stored in directory: /root/.cache/pip/wheels/cc/00/aa/99b22f44df08db6898b5b9310a01672349a3816019bd4dcd8b\nSuccessfully built llama_cpp_python\n"
pip stderr: b"WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip.\nPlease see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue.\nTo avoid this problem you can invoke Python with '-m pip' instead of running pip directly.\n\n[notice] A new release of pip is available: 23.0.1 -> 24.0\n[notice] To update, run: pip install --upgrade pip\n"
compatible after building wheels (no C compiling): {typing-extensions==4.10.0(wheel), jinja2==3.1.3(wheel), diskcache==5.6.3(wheel), markupsafe==2.1.5(wheel), numpy==1.26.4(wheel), llama-cpp-python==0.2.55(wheel)}
Build missing wheels from sdists (C compiling False): set()
compatible after building wheels (C compiling): {typing-extensions==4.10.0(wheel), jinja2==3.1.3(wheel), diskcache==5.6.3(wheel), markupsafe==2.1.5(wheel), numpy==1.26.4(wheel), llama-cpp-python==0.2.55(wheel)}
Final compatible: {typing-extensions==4.10.0(wheel), jinja2==3.1.3(wheel), diskcache==5.6.3(wheel), markupsafe==2.1.5(wheel), numpy==1.26.4(wheel), llama-cpp-python==0.2.55(wheel)}
Final incompatible: set()
Final missing wheels: set()
PythonPipBuilder:ResolveDependencies succeeded
 Running PythonPipBuilder:CopySource
Copying source file (/tmp/samcli/source/__init__.py) to destination (/tmp/samcli/artifacts/__init__.py)
Copying source file (/tmp/samcli/source/app.py) to destination (/tmp/samcli/artifacts/app.py)
Copying source file (/tmp/samcli/source/requirements.txt) to destination (/tmp/samcli/artifacts/requirements.txt)
PythonPipBuilder:CopySource succeeded
2024-03-05 23:02:30,141 | Build inside container returned response {"jsonrpc":
"2.0", "id": 1, "result": {"artifacts_dir": "/tmp/samcli/artifacts"}}
2024-03-05 23:02:30,173 | Build inside container was successful. Copying artifacts
from container to host
2024-03-05 23:02:30,302 | Copying from container: /tmp/samcli/artifacts/. ->
/Users/xxxxx/code/bug/.aws-sam/build/HelloWorldFunction
2024-03-05 23:02:32,304 | Build inside container succeeded
2024-03-05 23:02:32,857 | Async execution completed
2024-03-05 23:02:32,860 | There is no customer defined id or cdk path defined for
resource HelloWorldFunction, so we will use the resource logical id as the resource
id
2024-03-05 23:02:32,861 | 2 resources found in the stack
2024-03-05 23:02:32,862 | Found Serverless function with name='HelloWorldFunction'
and CodeUri='hello_world/'

Build Succeeded

Built Artifacts  : .aws-sam/build
Built Template   : .aws-sam/build/template.yaml

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

Running on Mac

{
  "version": "1.97.0",
  "system": {
    "python": "3.8.13",
    "os": "macOS-13.4.1-x86_64-i386-64bit"
  },
  "additional_dependencies": {
    "docker_engine": "20.10.11",
    "aws_cdk": "Not available",
    "terraform": "Not available"
  },
  "available_beta_feature_env_vars": [
    "SAM_CLI_BETA_FEATURES",
    "SAM_CLI_BETA_BUILD_PERFORMANCE",
    "SAM_CLI_BETA_TERRAFORM_SUPPORT",
    "SAM_CLI_BETA_RUST_CARGO_LAMBDA"
  ]
}

Add --debug flag to command you are running

hnnasit commented 7 months ago

Hi @StefanSmith, thanks for reporting the issue. Marking this as a bug since I can reproduce the behavior.

github-actions[bot] commented 4 months ago

Patch is released in v1.50.0. If you are AWS SAM CLI user, please wait for next AWS SAM CLI release. Closing