Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 63 lines (44 sloc) 1.658 kb
d71c0cd @sorear Add draft documentation on making shippable binaries
authored
1 =head1 NAME
2
3 Making standalone .exe files for Mono or Windows from Perl 6 code using Niecza
4
5 =head1 LIMITATIONS
6
7 =over 4
8
9 =item *
10
11 You will be getting a .NET exe, not a native Win32 exe. This
12 probably isn't an issue; recent versions of Windows come with .NET runtimes,
13 and in any case it is unavoidable.
14
15 =item *
16
17 Niecza cannot currently produce truly standalone exes; you will
18 have at least one dll.
19
20 =item *
21
48a8de3 @FROGGS rename sub and method `eval` to `EVAL`
FROGGS authored
22 It is not possible to use C<EVAL> or similar functionality with a precompiled
d71c0cd @sorear Add draft documentation on making shippable binaries
authored
23 program.
24
25 =head1 METHOD
26
27 $ cat > foo.pl
28 say "Hello, world"
29 $ mono run/Niecza.exe -c foo.pl
30 $ cp obj/Run.MAIN.exe Foo.exe
31 $ cp obj/Run.Kernel.dll obj/Run.CORE.dll obj/Run.MAIN.ser obj/Run.CORE.ser .
32 $ mono Foo.exe
33 Hello, world
34
35 The C<-c> option tells niecza to create an exe. The produced exe depends on
36 runtime availability in the same directory of Kernel, all depended modules
37 (here just CORE), and the matching ser files for MAIN and all used modules.
38
39 =head1 BUNDLING
40
41 $ cat > foo.pl
42 say "Hello, world"
43 $ make obj/Kernel.dll
44 make: `obj/Kernel.dll' is up to date.
45 $ NIECZA_KEEP_IL=1 mono run/Niecza.exe -C CORE
46 $ NIECZA_KEEP_IL=1 mono run/Niecza.exe -c foo.pl
47 $ cp obj/Kernel.dll .
48 $ mono Kernel.dll -gen-app Foo obj
49 $ mono Foo.exe
50 Hello, world
51 $ ls Foo*
52 Foo.exe Foo.ser
53
54 This method is slightly more involved, but allows shipping only three files
55 (including Kernel.dll) regardless of used libraries. It is necessary to
56 build all used libraries with C<NIECZA_KEEP_IL=1>.
57
58 =head1 TODO
59
60 A single-file bundle mode using AssemblyResolve hooks.
61
62 Automatic bundling invoked from the compiler.
Something went wrong with that request. Please try again.