aboutcode-org / aboutcode-org/scancode-toolkit

Extra `.freeze` left in parsing gemspec files

Abierto
#2,513 2 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Python
Estrellas
2.6k
Forks
791
Merge medio
1 d 12 h
PR fusionados (30 d)
5

Descripción

### Description

> Please leave a brief description of the bug or feature request:

### How To Reproduce

> Tell us how to reproduce the issue.

Run [docker pipeline](https://scancodeio.readthedocs.io/en/latest/scanpipe-tutorial-1.html) in scancode.io on a docker image created by building from this Dockerfile:

```
FROM ubuntu:20.04
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential libyaml-dev libreadline-dev \
zlib1g-dev libncurses5-dev libffi-dev libgdbm6 \
libgdbm-dev libssl-dev libxext6 libxml2-dev \
binutils ca-cacert wget unzip
WORKDIR /tmp
RUN wget --no-check-certificate https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.2.zip \
&& unzip -q ruby-2.7.2.zip \
&& cd /tmp/ruby-2.7.2 \
&& bash configure && make && make install
RUN gem update --no-document --system && gem install --no-document bundle
```

This is essentially a bug in [this function](https://github.com/nexB/scancode-toolkit/blob/develop/src/packagedcode/rubygems.py#L603).

Sample .gemspec file for consideration, taken from `/usr/lib/ruby/gems/2.7.0/specifications/default/benchmark-0.1.0.gemspec` from my local machine.

```
# -*- encoding: utf-8 -*-
# stub: benchmark 0.1.0 ruby lib

Gem::Specification.new do |s|
s.name = "benchmark".freeze
s.version = "0.1.0"

s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
s.metadata = { "homepage_uri" => "https://github.com/ruby/benchmark", "source_code_uri" => "https://github.com/ruby/benchmark" } if s.respond_to? :metadata=
s.require_paths = ["lib".freeze]
s.authors = ["Yukihiro Matsumoto".freeze]
s.bindir = "exe".freeze
s.date = "2021-04-15"
s.description = "a performance benchmarking library".freeze
s.email = ["matz@ruby-lang.org".freeze]
s.files = ["benchmark.rb".freeze, "benchmark/version.rb".freeze]
s.homepage = "https://github.com/ruby/benchmark".freeze
s.licenses = ["BSD-2-Clause".freeze]
s.rubygems_version = "3.1.2".freeze
s.summary = "a performance benchmarking library".freeze
end
```

### System configuration

> For bug reports, it really helps us to know:

* What OS are you running on? (Windows/MacOS/Linux) Ubuntu20.04
* What version of scancode-toolkit was used to generate the scan file? 21.3.31
* What installation method was used to install/run scancode? via scancode.io installation

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.