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

hotfixes don't work for .conda packages if channel doesn't contain an equivalent .tar.bz2 package #96

Open
lorenjanwilson opened this issue Sep 3, 2020 · 0 comments

Comments

@lorenjanwilson
Copy link

lorenjanwilson commented Sep 3, 2020

The current main.py code, and potentially other scripts in this repo as well, won't properly patch a channel that only contains .conda packages. More specifically, it won't properly patch a .conda file's entry in the repodata unless a .tar.bz2 version of the same package is also present.

Here's an example of attempting to patch a small channel which only contains .conda packages and no .tar.bz2 packages. This uses the latest version of main.py here.

$ channel="/c/conda-build-repo/channel2"
$ arch="${channel}/linux-64"
$ ls $arch | grep '.conda$' | wc -l
58
$ ls $arch | grep '.tar.bz2$' | wc -l
0
$ conda index  --verbose --patch-generator repodata-hotfixes/main.py "${channel}"
DEBUG:conda_build.index:found subdirs {'linux-64', 'noarch'}
Building repodata for /c/conda-build-repo/channel2/linux-64
INFO:conda_build.index:Building repodata for /c/conda-build-repo/channel2/linux-64
DEBUG:conda_build.index:using patch generator repodata-hotfixes/main.py for linux-64
Building repodata for /c/conda-build-repo/channel2/noarch
INFO:conda_build.index:Building repodata for /c/conda-build-repo/channel2/noarch
DEBUG:conda_build.index:using patch generator repodata-hotfixes/main.py for noarch
$ cat $arch/patch_instructions.json
{
  "packages": {},
  "patch_instructions_version": 1,
  "remove": [],
  "revoke": []
}
$ grep "zstd >=1.4.4" $arch/repodata.json
        "zstd >=1.4.4,<1.4.5.0a0"

As you can see, the libarchive package, which should have been patched, was not.

If I copy a tar.bz2 version of this package into the channel, it works correctly for both the .conda and .tar.bz2 versions:

$ cp libarchive-3.4.2-h62408e4_0.tar.bz2 "$arch"
$ conda index  --verbose --patch-generator repodata-hotfixes/main.py "${channel}"
DEBUG:conda_build.index:found subdirs {'linux-64', 'noarch'}
Building repodata for /c/conda-build-repo/channel2/linux-64
INFO:conda_build.index:Building repodata for /c/conda-build-repo/channel2/linux-64
DEBUG:conda_build.index:hashing, extracting, and caching libarchive-3.4.2-h62408e4_0.tar.bz2
DEBUG:conda_build.index:using patch generator repodata-hotfixes/main.py for linux-64
Building repodata for /c/conda-build-repo/channel2/noarch
INFO:conda_build.index:Building repodata for /c/conda-build-repo/channel2/noarch
DEBUG:conda_build.index:using patch generator repodata-hotfixes/main.py for noarch
$ cat $arch/patch_instructions.json
{
  "packages": {
    "libarchive-3.4.2-h62408e4_0.tar.bz2": {
      "depends": [
        "bzip2 >=1.0.8,<2.0a0",
        "libgcc-ng >=7.3.0",
        "libxml2 >=2.9.9,<2.10.0a0",
        "lz4-c >=1.9.2,<1.10.0a0",
        "openssl >=1.1.1f,<1.1.2a",
        "xz >=5.2.5,<6.0a0",
        "zlib >=1.2.11,<1.3.0a0",
        "zstd >=1.4.4,<1.5.0a0"
      ]
    }
  },
  "patch_instructions_version": 1,
  "remove": [],
  "revoke": []
}
$ grep "zstd >=1.4.4" $arch/repodata.json
        "zstd >=1.4.4,<1.5.0a0"
        "zstd >=1.4.4,<1.5.0a0"

However, if I copy any other .tar.bz2 package into the channel which also needs to have the same dependency patched, it will patch that .tar.bz2 package, but won't patch the .conda package... a .tar.bz2 file matching each .conda package to be patched needs to be present in order for the script to function properly.

(base) loren@US-00009832:~/extract$ cp blosc-1.19.0-hd408876_0.tar.bz2 $arch
(base) loren@US-00009832:~/extract$ conda index  --verbose --patch-generator repodata-hotfixes/main.py "${channel}"
DEBUG:conda_build.index:found subdirs {'linux-64', 'noarch'}
Building repodata for /c/conda-build-repo/channel2/linux-64
INFO:conda_build.index:Building repodata for /c/conda-build-repo/channel2/linux-64
DEBUG:conda_build.index:hashing, extracting, and caching blosc-1.19.0-hd408876_0.tar.bz2
DEBUG:conda_build.index:using patch generator repodata-hotfixes/main.py for linux-64
Building repodata for /c/conda-build-repo/channel2/noarch
INFO:conda_build.index:Building repodata for /c/conda-build-repo/channel2/noarch
DEBUG:conda_build.index:using patch generator repodata-hotfixes/main.py for noarch
(base) loren@US-00009832:~/extract$ cat $arch/patch_instructions.json
{
  "packages": {
    "blosc-1.19.0-hd408876_0.tar.bz2": {
      "depends": [
        "libgcc-ng >=7.3.0",
        "libstdcxx-ng >=7.3.0",
        "lz4-c >=1.9.2,<1.10.0a0",
        "snappy >=1.1.7,<2.0a0",
        "zlib >=1.2.11,<1.3.0a0",
        "zstd >=1.4.4,<1.5.0a0"
      ]
    }
  },
  "patch_instructions_version": 1,
  "remove": [],
  "revoke": []
}
(base) loren@US-00009832:~/extract$ grep "zstd >=1.4.4" $arch/repodata.json
        "zstd >=1.4.4,<1.5.0a0"
        "zstd >=1.4.4,<1.4.5.0a0"

This seems like it's possibly a bug in the way that the hotfixing scripts handle .conda packages.

@lorenjanwilson lorenjanwilson changed the title hotfixes don't work if channel doesn't contain at least one .tar.bz2 package hotfixes don't work if channel doesn't contain an equivalent .tar.bz2 package Sep 3, 2020
@lorenjanwilson lorenjanwilson changed the title hotfixes don't work if channel doesn't contain an equivalent .tar.bz2 package hotfixes don't work for .conda packages if channel doesn't contain an equivalent .tar.bz2 package Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant