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

make install does not respect LIBDIR, always installs to LIBDIR/../lib/ #646

Closed
spike77453 opened this issue May 2, 2024 · 7 comments · Fixed by #652
Closed

make install does not respect LIBDIR, always installs to LIBDIR/../lib/ #646

spike77453 opened this issue May 2, 2024 · 7 comments · Fixed by #652

Comments

@spike77453
Copy link
Contributor

spike77453 commented May 2, 2024

Since znapzend 0.22.0 make install does not respect LIBDIR any more and tries to install the *.pm files to LIBDIR/.../lib/:

$ ./configure --libdir=/usr/share/perl5/vendor_perl/
checking in to see how you are doing... keep fighting man!
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '0' is supported by ustar format... yes
checking whether GID '0' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
checking for perl... /usr/bin/perl
checking for curl... /usr/bin/curl
checking for wget... /usr/bin/wget
checking for pod2man... /usr/bin/pod2man
checking for rm... /usr/bin/rm
checking for CONFIG_YEAR and CONFIG_DATE... got 2024 and 2024-05-03 respectively
checking default SMF service name... oep/znapzend
checking for way to cat URLs... /usr/bin/wget -O -
checking for perl version greater than or equal to 5.16.0... checking is perl reasonably complete... yes. ExtUtils::MakeMaker is available
checking if require a c compiler to get perl modules compiled... no
checking for grep that handles long lines and -e... /usr/bin/grep
checking for gnumake... no
checking for gmake... /usr/bin/gmake
checking for gnu make availability... /usr/bin/gmake is GNU make
checking the price for bergulian eckels... way to expensive!
checking for PERL_MODULES... $(top_srcdir)/lib/ZnapZend.pm $(top_srcdir)/lib/ZnapZend/Config.pm $(top_srcdir)/lib/ZnapZend/Time.pm $(top_srcdir)/lib/ZnapZend/ZFS.pm $(top_srcdir)/lib/inheritLevels.pm 
checking for PERL_CONFIG_VERSION... 5.38
checking for PERL_THIRDPARTY_DIST cache... empty
configure: Generating "data" files from templates, see below for executable scripts
configure: Generating templated script files that should be marked executable
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating thirdparty/Makefile
config.status: creating lib/Makefile
config.status: creating debian/Makefile
config.status: creating debian/znapzend.links
config.status: creating init/znapzend.service
config.status: creating init/znapzend.xml
config.status: WARNING:  'init/znapzend.xml.in' seems to ignore the --datarootdir setting
config.status: creating init/org.znapzend.plist
config.status: creating init/znapzend.freebsd
config.status: creating init/znapzend.sysv
config.status: creating init/znapzend.upstart

** CONFIGURE DONE **********************************************

Settings:

  PERL5LIB = not set
  PERL = /usr/bin/perl
  SVCINSTALLDIR = no
  URL_CAT = /usr/bin/wget -O -
  DEB_BUILD = false

The Makefiles should be portable to the best extent of our testing,
but their recipes should most certainly succeed with GNU make.
It is recommended that now you continue installation with

  /usr/bin/gmake install
$ make
...
$ make install
Making install in lib
make[1]: Entering directory '/tmp/znapzend/znapzend-0.22.0/lib'
make[2]: Entering directory '/tmp/znapzend/znapzend-0.22.0/lib'
make[2]: Nothing to be done for 'install-exec-am'.
 /usr/bin/mkdir -p '/usr/share/perl5/vendor_perl'
 /usr/bin/mkdir -p '/usr/share/perl5/vendor_perl/../lib/ZnapZend'
 /usr/bin/install -c -m 644  ../lib/ZnapZend/Config.pm ../lib/ZnapZend/Time.pm ../lib/ZnapZend/ZFS.pm '/usr/share/perl5/vendor_perl/../lib/ZnapZend'
 /usr/bin/mkdir -p '/usr/share/perl5/vendor_perl/../lib'
 /usr/bin/install -c -m 644  ../lib/ZnapZend.pm ../lib/inheritLevels.pm '/usr/share/perl5/vendor_perl/../lib'
...

git bisect says it was introduced in this commit: e690f41

@oetiker
Copy link
Owner

oetiker commented May 3, 2024

@jimklimov I guess the Makefile.am in lib needs a tweak too

@jimklimov
Copy link
Contributor

jimklimov commented May 27, 2024

Sorry, missed the notification. I'll take a look soon.

@github: I miss a "facepalm" emoticon in the list.

@jimklimov
Copy link
Contributor

jimklimov commented May 27, 2024

Confirming the issue. Oddly enough, things installed by bin/cpanm tool do follow the specified LIBDIR:

### OK:
     6856     32 -rwxr-xr-x   1 jim      jim         28772 May 27 20:34 /dev/shm/zzz-0.22.0/opt/znapzend-0.22.0/bin/znapzend
...
     6820      0 drwxr-xr-x   2 jim      jim            80 May 27 20:34 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/x86_64-linux-gnu-thread-multi/.meta/Mojolicious-9.36
     6822      4 -r--r--r--   1 jim      jim          1716 May 27 20:34 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/x86_64-linux-gnu-thread-multi/.meta/Mojolicious-9.36/MYMETA.json
     6821      8 -r--r--r--   1 jim      jim          7066 May 27 20:34 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/x86_64-linux-gnu-thread-multi/.meta/Mojolicious-9.36/install.json
     6818      4 -rw-r--r--   1 jim      jim          1309 May 27 20:34 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/x86_64-linux-gnu-thread-multi/perllocal.pod
...
     6787      4 -r--r--r--   1 jim      jim           741 May 27 20:34 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/Role/Tiny/With.pm
     6784     32 -r--r--r--   1 jim      jim         29618 May 27 20:34 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/Mojolicious.pm
...

### WRONG:
     6586      0 drwxr-xr-x   3 jim      jim           100 May 27 20:33 /dev/shm/zzz-0.22.0/usr/share/perl5/lib
     6592     92 -rw-r--r--   1 jim      jim         90429 May 27 20:33 /dev/shm/zzz-0.22.0/usr/share/perl5/lib/ZnapZend.pm
     6591      8 -rw-r--r--   1 jim      jim          6044 May 27 20:33 /dev/shm/zzz-0.22.0/usr/share/perl5/lib/inheritLevels.pm
     6587      0 drwxr-xr-x   2 jim      jim           100 May 27 20:33 /dev/shm/zzz-0.22.0/usr/share/perl5/lib/ZnapZend
     6590     76 -rw-r--r--   1 jim      jim         77492 May 27 20:33 /dev/shm/zzz-0.22.0/usr/share/perl5/lib/ZnapZend/ZFS.pm
     6589     28 -rw-r--r--   1 jim      jim         28411 May 27 20:33 /dev/shm/zzz-0.22.0/usr/share/perl5/lib/ZnapZend/Config.pm
     6588     12 -rw-r--r--   1 jim      jim         10333 May 27 20:33 /dev/shm/zzz-0.22.0/usr/share/perl5/lib/ZnapZend/Time.pm

This may be thanks to our znapzend/thirdparty/Makefile.am being explicit about this though:

install-exec-hook:
        cp -fr lib/perl5/* $(DESTDIR)$(libdir)    

@jimklimov
Copy link
Contributor

Thinking of the latter, I wonder if installing znapzend dependencies from third party modules into system perl location is correct or a problem as well? Maybe needs a configure toggle too?..

@jimklimov
Copy link
Contributor

As for this issue, the problem seems to be with detection of PERL_MODULES including the srcdir (or rather top_srcdir) and then automake picking up the directory component as imperative for installation.

In the lib/Makefile(.am) the PM = @PERL_MODULES@ becomes eventually nobase_data_DATA which goes "under" datadir=libdir (for that lib makefile). The definition of "under" with relative paths involving ../lib is the issue.

@jimklimov
Copy link
Contributor

With the fix: default configuration (private libdir):

:; make distclean ; rm -rf /dev/shm/zzz-0.22.0 ; ./bootstrap.sh ; ./configure ; make DESTDIR=/dev/shm/zzz-0.22.0 install &&  find /dev/shm/zzz-0.22.0 -ls
...
     6913      8 -r--r--r--   1 jim      jim          6118 May 27 21:27 /dev/shm/zzz-0.22.0/opt/znapzend-0.22.0/lib/Mojo/Asset/File.pm
     6891      0 drwxr-xr-x   2 jim      jim           100 May 27 21:26 /dev/shm/zzz-0.22.0/opt/znapzend-0.22.0/lib/ZnapZend
     6894     76 -rw-r--r--   1 jim      jim         77492 May 27 21:26 /dev/shm/zzz-0.22.0/opt/znapzend-0.22.0/lib/ZnapZend/ZFS.pm
     6893     28 -rw-r--r--   1 jim      jim         28411 May 27 21:26 /dev/shm/zzz-0.22.0/opt/znapzend-0.22.0/lib/ZnapZend/Config.pm
     6892     12 -rw-r--r--   1 jim      jim         10333 May 27 21:26 /dev/shm/zzz-0.22.0/opt/znapzend-0.22.0/lib/ZnapZend/Time.pm
     6890     92 -rw-r--r--   1 jim      jim         90429 May 27 21:26 /dev/shm/zzz-0.22.0/opt/znapzend-0.22.0/lib/ZnapZend.pm
     6889      8 -rw-r--r--   1 jim      jim          6044 May 27 21:26 /dev/shm/zzz-0.22.0/opt/znapzend-0.22.0/lib/inheritLevels.pm

With a customized libdir:

:; make distclean ; rm -rf /dev/shm/zzz-0.22.0 ; ./bootstrap.sh ; ./configure  --libdir=/usr/share/perl5/vendor_perl/ ; make DESTDIR=/dev/shm/zzz-0.22.0 install &&  find /dev/shm/zzz-0.22.0 -ls
...
     7194      8 -r--r--r--   1 jim      jim          6118 May 27 21:28 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/Mojo/Asset/File.pm
     7172      0 drwxr-xr-x   2 jim      jim           100 May 27 21:28 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/ZnapZend
     7175     76 -rw-r--r--   1 jim      jim         77492 May 27 21:28 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/ZnapZend/ZFS.pm
     7174     28 -rw-r--r--   1 jim      jim         28411 May 27 21:28 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/ZnapZend/Config.pm
     7173     12 -rw-r--r--   1 jim      jim         10333 May 27 21:28 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/ZnapZend/Time.pm
     7171     92 -rw-r--r--   1 jim      jim         90429 May 27 21:28 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/ZnapZend.pm
     7170      8 -rw-r--r--   1 jim      jim          6044 May 27 21:28 /dev/shm/zzz-0.22.0/usr/share/perl5/vendor_perl/inheritLevels.pm

QUESTION: @spike77453 @oetiker : is presence of inheritLevels.pm and/or ZnapZend.pm right in the libdir a problem, especially the former? I see most other modules fit in their dedicated directories (not all).

jimklimov added a commit to jimklimov/znapzend that referenced this issue May 27, 2024
…all") and PERL_MODULES_EXTRA_DIST (for dist tarballing) [oetiker#646]

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
@spike77453
Copy link
Contributor Author

QUESTION: @spike77453 @oetiker : is presence of inheritLevels.pm and/or ZnapZend.pm right in the libdir a problem, especially the former? I see most other modules fit in their dedicated directories (not all).

That's how it's been until e690f41 so it's not a huge issue. However, I've never submitted a package review to Fedora/EPEL (mainly due to time concerns, I'd need to maintain/package the missing perl libraries as well) and only maintained a copr repository with much looser restrictions.
I think that libdir/ZnapZend/inheritLevels.pm is probably the correct place though to avoid file name conflicts with other packages.

Please keep in mind that my use case is rather narrow and I'm only concerned about Fedora/EPEL (and not particular familiar with the perl ecosystem on top of that) so please take what I say with a grain of salt. I can ask the folks of the Fedora Perl SIG though if you need a more informed answer.

jimklimov added a commit to jimklimov/znapzend that referenced this issue May 28, 2024
…inimize confusion

From issue oetiker#646 discussion follow-up

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
jimklimov added a commit to jimklimov/znapzend that referenced this issue May 28, 2024
…inimize confusion

From issue oetiker#646 discussion follow-up

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
jimklimov added a commit to jimklimov/znapzend that referenced this issue May 28, 2024
…inimize confusion

From issue oetiker#646 discussion follow-up

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
jimklimov added a commit to jimklimov/znapzend that referenced this issue May 28, 2024
…inimize confusion

From issue oetiker#646 discussion follow-up

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
jimklimov added a commit to jimklimov/znapzend that referenced this issue May 28, 2024
…inimize confusion

From issue oetiker#646 discussion follow-up

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
jimklimov added a commit to jimklimov/znapzend that referenced this issue Jun 2, 2024
…inimize confusion

From issue oetiker#646 discussion follow-up

Signed-off-by: Jim Klimov <jimklimov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants