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

example/user/tool does not work #401

Closed
jimav opened this issue May 11, 2023 · 3 comments
Closed

example/user/tool does not work #401

jimav opened this issue May 11, 2023 · 3 comments
Labels
🐞Bug Something fails that should not (not a feature) 📖Documentation Needs new or re-worded documentation

Comments

@jimav
Copy link

jimav commented May 11, 2023

The example code in example/user/tool/LZMA/Example.pm does not actually work.

It appears to work because the 'xz' program is already installed in my system. If I temporarily rename /usr/bin/xz then the example's lzma_version_string function returns undef.

I have Alien::xz v0.08 installed.

Most likely the problem is obvious; but I am newly trying to figure out Alien::Build and so don't know where to start. It would be helpful if the examples could be tested. Thanks.

#!/usr/bin/env perl
use strict; use warnings;

use File::Which;
BEGIN{
  if (my $path = File::Which::which("xz")) {
    die "$path exists;\n",
        "  You must rename or move it aside temporarily for this test\n";
  }
}

use lib "/home/jima/src/Alien-Build-2.79/example/user/tool/lib";
use LZMA::Example qw(lzma_version_string);

my $s = lzma_version_string();
die "Result is undef" unless defined($s);  # **DIES HERE**

print "GOT: $s\n";
@plicease
Copy link
Member

This is expected if Alien::xz detected the system xz when it was installed. If you force a share install (which will build xz) then you should get the built xz

$ env ALIEN_INSTALL_TYPE=share cpanm --reinstall Alien::xz

@plicease
Copy link
Member

plicease commented May 11, 2023

...but... you are also right there is also a bug in the example .pm file.

@plicease plicease added 🐞Bug Something fails that should not (not a feature) 📖Documentation Needs new or re-worded documentation labels May 11, 2023
@plicease
Copy link
Member

I believe this to be fixed in 2.80. Please let me know if I missed something. Thank you for raising this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞Bug Something fails that should not (not a feature) 📖Documentation Needs new or re-worded documentation
Development

No branches or pull requests

2 participants