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

Build fails with mysqlclient #799

Closed
3 tasks done
zach-morris opened this issue Jul 11, 2023 · 2 comments
Closed
3 tasks done

Build fails with mysqlclient #799

zach-morris opened this issue Jul 11, 2023 · 2 comments

Comments

@zach-morris
Copy link

zach-morris commented Jul 11, 2023

What version of Cloud Foundry and CF CLI are you using? (i.e. What is the output of running cf curl /v2/info && cf version?
cf cli version 7.5.0+0ad1d6398.2022-06-04
Running on: VMware TAS for VMs v2.13.16

What version of the buildpack you are using?
v1.8.11 (python_buildpack_latest)

If you were attempting to accomplish a task, what was it you were attempting to do?
Push app / build python application using the noted buildpack with a requirements.txt file containing (no version limitation):

mysqlclient

Manifest.yml:

applications:
- name:test
  instances: 1
  disk_quota: 1GB
  memory: 1GB
  stack: cflinuxfs3
  no-route: true
  health-check-type: process
  buildpacks:
    - python_buildpack_latest

requirements.txt:

mysqlclient

What did you expect to happen?
The app succeeds to build using the latest python buildpack

What was the actual behavior?
The app fails to build with error:

Error: subprocess-exited-with-error
            × Getting requirements to build wheel did not run successfully.
            │ exit code: 1
            ╰─> [25 lines of output]
                Trying pkg-config --exists mysqlclient
                Command 'pkg-config --exists mysqlclient' returned non-zero exit status 1.
                Trying pkg-config --exists mariadb
                Command 'pkg-config --exists mariadb' returned non-zero exit status 1.
                Traceback (most recent call last):
                  File "/tmp/contents1426358164/deps/0/python/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
                    main()
, in main
                    json_out['return_val'] = hook(**hook_input['kwargs'])
                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/tmp/contents1426358164/deps/0/python/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118                    return hook(config_settings)
                           ^^^^^^^^^^^^^^^^^^^^^
                  File "/tmp/pip-build-env-qp22x82t/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 341, in get_requires_for_build_wheel
                    return self._get_build_requires(config_settings, requirements=['wheel'])
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  File "/tmp/pip-build-env-qp22x82t/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 323, in _get_build_requires
                    self.run_setup()
                  File "/tmp/pip-build-env-qp22x82t/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 338, in run_setup
                    exec(code, locals())
                  File "<string>", line 154, in <module>
                  File "<string>", line 48, in get_config_posix
                  File "<string>", line 27, in find_package_name
                Exception: Can not find valid pkg-config name.
                Specify MYSQLCLIENT_CFLAGS and MYSQLCLIENT_LDFLAGS env vars manually
                [end of output]

I'll note that the build succeeds if i update the requirements.txt file to:

mysqlclient==2.1.1 

After further investigation, i see that the latest version of mysqlclient (2.2.0 released June 21,2023), has been updated and now uses pkg-config instead of mysql_config (ref PyMySQL/mysqlclient#586), which is the root cause of the failure. I assume the python_buildpack would have to include pkg-config to allow this to succeed with the newest versions of mysqlclient, or define the environment variables for the buildpack as suggested here:
https://github.com/PyMySQL/mysqlclient#customize-build-posix

Please confirm where necessary:

  • I have included a log output
  • My log includes an error message
  • I have included steps for reproduction
@robdimsdale
Copy link
Member

pkg-config is available on the cflinuxfs4 stack:

→ docker run -it --rm cloudfoundry/cflinuxfs4 pkg-config --version
0.29.2

So it sounds like we're missing some config. Can you try adding some environment variables to staging to validate what the buildpack could add?

@robdimsdale
Copy link
Member

I'm going to close this out as there's been no response in over a year.

@github-project-automation github-project-automation bot moved this from 📝 Todo to ✅ Done in CF Buildpacks Workstreams Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants