#509: tools/dev/install_files.pl did not care about symlinks
---------------------+------------------------------------------------------
Reporter: gerd | Owner: jkeenan
Type: todo | Status: assigned
Priority: major | Milestone:
Component: install | Version: 1.0.0
Severity: medium | Keywords:
Lang: | Patch: new
Platform: linux |
---------------------+------------------------------------------------------
Comment(by particle):
Replying to [comment:10 jkeenan]:
> Replying to [comment:9 allison]:
> > I'm happy to go ahead and apply it if we get testing on our big 3
platforms. But, we should wrap the symlink call in an eval providing a
more meaningful error message to future-proof porting.
>
> I have created the ''tt509_install_files'' branch in SVN to implement
this. Here is what I am applying in that branch:
> {{{
> $ svn diff
> Index: lib/Parrot/Install.pm
> ===================================================================
> --- lib/Parrot/Install.pm (revision 40089)
> +++ lib/Parrot/Install.pm (working copy)
> @@ -226,6 +226,21 @@
> else {
> next unless -e $src;
> next if $^O eq 'cygwin' and -e "$src.exe"; # stat works,
copy not
> + if (-l $src) {
> + # check if the system supports symbolic linking
> + use Config;
> + if ($Config{d_symlink} && $Config{d_readlink}) {
> + # copy as symbolic link;
> + # be extra cautious about existence of symlinks
> + # on a given OS
> + my $symlink_exists = eval {
> + symlink(readlink($src), $dest); 1;
> + };
> + die "$@" unless $symlink_exists;
> + print "$dest\n";
> + next;
> + }
> + }
> copy( $src, $dest ) or die "Error: couldn't copy $src to
$dest: $!\n";
> print "$dest\n";
> }
> }}}
> Can we get some people on Win32 systems to check out this branch,
configure with `perl Configure.pl
--prefix=C:\tmp\some\appropriate\directory`, then `make manifest_tests &&
make && make install` and post results in this ticket?
>
> (I specify `make manifest_tests` because that's where the tests of the
install tools are located, `make`-wise.)
>
> `make manifest_tests` and `make install` work properly on Linux -- but
then you'd expect them to, wouldn't you?
>
> Thank you very much.[[BR]]
> kid51
i'm afraid this won't be good enough. for example, many linux distros
allow a user to mount fat32 filesystems, which do not support symlinks.
therefore, it is not sufficient to test the 'system' for symlink support.
the filesystem (or filesystems) where the build is performed must be
tested for symlink support during the build, and the filesystem (or
filesystems) where parrot is to be installed must be tested for symlink
support during install.
anything less will not be portable.
this brings up an interesting point, we have no linux systems with fat32
mounts to my knowledge in our smoke farm. these configurations would make
interesting additions, to help us challenge our assumptions about
filesystems throughout our codebase.
~particle
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/509#comment:11>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets