Skip to content

Fix md5 checks for onedir conda-standalone #1007

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion constructor/header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ cd "$PREFIX"
unset PYTHON_SYSCONFIGDATA_NAME _CONDA_PYTHON_SYSCONFIGDATA_NAME

# the first binary payload: the standalone conda executable
printf "Unpacking bootstrapper ...\n"
printf "Unpacking bootstrapper...\n"
CONDA_EXEC="$PREFIX/_conda"
extract_range "${boundary0}" "${boundary1}" > "$CONDA_EXEC"
chmod +x "$CONDA_EXEC"
Expand Down
8 changes: 4 additions & 4 deletions constructor/shar.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_header(conda_exec, tarball, info):
variables["installer_name"] = name
variables["installer_version"] = info["version"]
variables["installer_platform"] = info["_platform"]
variables["installer_md5"] = hash_files([conda_exec, tarball])
variables["installer_md5"] = hash_files([conda_exec, *info["_internal_conda_files"], tarball])
variables["default_prefix"] = info.get("default_prefix", "${HOME:-/opt}/%s" % name.lower())
variables["first_payload_size"] = getsize(conda_exec)
variables["second_payload_size"] = getsize(tarball)
Expand Down Expand Up @@ -196,13 +196,13 @@ def create(info, verbose=False):
t.add(join(info["_download_dir"], fn), "pkgs/" + fn)
t.close()

internal_conda_files = copy_conda_exe(tmp_dir, "_conda", info["_conda_exe"])
if internal_conda_files:
info["_internal_conda_files"] = copy_conda_exe(tmp_dir, "_conda", info["_conda_exe"])
if info["_internal_conda_files"]:
conda_exe_payloads: dict[str, tuple[int, int, bool]] = {}
memfile = BytesIO()
start = 0
end = 0
for path in internal_conda_files:
for path in info["_internal_conda_files"]:
relative_path = str(path.relative_to(tmp_dir))
memfile.write(path.read_bytes())
size = os.path.getsize(path)
Expand Down
2 changes: 1 addition & 1 deletion news/993-onedir
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Enhancements

* Add compatibility for `onedir` variants of `conda-standalone`, which are pre-extracted and have smaller start overheads. (#993)
* Add compatibility for `onedir` variants of `conda-standalone`, which are pre-extracted and have smaller start overheads. (#993, #1007)

### Bug fixes

Expand Down
Loading