Skip to content

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

Draft
lrandersson wants to merge 1 commit into
conda:mainfrom
lrandersson:dev-ra-fast-acl
Draft

Improve how ACLs are set to improve runtime performance#1335
lrandersson wants to merge 1 commit 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
"""


def write_fix_launcher_acls_bat(dir_path: str) -> None:

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 tried to inline everything in the NSIS template but never got it to work with multiple environments.
To avoid making the NSIS template harder to read I thought the best is simply to combine the approach with Python.

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: 🆕 New

Development

Successfully merging this pull request may close these issues.

2 participants