Bob wrote:
Hello,

I am trying to deploy an application from unix to windows, using PAR.
The problem is as follows.

The application uses modules from CPAN that require
local compilation (they have c code in it).

1. When packing the application for cross-platform
deployment, from unix to windows, does PAR compile the
modules in unix using gcc with windows flags, and then
embeds the windows version? (If not, why not, given
that gcc could compile for platforms different than
the local one.)

2. If one uses "on-demand library fetching" instead of
built-in modules, is this feature smart enough to
choose the right platform?

3. Reading the tutorial,

(http://search.cpan.org/dist/PAR/lib/PAR/Tutorial.pod#Cross-
platform_Packages)


I got puzzled by the following:

---
* Suppose we need out.par on both Win32 and Finix:

  C:\> pp --multiarch --output=out.par src.pl
  ...copy src.pl and out.par to a Finix machine...
  % pp --multiarch --output=out.par src.pl

* Now it works on both platforms:

  % parl out.par                 # runs src.pl
  % perl -MPAR=out.par -e '...'  # uses modules inside
out.par

---

In particular, I got puzzled by "runs src.pl" when
clearly running "out.par". The aim of packing
applications is to avoid deploying the source code, so
why referring to the source?

4. The last question is whether PAR makes additional
tests to ensure the application is properly packaged
against windows. I am referring, for example, to

- system calls --- If any are present, PAR should
either warn you, or embed a recent cygwin.dll and
trigger those calls via cygwin. Then the question is,
does PAR uses cygwin when packing for windows?

- sytem calls to applications (possibly commercial
ones) --- If any are present, PAR should list the
applications, and warn that the perl package will not
work if those other applications are not installed in
the receiving machine.

- paths --- If the code uses $ENV{HOME}, for example,
PAR could warn about the problem, and suggest a
solution, or rather, build the solution on the fly and
avoid bothering the developer.

- anyhting else that matters, and you might want to
add.

Thank you.
B.H.

PAR/PP cannot package what it does not have. If you have a pure perl script that does not involve any compiled code or target-machine specific libraries you can create a par file just as you can a .zip or .gz file. That kind of par file will run on any target machine with a properly installed Perl. However, in order to package any needed libraries, it has to first have access to those libraries. In that case you have to be on a Linux machine in order to build a package that will run on a Linux target, or a Windows machine for a Windows target, etcetera.


Reply via email to