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

Alien::Build::MM: clean_install not called for system installs #417

Open
shawnlaffan opened this issue Oct 11, 2024 · 3 comments
Open

Alien::Build::MM: clean_install not called for system installs #417

shawnlaffan opened this issue Oct 11, 2024 · 3 comments

Comments

@shawnlaffan
Copy link
Contributor

Possibly not a big issue, but it seems the clean_install option is not run when doing a system install.

I assume it should?

Example below uses Alien::libtiff given it can be installed as a system dep.

Tested using Ubuntu 20.04.6 LTS with the libtiff-dev package installed.

ALIEN="Alien::libtiff"
ALIEN_DIR="Alien-libtiff"

eval "$(perl -I$HOME/foo/lib/perl5 -Mlocal::lib=$HOME/foo)"

ALIEN_INSTALL_TYPE=share perl Makefile.PL && make install

touch ~/foo/lib/perl5/x86_64-linux/auto/share/dist/${ALIEN_DIR}/unclean.txt
ls ~/foo/lib/perl5/x86_64-linux/auto/share/dist/${ALIEN_DIR}/unclean.txt

make clean 
ALIEN_INSTALL_TYPE=share perl Makefile.PL && make install
ls ~/foo/lib/perl5/x86_64-linux/auto/share/dist/${ALIEN_DIR}/unclean.txt
#  is gone

touch ~/foo/lib/perl5/x86_64-linux/auto/share/dist/${ALIEN_DIR}/unclean.txt
ls ~/foo/lib/perl5/x86_64-linux/auto/share/dist/${ALIEN_DIR}/unclean.txt

make clean
ALIEN_INSTALL_TYPE=system perl Makefile.PL && make install
ls ~/foo/lib/perl5/x86_64-linux/auto/share/dist/${ALIEN_DIR}/unclean.txt
#  still there, as are the bin, lib etc dirs
@shawnlaffan shawnlaffan changed the title Alein::Build::MM: clean_install not called for system installs Alien::Build::MM: clean_install not called for system installs Oct 13, 2024
@plicease
Copy link
Member

I think this was an oversight by myself. For consistency we should do clean_install for system installs too.

@shawnlaffan
Copy link
Contributor Author

It should just be a case of removing the conditional at

if($self->install_type eq 'share')

I can PR that.

Adding tests is slightly more complicated. It needs to be a share install followed by a share install, and then check the share dir is appropriately cleaned up. I'm not yet sure where to add this.

@shawnlaffan
Copy link
Contributor Author

Adding tests is slightly more complicated. It needs to be a share install followed by a share install, and then check the share dir is appropriately cleaned up. I'm not yet sure where to add this.

There is a test for this, for which the expectations need to be flipped.

subtest 'do not remove on system install' => sub {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants