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

Deprecate conda.core.initalize.run_plan_elevated #13427

Open
2 tasks done
Tracked by #13428
travishathaway opened this issue Dec 14, 2023 · 2 comments
Open
2 tasks done
Tracked by #13428

Deprecate conda.core.initalize.run_plan_elevated #13427

travishathaway opened this issue Dec 14, 2023 · 2 comments
Labels
source::anaconda created by members of Anaconda, Inc. type::tech-debt identifies or resolves some technical debt

Comments

@travishathaway
Copy link
Contributor

travishathaway commented Dec 14, 2023

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

See this issue for some more context:

When conda encounters a problem with modifying a file during initialization, it will mark it as NEEDS_SUDO:

def run_plan(plan):
for step in plan:
previous_result = step.get("result", None)
if previous_result in (Result.MODIFIED, Result.NO_CHANGE):
continue
try:
result = globals()[step["function"]](
*step.get("args", ()), **step.get("kwargs", {})
)
except OSError as e:
log.info("%s: %r", step["function"], e, exc_info=True)
result = Result.NEEDS_SUDO
step["result"] = result

The problem occurs later when we make the sudo call:

result = subprocess_call(
"sudo %s -m conda.core.initialize" % sys.executable,
env={},
path=os.getcwd(),
stdin=stdin,
)

We believe this behavior is problematic (currently does not work on unix-like systems) and would like to deprecate this functionality.

@travishathaway travishathaway added source::anaconda created by members of Anaconda, Inc. type::tech-debt identifies or resolves some technical debt labels Dec 14, 2023
@jaimergp
Copy link
Contributor

See also #12087, conda/menuinst#143. I think there are reasons to auto-elevate, but it might require a more robust workflow.

@travishathaway
Copy link
Contributor Author

xref: #13472

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
source::anaconda created by members of Anaconda, Inc. type::tech-debt identifies or resolves some technical debt
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants