actions / actions/setup-python

Extend PKG_CONFIG_PATH rather than overwriting it

Open
#1,243 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
TypeScript
Stars
2.2k
Forks
739
Avg merge
6d 18h
Merged PRs (30d)
1

Description

Description:

As of now, the setup-python action overwrites the PKG_CONFIG_PATH variable during its execution, which can lead to errors if this variable has already been set to a specific value (which is then no longer available). PKG_CONFIG_PATH works as the normal PATH does (from the man page of pkg-config)

PKG_CONFIG_PATH
  A colon-separated list of high-priority directories where pc(5) files are looked up.

It would therefore be a good idea to instead extend PKG_CONFIG_PATH by adding the new directory to the existing value if one is present in the environment. This will make both existing and new pc files available (We would not want to overwrite PATH either, would we?)

Justification:

I realized this issue after debugging session of a CI pipeline which had a global

env:
  PKG_CONFIG_PATH: '/special/path'

attached to a given workflow. After installing python using setup-python the python dependencies (which included a native library with a pc file) could not be installed any more, since that variable had been overwritten. This is a rather insidious error which is really hard to find.

Are you willing to submit a PR?

Working on a PR.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue identifies setup-python's handling of PKG_CONFIG_PATH as the entry point; inspect the action's environment and path-writing code and any relevant tests. Verify behavior with an existing PKG_CONFIG_PATH and confirm both the prior and generated directories remain available. Work is already represented by PR #1242.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions, typescript
Domain
ci-cd, devops
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.