Skip to content

Download::Negotiate warning false positive when using Download::GitHub plugin #431

@jjn1056

Description

@jjn1056

Bug Description

The warning added in #388/#390 triggers a false positive when using the Download::GitHub plugin correctly.

Steps to Reproduce

  1. Create an alienfile using Download::GitHub:
use alienfile;

plugin 'PkgConfig' => 'libnghttp2';

share {
    requires 'Alien::Build::Plugin::Download::GitHub' => '0.10';
    
    plugin 'Download::GitHub' => (
        github_user => 'nghttp2',
        github_repo => 'nghttp2',
    );
    # ...
};
  1. Run perl Makefile.PL

  2. Warning appears:

Alien::Build::Plugin::Download::Negotiate> !! WARNING !! WARNING !!
Alien::Build::Plugin::Download::Negotiate> !! WARNING !! It looks like this alien is using the regular download negotiator
Alien::Build::Plugin::Download::Negotiate> plugin on a GitHub release page...

Root Cause

The warning regex in Download::Negotiate line 216:

if($self->url =~ /^http.*github.com.*releases$/)

Matches both:

  • https://github.com/user/repo/releases (web page - correct to warn)
  • https://api.github.com/repos/user/repo/releases (API - false positive)

When Download::GitHub sets start_url to the API endpoint, then applies the Download plugin, the warning incorrectly fires.

Impact

This affects all Alien distributions using Download::GitHub. Tested with:

  • Alien::xz (same warning)
  • Alien::Ninja (same warning)

The warning is cosmetic - everything works correctly. But it's confusing for users who are already using the recommended plugin.

Suggested Fix

Change the regex to exclude API URLs:

if($self->url =~ /^https?:\/\/github\.com\/[^\/]+\/[^\/]+\/releases$/)

Or use a negative lookbehind:

if($self->url =~ /^http.*(?<!api\.)github\.com.*releases$/)

Environment

  • Alien::Build 2.84
  • Alien::Build::Plugin::Download::GitHub 0.10
  • perl 5.40.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions