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

fix blacklist in alienfile #1

Merged
merged 7 commits into from Jul 10, 2018
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
83 changes: 54 additions & 29 deletions alienfile
Expand Up @@ -3,10 +3,19 @@ use alienfile;
my $test_program = <<'EOF';
#include <stdio.h>
#include <libxml/xmlversion.h>
#include <libxml/parser.h>
#include <libxml/tree.h>

int
main(int argc, char *argv[])
{
xmlDoc *doc = NULL;
/*
* xmlRead should fail, but having this call ensures
* that the we have access to the symbols in -lxml2
* (LIBXML_DOTTED_VERSION below is in the header file)
*/
doc = xmlReadFile("foo.xml", NULL, 0);
printf("xml version = '%s'\n", LIBXML_DOTTED_VERSION);
}
EOF
Expand Down Expand Up @@ -35,35 +44,51 @@ plugin 'Probe::CBuilder' => (
) for @try_flags;
plugin 'PkgConfig::MakeStatic' => ();

# TODO: refuse these versions for system install too
# (missing feature from AB core)
plugin 'Prefer::BadVersion' => [
'2.4.22.0',
'2.4.25.0', # broken XPath
'2.4.28.0', # unsupported, may work fine with earlier XML::LibXML versions
'2.4.29.0', # broken
'2.4.30.0', # broken
'2.5.0.0', # unsupported
'2.5.1.0', # all pre 2.5.4 version have broken attr output
'2.5.5.0', # tests pass, but known as broken
'2.5.11.0', # will partially work
'2.6.0.0', # unsupported
'2.6.4.0', # schema error
'2.6.5.0', # broken xincludes
'2.6.15.0',
'2.6.16.1', # first version to pass all tests
'2.6.18.1', # up to 2.6.18 all ok
'2.6.19.0', # broken c14n
'2.6.20.0', # broken schemas
'2.6.24.1', # all tests pass
'2.6.25.0', # broken XPath
'2.6.32.1', # tested, works ok
'2.7.1.0', # broken release, broken utf-16
'2.7.6.1', # tested, ok
'2.7.8.1', # tested, ok
'2.9.3.1', # schema regression
'2.9.4.0', # schema regression
];
my %bad_versions = map { $_ => 1 } (
'2.4.22',
'2.4.25', # broken XPath
'2.4.28', # unsupported, may work fine with earlier XML::LibXML versions
'2.4.29', # broken
'2.4.30', # broken
'2.5.0', # unsupported
'2.5.1', # all pre 2.5.4 version have broken attr output
'2.5.5', # tests pass, but known as broken
'2.5.11', # will partially work
'2.6.0', # unsupported
'2.6.4', # schema error
'2.6.5', # broken xincludes
'2.6.15',
'2.6.19', # broken c14n
'2.6.20', # broken schemas
'2.6.25', # broken XPath
'2.7.1', # broken release, broken utf-16
'2.9.4', # schema regression
);

meta->around_hook(
probe => sub {
my $orig = shift;
my $build = shift;
my $install_type = $orig->($build, @_);
# if the system type is install, make sure the version isn't on the
# blacklist.
# Honor $ENV{FORCE} used in the Makefile.PL for XML-LibXML to allow
# versions on the blacklist.
if($install_type eq 'system' && !$ENV{FORCE})
{
# the first value is generated by the Probe::CBuilder plugin,
# the second is from this alienfile. Either could find a system libxml.
# TODO: the capability to do this should exist in-core for Alien-Build.
my $version = $build->install_prop->{plugin_prfobe_cbuilder_gather}->{version} ||
$build->install_prop->{my_version} ||
die 'TODO: pkg-config plugins do not set version :/';
return 'share' if $bad_versions{$version};
}
$install_type;
},
);

plugin 'Prefer::BadVersion' => [ keys %bad_versions ];

share {

Expand Down