Skip to content

Improve how ACLs are set to improve runtime performance - #1335

Merged
marcoesters merged 5 commits into
conda:mainfrom
lrandersson:dev-ra-fast-acl
Aug 27, 2026
Merged

Improve how ACLs are set to improve runtime performance#1335
marcoesters merged 5 commits into
conda:mainfrom
lrandersson:dev-ra-fast-acl

Conversation

@lrandersson

@lrandersson lrandersson commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Description

The Setting installation directory permissions... step runs icacls /T over all of $INSTDIR, which costs ~170 µs per file (~25 s for 150k files) even though only a few files actually needed fixing. This PR scopes it to one call per environment against that environment's Scripts directory.

Investigation into conda

Only Scripts is affected because exactly one conda code path hard links from a shared template: LinkPathAction.create_python_entry_point_windows_exe_action, whose target is hard coded to Scripts/{command}.exe. That template is the launcher stub inside conda-standalone's _MEI* directory, which is created with an explicit user-only ACE and no inheritance; since hard links share one security descriptor, every launcher inherits that broken ACL. All other candidate directories are ruled out in code — condabin and Library\bin only ever get fresh writes from conda init, Library\usr\bin never gets generated files at all, and Scripts\conda.exe is a copy().

test_allusers_exe is our guard for a future regression if conda ever creates launchers elsewhere. Its guard is now extracted and also called from test_example_extra_envs to cover the per-environment loop, and it additionally asserts that windows_python_entry_point_exe paths exist and all live in a Scripts directory, this way the test cannot silently stop testing this.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review Aug 24, 2026
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Aug 24, 2026
Comment thread tests/test_examples.py
if installer_type == InstallerTypes.MSI:
_run_uninstaller_msi(installer, install_dir)
else:
_check_permission_inheritance(base)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the ACL verification to extra_envs to ensure it's working as intended with additional environments as well (since we dont recurse the entire installation directory anymore).

@lrandersson lrandersson self-assigned this Aug 24, 2026
@lrandersson
lrandersson force-pushed the dev-ra-fast-acl branch 2 times, most recently from 3da9679 to 78c03f2 Compare August 24, 2026 20:59
Comment thread constructor/winexe.py Outdated
@lrandersson
lrandersson marked this pull request as ready for review August 25, 2026 17:34
@lrandersson
lrandersson requested a review from a team as a code owner August 25, 2026 17:34
@lrandersson
lrandersson marked this pull request as draft August 25, 2026 17:37
@lrandersson
lrandersson marked this pull request as ready for review August 26, 2026 18:25
Comment thread tests/test_examples.py Outdated
Comment on lines +848 to +849
launchers = [launcher for prefix in prefixes for launcher in _entry_point_launchers(prefix)]
assert launchers, "Installation must contain entry point launchers"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we must assert that. This is the source of a bug, but I'm not sure we need to assert that. As you say in the doc string, the full scan makes sure that inheritance is correct for all files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, it's unnecessary. Removed in 6c6ea15

@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Approved in 🔎 Review Aug 27, 2026
@marcoesters
marcoesters merged commit 00182d0 into conda:main Aug 27, 2026
39 checks passed
@github-project-automation github-project-automation Bot moved this from ✅ Approved to 🏁 Done in 🔎 Review Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🏁 Done

Development

Successfully merging this pull request may close these issues.

3 participants