README.pod
1=head1 NAME
2
3README.pod - README for the F<Porting/> directory in the Perl 5 core distribution.
4
5=head1 FILES
6
7=head2 F<acknowledgements.pl>
8
9Generates the text which goes in the Acknowledgements section in
10a perldelta. You pass in the previous version and it guesses the next
11version, fetches information from the repository and outputs the
12text.
13
14=head2 F<add-package.pl>
15
16Program to prepare dual-life distributions for insertion into the Perl 5
17F<lib/> and F<t/> directories. Now thought to be largely superseded.
18
19=head2 F<add-pod-file>
20
21Program to facilitate addition of new F<.pod> files to F<pod/>.
22
23=head2 F<bench.pl>
24
25Do performance analysis on the code snippets in F<t/perf/benchmarks>.
26
27=head2 F<bisect-example.sh>, F<bisect.pl> and F<bisect-runner.pl>
28
29Use C<git bisect> to pinpoint changes.
30
31=head2 F<bump-perl-version>
32
33A utility to find, and optionally bump, references to the perl version
34number in various files within the perl source.
35
36=head2 F<checkansi.pl>
37
38Check source code for ANSI-C violations.
39
40=head2 F<checkcfguse.pl>
41
42Check where the symbols defined in the various F<config.sh>-clones
43are being used. VMS is probably not handled properly here.
44
45=head2 F<checkcfgvar.pl>
46
47Check that the various F<config.sh>-clones have (at least) all the same
48symbols as the top-level F<config_h.SH> so that the (potentially) needed
49symbols are not lagging after how F<Configure> thinks the world is laid out.
50VMS is probably not handled properly here, due to their own rather elaborate
51DCL scripting.
52
53=head2 F<check-cpan-pollution>
54
55Scans the commit logs for commits that are potentially, illegitimately
56touching modules that are primarily maintained outside of the perl core. Also
57checks for commits that span multiple distributions in F<cpan/> or F<dist/>.
58Makes sure that updated CPAN distributions also update
59F<Porting/Maintainers.pl>, but otherwise ignores changes to that file (and
60F<MANIFEST>).
61
62=head2 F<checkpodencoding.pl>
63
64Check if POD files contain non-ASCII without specifying
65encoding. Run it as: C<perl Porting/checkpodencoding.pl>.
66
67=head2 F<checkURL.pl>
68
69Checks that all the URLs in the Perl source are valid.
70
71=head2 F<checkVERSION.pl>
72
73Used by F<t/porting/cmp_version.t> to ensure changed modules have had their
74versions updated.
75
76=head2 F<cmpVERSION.pl>
77
78Compare the current Perl source tree and a given tag for modules that have
79identical version numbers but different contents.
80
81=head2 F<config_H>
82
83This file is a sample F<config.h> file. If you are unable to successfully run
84F<Configure>, copy this file to F<config.h> and edit it to suit your system.
85
86=head2 F<config_h.pl>
87
88Used when importing changes from F<metaconfig>. This script reorders
89F<config_h.SH> after metaconfig.
90
91=head2 F<config.sh>
92
93This file is a sample F<config.sh> file. F<config.sh> is normally
94produced by running the F<Configure> script. It holds all the definitions
95figured out by F<Configure>. If you are unable to successfully run
96F<Configure> on your system, copy this sample file to F<config.sh>
97at the top of the perl source tree and edit it to suit your system.
98Then propagate those values by running C<Configure -S>. This sample
99file is normally updated each time F<Configure> is updated.
100
101=head2 F<core-cpan-diff>
102
103Compare CPAN modules with their equivalent in core.
104Originally based on App::DualLivedDiff by Steffen Mueller.
105
106=head2 F<corecpan.pl>
107
108Reports, in a perl source tree, which dual-lived core modules have not the
109same version than the corresponding module on CPAN.
110
111=head2 F<corelist-diff>
112
113Prints a table of differences between two Perl versions with respect to
114modules included in the distribution.
115
116=head2 F<corelist-perldelta.pl>
117
118Generates a list of the module changes for the Perl you are currently
119building. Also generates a diff between the corelist sections of two
120F<perldelta*> files.
121
122=head2 F<corelist.pl>
123
124Generates info for Module::CoreList from this perl tree.
125
126=head2 F<core-team.json>
127
128The canonical list of Perl Core Team members, used to build perlgov.pod,
129produce election mailings, and all that sort of thing.
130
131=head2 F<deparse-skips.txt>
132
133List of test files to ignore/skip for deparse tests.
134
135=head2 F<docs-team-charter.pod>
136
137The charter of the Perl Documentation Team
138
139=head2 F<epigraphs.pod>
140
141List of Perl release epigraphs.
142
143=head2 F<exclude_contrib.txt>
144
145List of base 64 encoded SHA256 digests of C<< "name <email>" >> data
146which should be ignored by F<updateAUTHORS.pl>.
147
148=head2 F<exec-bit.txt>
149
150This file contains a list of files that F<makerel> will ensure get an
151executable bit.
152
153=head2 F<exercise_makedef.pl>
154
155Brute force testing for F<makedef.pl>.
156
157=head2 F<expand-macro.pl>
158
159Expand C macros using the C preprocessor.
160
161=head2 F<findrfuncs>
162
163This script finds reentrant variants of functions used in an executable and
164shared objects.
165
166=head2 F<git-deltatool>
167
168This script, a rough draft, aids in generating a perldelta file
169from a series of git commits.
170
171=head2 F<git-find-p4-change>
172
173This script, given a Perforce change number, outputs the equivalent git commit
174id.
175
176=head2 F<git-make-p4-refs>
177
178This script creates a tag for every p4raw-id.
179
180=head2 F<GitUtils.pm>
181
182This script contains the subroutine to generate a F<.patch file> for a
183committish (the SHA1 checksum of a commit, a number made of 40 hexadecimal
184digits which acts the internal unique identifier for this commit
185(lilypond.org). Related file: F<make_dot_patch.pl>
186
187=head2 F<Glossary>
188
189This file is built by F<metaconfig>. This file contains a description of all
190the shell variables whose value is determined by the Configure script.
191It later gets incorporated into the pod for F<Config.pm>.
192
193=head2 F<harness-timer-report.pl>
194
195For analyzing the output of "env HARNESS_TIMER=1 make test", to find
196outliers of test execution times.
197
198=head2 F<how_to_write_a_perldelta.pod>
199
200This file contains a specification as to how to write a perldelta pod.
201Related file: F<perldelta_template.pod>
202
203=head2 F<leakfinder.pl>
204
205This script executes every line in every file in the build directory and its
206subdirectories to determine if the number of SVs goes up and reports it as a
207leak to STDOUT. WARNING! some harm could be done if a line contains something
208similar to C<`rm *`>.
209
210=head2 F<Maintainers>
211
212This script shows information about the maintainers of core files/modules.
213
214Related files: F<Maintainers.pl>, F<Maintainers.pm>
215
216=head2 F<Maintainers.pl>
217
218A package associating core files/modules with maintainers. Related files:
219F<Maintainers>, F<Maintainers.pm>
220
221=head2 F<Maintainers.pm>
222
223A package to search and show information about which core files/modules are
224associated with maintainers. Related files: F<Maintainers>, F<Maintainers.pl>
225
226=head2 F<make_dot_patch.pl>
227
228Generate a F<.patch> file to STDOUT for a commit ID specified on the
229command-line.
230
231=head2 F<makemeta>
232
233This script creates F<META.yml> and F<META.json> files.
234
235=head2 F<makerel>
236
237This script builds a Perl release tarball.
238
239=head2 F<make-rmg-checklist>
240
241This script creates a release checklist as a simple HTML document.
242
243=head2 F<make_snapshot.pl>
244
245This script is a quick and dirty snapshot generator for the perl5.git.perl.org
246web page to use to generate the snapshot files.
247
248=head2 F<manicheck>
249
250This script outputs a list of files in F<MANIFEST> which don't exist and a
251list of files that exist and aren't in F<MANIFEST>.
252
253=head2 F<manifest_lib.pl>
254
255This library provides functions used in checking and sorting the F<MANIFEST>.
256
257=head2 F<manisort>
258
259This script sorts the files in F<MANIFEST>.
260
261=head2 F<mksample>
262
263This script regenerates F<Porting/config.sh> and F<Porting/config_H>.
264
265=head2 F<new-perldelta.pl>
266
267This script automates the process for creating perldelta.pl.
268
269=head2 F<newtests-perldelta.pl>
270
271This script outputs the added tests between the two versions of Perl.
272
273=head2 F<perldelta_template.pod>
274
275Template for F<perldelta>.
276
277=head2 F<perlgov-team-update>
278
279This produces a new team list for F<perlgov.pod>, but does not, at present,
280insert that content into the file.
281
282=head2 F<perlhist_calculate.pl>
283
284Generates info for F<perlhist> from this perl tree.
285
286=head2 F<pod_lib.pl>
287
288When C<require>d into other programs in the Perl 5 core
289distribution, provides functions useful during testing.
290
291=head2 F<pod_rules.pl>
292
293Generate the sections of files listed in C<%Targets> from F<pod/perl.pod>.
294Mostly these are rules in Makefiles.
295
296 --verbose gives slightly more output
297 --build-all tries to build everything
298 --build-foo updates foo as follows
299 --showfiles shows the files to be changed
300 --test exit if perl.pod, MANIFEST are consistent, and regenerated
301 files are up to date, die otherwise.
302
303=head2 F<podtidy>
304
305Applies F<podtidy> to a file.
306
307=head2 F<pumpkin.pod>
308
309Pumpkin - Notes on handling the Perl Patch Pumpkin And Porting Perl.
310Many of these are out of date or superseded by other documents in
311this directory.
312
313=head2 F<README.pod>
314
315This file. An exhaustive list of the contents of the F<Porting/>
316directory along with a description of each file.
317The test F<t/porting/readme.t> ensures that this lists every file
318and that every file is listed.
319
320=head2 F<README.y2038>
321
322The y2038 implementation for perl. This is an implementation of POSIX time.h
323which solves the year 2038 bug on systems where time_t is only 32 bits. It is
324implemented in bog-standard ANSI C. The latest version can be found at
325L<https://github.com/evalEmpire/y2038>.
326
327=head2 F<release_announcement_template.txt>
328
329Release announcement for minor releasements of the 5.19 development series.
330
331=head2 F<release_managers_guide.pod>
332
333Releasing a new version of perl 5.x. Note that things change at each release,
334so there may be new things not covered here, or tools may need updating.
335
336=head2 F<release_schedule.pod>
337
338This schedule lists the projected or historical development and release
339schedules for the next, current and previous stable versions of Perl. Dates
340with all question marks will only be releases if deemed necessary by the
341Steering Council.
342
343=head2 F<rt_list_patches>
344
345Shell script to list patches in RT.
346
347=head1 F<security_template.pod>
348
349Template to guide writers of a perl 5 security vulnerability
350announcement.
351
352=head2 F<sort_perldiag.pl>
353
354This is a script for sorting the warning and error messages in
355F<perldiag.pod>. POD formatting, printf-style escapes, non-letter characters,
356and case are ignored, as explained in L<perldiag>.
357
358=head2 F<sync-with-cpan>
359
360Script to help out with syncing cpan distros.
361
362=head2 F<test-dist-modules.pl>
363
364Test modules in F<dist/> against the perl in C<PATH>. Used in the
365github workflow to test against older perls.
366
367=head2 F<timecheck2.c>
368
369A little program to test the limits of your system's time functions. See
370F<Porting/README.y2038> for details.
371
372=head2 F<timecheck.c>
373
374A helper tool for perl's 2038 support See F<Porting/README.y2038> for details.
375
376=head2 F<todo.pod>
377
378This is a list of wishes for Perl. The most up-to-date version of this file is
379at L<https://github.com/Perl/perl5/blob/blead/Porting/todo.pod>.
380The tasks we think are smaller or easier are listed first. Anyone is welcome
381to work on any of these, but it's a good idea to first contact
382I<perl5-porters@perl.org> to avoid duplication of effort, and to learn from
383any previous attempts.
384
385=head2 F<updateAUTHORS.pl>
386
387This script will automatically update AUTHORS and create .mailmap entries
388based on the git commit log history. If F<t/porting/authors.t> complains
389during testing you should run this. It will automatically fix most if not
390all AUTHORS related test fails.
391
392=head2 F<updateAUTHORS.pm>
393
394The class used by F<updateAUTHORS.pl> to do its business. Package name
395C<Porting::updateAUTHORS>.
396
397=head2 F<valgrindpp.pl>
398
399A post-processor for C<make test.valgrind>. F<valgrindpp.pl> is a
400post-processor for F<.valgrind> files created during C<make test.valgrind>. It
401collects all these files, extracts most of the information and produces a
402significantly shorter summary of all detected memory access errors and memory
403leaks.
404
405=head2 F<vote_admin_guide.pod>
406
407Guide for Vote Administrators for running Steering Council elections.
408
409=cut
410
README.y2038
1The y2038 implementation for perl
2===========================================================================
3This is an implementation of POSIX time.h which solves the year 2038 bug on
4systems where time_t is only 32 bits. It is implemented in bog-standard
5ANSI C. The latest version can be found at https://github.com/evalEmpire/y2038
6
7It makes use of the system's native 32 bit functions to perform time zone
8and daylight savings time calculations and thus does *not* need to ship its
9own time zone table.
10
11time64.h currently implements three public functions, localtime64_r(),
12gmtime64_r() and timegm64(). They are implementations of localtime_r(),
13gmtime_r() and timegm64().
14
15To install, simply copy time64.c and time64.h into your project and make
16use of the functions.
17
18To test, run "make test". You must have Perl, prove (which comes with a
19recent version of the Test::Harness Perl module) and bzdiff installed to
20run the full test suite. It will do a number of unit tests, plus test
21against a large table of known good values in different time zones.
22
23Limitations, Issues, etc...
24---------------------------
25localtime64_r() gets its time zone and daylight savings time information by
26mapping the future year back to a similar one between 2010 and 2037, safe
27for localtime_r(). The calculations are accurate according to current time
28zone and daylight savings information, but may become inaccurate if a
29change is made that takes place after 2010.
30
31Future versions will probe for a 64 bit safe system localtime_r() and
32gmtime_r() and use that.
33
34The maximum date is still limited by your tm struct. Most 32 bit systems
35use a signed integer tm_year which means the practical upper limit is the
36year 2147483647 which is somewhere around 2**54. You can use a 64 bit
37clean tm struct by setting USE_TM64 in time64.h
38
39Portability
40-----------
41I would like to add some configuration detection stuff in the future, but
42for now all I can do is document the assumptions...
43
44This code assumes that long longs are 64 bit integers which is technically
45in violation of the C standard. This can be changed in time64.h by
46changing the Time64_T and Int64 typedefs.
47
48There are a number of configuration options in time64.h.
49
50Configure variables
51-------------------
52Configure probes for the maximum and minimum values that gmtime () and
53localtime () accept on the local system. Configure however is only used on
54unix-like systems. For windows and VMS these values are hard-coded. You can
55use timecheck.c in the Porting directory to check those values yourself,
56using the same technique that is used in Configure based on bit-shifting:
57
58 $ cd Porting
59 $ cc -O -o timecheck timecheck.c
60 $ ./timecheck
61 ======================
62 Sizeof time_t = 8
63 gmtime () boundaries:
64 8: 0x00f0c2ab7c54a97f: 2147485547-12-31 23:59:59
65 8: -0x0000000e79747c00: 0-01-01 00:00:00
66 localtime () boundaries:
67 8: 0x00f0c2ab7c549b6f: 2147485547-12-31 23:59:59
68 8: -0x0000000e79748094: 0-01-01 00:00:00
69 Configure variables:
70 sGMTIME_max='67768036191676799'
71 sGMTIME_min='-62167219200'
72 sLOCALTIME_max='67768036191673199'
73 sLOCALTIME_min='-62167220372'
74
75In the rare case that your system uses a double for time_t, you can use the
76alternate approach to test for these values:
77
78 $ cd perl/Porting
79 $ cc -O -o timecheck2{,.c}
80 $ ./timecheck2
81 gmtime max 67768036191676800
82 localtime max 67768036191673200
83 gmtime min -67768040609740800
84 localtime min -67768040609741968
85