Skip to content

Size estimate updates using construct.yaml options - #1331

Open
amaloney wants to merge 3 commits into
conda:mainfrom
amaloney:issue1330/size-est-low
Open

Size estimate updates using construct.yaml options#1331
amaloney wants to merge 3 commits into
conda:mainfrom
amaloney:issue1330/size-est-low

Conversation

@amaloney

Copy link
Copy Markdown

Description

This commit modifies constructor/winexe.py based on the following options found in construct.yaml

keep_pkgs: true
condarc:
  allow_softlinks: false
  always_copy: true

These sets of options within construct.yaml creates copies of packages because hard links are not used. Not using hard links prevents users from copy/pasting environments or packages across drives, and getting errors due to broken links.

Resolves: #1330

previous-size-estimate actual-size updated-size-estimate

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?

This commit modifies `constructor/winexe.py` based on the following
options found in `construct.yaml`

```yaml
keep_pkgs: true
condarc:
  allow_softlinks: false
  always_copy: true
```

These sets of options within `construct.yaml` creates copies of packages
because hard links are not used. Not using hard links prevents users from
copy/pasting environments or packages across drives, and getting errors
due to broken links.
@amaloney
amaloney requested a review from a team as a code owner August 20, 2026 18:07
@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review Aug 20, 2026
@conda-bot

Copy link
Copy Markdown
Contributor

We require contributors to sign our Contributor License Agreement and we don't have one on file for @amaloney.

In order for us to review and merge your code, please e-sign the Contributor License Agreement PDF. We then need to manually verify your signature, merge the PR (conda/infrastructure#1435), and ping the bot to refresh the PR.

@marcoesters marcoesters left a comment

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.

Thanks! This is an interesting problem and your code is a good start. I don't think we should take keep_pkgs into account though and the estimate is going to get complicated when extra environments are involved.

Comment thread constructor/winexe.py
# - `keep_pkgs: true` + `always_copy: false` = tarballs + extracted
# - `keep_pkgs: false` = extracted only
# `keep_pkgs: true`
if info.get("keep_pkgs", False):

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 think we need to keep the archives in the size calculation no matter what the value of keep_pkgs is since these files are removed after package installation.

The purpose of the file size calculation is not just to inform the user, but to prevent running out of disk space. So, the value should be the amount of disk space the installer needs for the installation, not what's left in the end.

Comment thread constructor/winexe.py
size_extracted = info.get("_approx_pkgs_size", 0)
# `always_copy: true` in condarc means installed files are copies, not hard links
if info.get("condarc", {}).get("always_copy", False):
size_extracted = 2 * size_extracted

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.

This is correct for an installer that only has a base environment, but not for installers with multiple environments.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

understood, let me think harder about it. I can see that this logic worked for my current use-case, but there are others that I have not thought about

Comment thread news/1330-disk-size-estimate-updates Outdated
Co-authored-by: Marco Esters <mesters@anaconda.com>
@travishathaway

Copy link
Copy Markdown
Contributor

@conda-bot check

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Aug 21, 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: 🆕 New

Development

Successfully merging this pull request may close these issues.

Size estimate low, based on constructor.yaml options

4 participants