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

Fix location of temporary hard links of index.json #3813

Merged
merged 1 commit into from Nov 8, 2016

Conversation

nehaljwani
Copy link
Contributor

The command:
$ conda install https://repo.continuum.io/pkgs/free/linux-64/affine-1.1.0-py27_0.tar.bz2 --debug

Reveals:
DEBUG conda.common.disk:rm_rf(198): rm_rf /home/wani/conda/.tmp-affine-1.1.0-py27_0

The command:
$ conda install /tmp/affine-1.1.0-py27_0.tar.bz2 --debug

Reveals:
DEBUG conda.common.disk:rm_rf(198): rm_rf /home/wani/conda/file:/tmp::/.tmp-affine-1.1.0-py27_0

As is evident, when the protocol is file://, conda creates a bogus
folder by the name: file:/ + /path/to/folder/of/tar.gz + '::'

The variable 'prefix' is required by the function try_hard_link().
We shouldn't modify it before that. This change ensures that the
file ${prefix}/.tmp-${pkgname} is indeed created inside the folder
${prefix}.

Fixes #3801

The command:
$ conda install https://repo.continuum.io/pkgs/free/linux-64/affine-1.1.0-py27_0.tar.bz2 --debug

Reveals:
DEBUG conda.common.disk:rm_rf(198): rm_rf /home/wani/conda/.tmp-affine-1.1.0-py27_0

The command:
$ conda install /tmp/affine-1.1.0-py27_0.tar.bz2 --debug

Reveals:
DEBUG conda.common.disk:rm_rf(198): rm_rf /home/wani/conda/file:/tmp::/.tmp-affine-1.1.0-py27_0

As is evident, when the protocol is file://, conda creates a bogus
folder by the name: file:/ + /path/to/folder/of/tar.gz + '::'

The variable 'prefix' is required by the function try_hard_link().
We shouldn't modify it before that. This change ensures that the
file ${prefix}/.tmp-${pkgname} is indeed created inside the folder
${prefix}.
@kalefranz
Copy link
Contributor

I think I'm missing something here. I think you've debugged the problem correctly in your description, but all I can tell from the PR is that you've renamed prefix to url_prefix. Is there a logic change I'm missing?

@kalefranz
Copy link
Contributor

Appreciate the work on this btw. This has been an annoying bug that I just haven't had time to track down. It was easier to write the clean-all target in the Makefile 😬

@nehaljwani
Copy link
Contributor Author

nehaljwani commented Nov 8, 2016

@kalefranz The rename itself fixes the issue.
In the code, the function explicit() calls try_hard_link() near the end. Since try_hard_link() expects the parameter prefix, we should make sure that it is passed as such, un-modified. Without this patch, the variable prefix gets modified to 'file://tmp::' which is not expected. Hence, I use a different variable url_prefix to hold the url prefix.

@kalefranz
Copy link
Contributor

👍

@kalefranz kalefranz merged commit b0ce9d4 into conda:master Nov 8, 2016
@nehaljwani nehaljwani deleted the fix-issue-3801 branch July 30, 2017 19:41
@github-actions
Copy link

Hi there, thank you for your contribution to Conda!

This pull request has been automatically locked since it has not had recent activity after it was closed.

Please open a new issue or pull request if needed.

@github-actions github-actions bot added the locked [bot] locked due to inactivity label Sep 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked [bot] locked due to inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

local install create file: folder
2 participants