scancode-license-data --path <directory> fails
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- docker, python
- Domain
- build-system, cli, devops
Research direction
Inspect the Python section of the Dockerfile and reproduce the failing scancode-license-data --path command during the Docker build. Check the installed ScanCode command and version, then verify that the build completes and /opt/scancode-license-data contains the intended .LICENSE files without the removed files or static directory.
Written by the indexing model from the issue text.
Description
While running OSS Review Toolkit (ORT) with: docker build -t ort .
[pythonbuild 4/6] RUN scancode-license-data --path /opt/scancode-license-data:
0.596 /opt/python/versions/3.11.9/lib/python3.11/site-packages/typecode/magic2.py:195: UserWarning: System libmagic found in typical location is used. Install instead a typecode-libmagic plugin for best support.
0.596 warnings.warn(
0.618 Usage: scancode-license-data [OPTIONS]
0.618
0.618 Error: Got unexpected extra argument (/opt/scancode-license-data)
ERROR: failed to build: failed to solve: process "/bin/bash -o pipefail -c scancode-license-data --path /opt/scancode-license-data" did not complete successfully: exit code: 2
I'm on mac using arm64, and I modified the dockerfile slightly, to get past some other errors like : missing libicu-dev, pkg-config and python3-distutils. I also messed around with changing the python version as well as the scancode version...
The method of dumping the licenses does not seem to work? I've tried almost everything and I am out of ideas. Please save me!
Where in code?
In ORT's source code, the Dockerfile contains information on the build, in the Dockerfile (under the Python section):
Scancode extract license ...
#------------------------------------------------------------------------
# PYTHON - Build Python as a separate component with pyenv
FROM base AS pythonbuild
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sudo apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends \
libreadline-dev \
libicu-dev \
python3-distutils \
libgdbm-dev \
libsqlite3-dev \
libssl-dev \
libbz2-dev \
liblzma-dev \
tk-dev \
&& sudo rm -rf /var/lib/apt/lists/*
ARG PYTHON_VERSION
ARG PYENV_GIT_TAG
ENV PYENV_ROOT=/opt/python
ENV PATH=$PATH:$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PYENV_ROOT/conan2/bin
RUN curl -kSs https://pyenv.run | bash \
&& pyenv install -v $PYTHON_VERSION \
&& pyenv global $PYTHON_VERSION
ARG CONAN_VERSION
ARG CONAN2_VERSION
ARG PYTHON_INSPECTOR_VERSION
ARG PYTHON_PIPENV_VERSION
ARG PYTHON_POETRY_VERSION
ARG PYTHON_POETRY_PLUGIN_EXPORT_VERSION
ARG PYTHON_SETUPTOOLS_VERSION
ARG PIP_VERSION
ARG SCANCODE_VERSION
RUN ARCH=$(arch | sed s/aarch64/arm64/) \
&& if [ "$ARCH" == "arm64" ]; then \
pip install -U scancode-toolkit-mini==$SCANCODE_VERSION; \
else \
curl -Os https://raw.githubusercontent.com/nexB/scancode-toolkit/v$SCANCODE_VERSION/requirements.txt; \
pip install -U --constraint requirements.txt scancode-toolkit==$SCANCODE_VERSION setuptools==$PYTHON_SETUPTOOLS_VERSION; \
rm requirements.txt; \
fi
**# Extract ScanCode license texts to a directory.
RUN mkdir -p /opt/scancode-license-data \
&& scancode-license-data --path /opt/scancode-license-data \
&& find /opt/scancode-license-data -type f -not -name "*.LICENSE" -exec rm -f {} + \
&& rm -rf /opt/scancode-license-data/static**
RUN pip install --no-cache-dir -U \
pip=="$PIP_VERSION" \
wheel \
&& pip install --no-cache-dir -U \
Mercurial \
conan=="$CONAN_VERSION" \
pipenv=="$PYTHON_PIPENV_VERSION" \
poetry=="$PYTHON_POETRY_VERSION" \
poetry-plugin-export=="$PYTHON_POETRY_PLUGIN_EXPORT_VERSION" \
python-inspector=="$PYTHON_INSPECTOR_VERSION" \
setuptools=="$PYTHON_SETUPTOOLS_VERSION"
RUN mkdir /tmp/conan2 && cd /tmp/conan2 \
&& wget https://github.com/conan-io/conan/releases/download/$CONAN2_VERSION/conan-$CONAN2_VERSION-linux-x86_64.tgz \
&& tar -xvf conan-$CONAN2_VERSION-linux-x86_64.tgz\
# Rename the Conan 2 executable to "conan2" to be able to call both Conan version from the package manager.
&& mkdir $PYENV_ROOT/conan2 && mv /tmp/conan2/bin $PYENV_ROOT/conan2/ \
&& mv $PYENV_ROOT/conan2/bin/conan $PYENV_ROOT/conan2/bin/conan2
FROM scratch AS python
COPY --from=pythonbuild /opt/python /opt/python
FROM scratch AS scancode-license-data
COPY --from=pythonbuild /opt/scancode-license-data /opt/scancode-license-data
#------------------------------------------------------------------------
- Dominant language
- Makefile
- Stars
- 70
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aboutcode-org/scancode-licensedb
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
How to cite?Open
Difficulty 2/5 Under an hour Newbie friendliness 22/100
aboutcode-org/scancode-licensedb#84 · 1 comment ·
-
Wrong format for exceptions?May be free again @AyanSinhaMahapatra claimed this 435 days ago, and no pull request is open. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
aboutcode-org/scancode-licensedb#71 · 2 comments · 2 assignees ·
-
Table Header Becomes Invisible When Scrolling DownPossibly taken @alok1304 claimed this 659 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
CryptoSwift license incorrectly identified as ZlibMay be free again @AyanSinhaMahapatra claimed this 675 days ago, and no pull request is open. Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
aboutcode-org/scancode-licensedb#61 · 1 comment · 1 reaction · 2 assignees ·
All issues in aboutcode-org/scancode-licensedb
Similar issues
-
area-testing p1-recommended
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
OpenSpace/OpenSpace#4353 · 1 comment ·
Maintainers usually reply within 5 days
-
0.kind: build failure
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
bioconda/bioconda-recipes#70683 ·
Maintainers usually reply within 1 day