Skip to content

Remove CWD from Executable and Library search paths - #4108

Merged
blnicho merged 11 commits into
Pyomo:mainfrom
jsiirola:ignore-cwd
Nov 19, 2026
Merged

blnicho merged 11 commits into
Pyomo:mainfrom
jsiirola:ignore-cwd

Conversation

@jsiirola

@jsiirola jsiirola commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

Fixes # .

Summary/Motivation:

NOTE: this change breaks backwards compatibility.

This PR removes the current working directory from the default search paths used for finding executables and libraries. This is a security patch.

Changes proposed in this PR:

  • remove the CWD from the default list of search paths when locating executables and dynamic libraries
  • add public attributes to Executable and Library to overrife the default values for cwd, include_PATH, and pathlist used by the underlying finders.
  • resolve a bug where absolute paths were not found when cwd=False (even when the file existed)
  • improve testing

AI-Use Disclosure

  • AI tools were NOT used during the preparation of this PR

or

  • AI tools contributed to the development of this PR

    • AI tools generated documentation (including the PR description/comments, code comments, and/or Sphinx documentation)
    • AI tools generated tests (baselines, examples, and/or code)
    • AI tools generated code (apart from tests)

    Review process (select ONE):

    • Rewritten: All AI-generated content was rewritten by me before being committed.
    • Reviewed/verified: I retained AI-generated content and verified it before committing. Verification included (as applicable):
      • Ran the code and fixed issues
      • Added and ran tests
      • Checked correctness/logic of code and tests
      • Checked for alignment with the contribution guide
      • Considered security implications
    • As-is: AI-generated content was commited directly to the repository

Notes for reviewers (optional):

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@codecov

codecov Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.31%. Comparing base (2109c73) to head (6c42081).
⚠️ Report is 35 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4108      +/-   ##
==========================================
+ Coverage   90.29%   90.31%   +0.01%     
==========================================
  Files         920      920              
  Lines      109601   109831     +230     
==========================================
+ Hits        98969    99196     +227     
- Misses      10632    10635       +3     
Flag Coverage Δ
builders 29.14% <76.92%> (+0.01%) ⬆️
default 86.51% <97.43%> (?)
expensive 35.24% <76.92%> (?)
linux 87.86% <100.00%> (-1.94%) ⬇️
linux_other 87.86% <100.00%> (+0.02%) ⬆️
oldsolvers 28.04% <74.35%> (+0.01%) ⬆️
osx 83.30% <100.00%> (+0.02%) ⬆️
win 85.58% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@blnicho blnicho moved this from Todo to Review In Progress in November 2026 Release Nov 19, 2026
@github-project-automation github-project-automation Bot moved this from Review In Progress to Reviewer Approved in November 2026 Release Nov 19, 2026
@blnicho
blnicho merged commit 0da7d75 into Pyomo:main Nov 19, 2026
18 of 32 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewer Approved to Done in November 2026 Release Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

3 participants