jordansissel/fpm · warning

Converting dependency #{dep} to #{name} >= #{version}, #{nam

Error message

Converting dependency #{dep} to #{name} >= #{version}, #{name} < #{nextversion}

What it means

With --ignore-iteration-in-dependencies enabled, the rpm output target rewrites every exact-pin dependency 'name = X' into the pair 'name >= X' and 'name < X.next', where X.next bumps the last dot-separated component by one. The warning lists the original dep and both replacements. Non-numeric components become 0 via to_i, which can produce an incorrect upper bound.

Source

Thrown at lib/fpm/package/rpm.rb:371

      name, op, version = dep.split(/\s+/)
      dep_ok = true
      if op == '!='
        self.conflicts << "#{name} = #{version}"
        dep_ok = false
      end
      dep_ok
    end

    # if --ignore-iteration-in-dependencies is true convert foo = X, to
    # foo >= X , foo < X+1
    if self.attributes[:rpm_ignore_iteration_in_dependencies?]
      self.dependencies = self.dependencies.collect do |dep|
        name, op, version = dep.split(/\s+/)
        if op == '='
          nextversion = version.split('.').collect { |v| v.to_i }
          nextversion[-1] += 1
          nextversion = nextversion.join(".")
          logger.warn("Converting dependency #{dep} to #{name} >= #{version}, #{name} < #{nextversion}")
          ["#{name} >= #{version}", "#{name} < #{nextversion}"]
        else
          dep
        end
      end.flatten
    end

  setscript = proc do |scriptname|
      script_path = self.attributes[scriptname]
      # Skip scripts not set
      next if script_path.nil?
      if !File.exist?(script_path)
        logger.error("No such file (for #{scriptname.to_s}): #{script_path.inspect}")
        script_errors	 << script_path
      end
      # Load the script into memory.
      scripts[scriptname] = File.read(script_path)
    end

View on GitHub (pinned to b6d77ba72a)

Solutions

  1. Drop --ignore-iteration-in-dependencies when exact '=' pins must survive into the rpm spec
  2. Write the intended range explicitly: `--depends 'foo >= 1.2.3' --depends 'foo < 1.2.4'`
  3. Keep version components numeric so the +1 upper bound is computed correctly; avoid strings like '1.2.beta'

Example fix

# before
fpm -s python -t rpm --ignore-iteration-in-dependencies --depends 'requests = 2.31.0' requests

# after: express the range you actually want
fpm -s python -t rpm --depends 'python-requests >= 2.31.0' --depends 'python-requests < 2.32' requests
Defensive patterns

Strategy: validation

Validate before calling

# Warn when the automatic rewrite will change your exact pins
if grep -q -- '--ignore-iteration-in-dependencies' build/fpm.sh \
   && grep -qE -- '--depends[= ][^ ]+ = ' build/fpm.sh; then
  echo 'NOTE: exact = pins will be rewritten to >= / < ranges' >&2
fi

Type guard

def exact_pin?(dep)
  _name, op, _version = dep.split(/\s+/)
  op == '='
end

Prevention

When it happens

Trigger: Building an rpm with `fpm -t rpm --ignore-iteration-in-dependencies --depends 'foo = 1.2.3'`, or any source (e.g. python with '==' pins) that feeds '=' dependencies into an rpm build while the flag is on.

Common situations: Teams that want the built rpm to depend on any release/iteration of a base package; mixing python's '==' requirement semantics with rpm output and only noticing the rewrite in the generated spec.

Related errors


AI-assisted analysis of jordansissel/fpm@b6d77ba72a (2026-08-21). Data as JSON: /api/errors/9a1e0930eccfb32c. Report an issue: GitHub.