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

add test for parse test for _libgcc_mutex conda package #51

Closed
wants to merge 1 commit into from

Conversation

bollwyvl
Copy link

Thanks for this tool!

While working on using this after getting it to install in a relaxed environment (as described in #44), I'm seeing the following issues with some non-anaconda.com packages:

conda-forge/jake-feedstock#3 (comment)

(reproduced below)

Haven't had a chance to dig into exactly what is going wrong, but though that a failing test might demonstrate what I'm seeing, after a brief scan of parse_conda_list_str_to_conda_package.


This is up to building locally, but trying a self-test with

conda list --explicit | jake sbom -t CONDA

yielded:

Put your Python dependencies in a chokehold

  File "$PREFIX/lib/python3.9/site-packages/jake/app.py", line 65, in execute
    exit_code: int = command.execute(arguments=self._arguments)
  File "$PREFIX/lib/python3.9/site-packages/jake/command/__init__.py", line 33, in execute
    self.handle_args()
  File "$PREFIX/lib/python3.9/site-packages/jake/command/sbom.py", line 37, in handle_args
    bom = Bom.from_parser(self._get_parser())
  File "$PREFIX/lib/python3.9/site-packages/jake/command/sbom.py", line 104, in _get_parser
    return CondaListExplicitParser(conda_data=input_data)
  File "$PREFIX/lib/python3.9/site-packages/cyclonedx/parser/conda.py", line 37, in __init__
    self._parse_to_conda_packages(data_str=conda_data)
  File "$PREFIX/lib/python3.9/site-packages/cyclonedx/parser/conda.py", line 95, in _parse_to_conda_packages
    conda_package = parse_conda_list_str_to_conda_package(conda_list_str=line)
  File "$PREFIX/lib/python3.9/site-packages/cyclonedx/utils/conda.py", line 105, in parse_conda_list_str_to_conda_package
    build_number = int(bnbs_parts.pop())
ValueError: invalid literal for int() with base 10: 'forge'
Tests failed for jake-1.1.0-py_0.tar.bz2 - moving package to /opt/conda/conda-bld/broken
WARNING:conda_build.build:Tests failed for jake-1.1.0-py_0.tar.bz2 - moving package to /opt/conda/conda-bld/broken
WARNING conda_build.build:tests_failed(2955): Tests failed for jake-1.1.0-py_0.tar.bz2 - moving package to /opt/conda/conda-bld/broken
TESTS FAILED: jake-1.1.0-py_0.tar.bz2

I'm wagering this is due to:

https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2

@jkowalleck
Copy link
Member

@bollwyvl could you follow https://github.com/CycloneDX/cyclonedx-python-lib/pull/51/checks?check_run_id=4057551860
and sign your commits, in order to give consent that your code is put under the license this project follows?

@jkowalleck jkowalleck added the enhancement New feature or request label Nov 6, 2021
@jkowalleck jkowalleck requested a review from a team November 7, 2021 09:14
@jkowalleck jkowalleck requested a review from a team November 9, 2021 17:11
@madpah
Copy link
Collaborator

madpah commented Nov 10, 2021

Thanks for the example @bollwyvl - I always suspected that parsing of the Conda packages would be a bit brittle!

The specification doesn't seem to be quite verbose enough to allow us to reliably parse build_number from build, but given your example, sure we can improves from what we have today.

FYI: @jkowalleck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants