Perl 6 IO TPF Grant: Monthly Report (April, 2017)
This document is the April, 2017 progress report for TPF Standardization, Test Coverage, and Documentation of Perl 6 I/O Routines grant
Timing
As proposed to and approved by the Grant Manager, I've extended the due date for this grant by 1 extra month, in exchange for doing some extra optimization work on IO routines at no extra cost. The new completion date is May 22nd; right after the next Rakudo compiler release.
Communications
I've created and published three notices as part of this grant, informing the users on what is changing and how to best upgrade their code, where needed:
- Upgrade Information for Changes Due to IO Grant Work
- PART 2: Upgrade Information for Changes Due to IO Grant Work
- PART 3: Information on Changes Due to IO Grant Work
IO Action Plan Progress
Most of the IO Action Plan has been implemented and got shipped in Rakudo's 2017.04.2 release. The remaining items are:
- Implement better way to signal closed handle status (was omited from release due to original suggestion to do this not being ideal; likely better to do this on the VM end)
- Implement IO::CatHandle as a generalized IO::ArgFiles (was omited from release because it was decided to make it mostly-usable wherever IO::Handle can be used, and IO::ArgFiles is far from that, having only a handful of methods implemented)
- Optimization of the way we perform
statcalls for multiple file tests (entirely internal that requires no changes to users' code)
Documentation and Coverage Progress
In my spreadsheet with all the IO routines and their candidates, the totals show that 40% have been documented and tested. Some of the remaining 60% may already have tests/docs added when implementing IO Action Plan or ealier and merely need checking and verification.
Optimizations
Some of the optimizations I promised to deliver in exchange for grant deadline extension were already done on IO::Spec::Unix and IO::Path routines and have made it into the 2017.04.2 release. Most of the optimizations that will be done in the upcoming month will be done in IO::Spec::Win32 and will largely affect Windows users.
IO Optimizations in 2017.04.2 Done by Other Core Members:
- Elizabeth Mattijsen made .slurp 2x faster rakudo/b4d80c0
- Samantha McVey made nqp::index—which is used in path operations—2x faster rakudo/f1fc879
- IO::Pipe.lines was made 3.2x faster by relying on work done by Elizabeth Mattijsen rakudo/0c62815
Tickets Resolved
The following tickets have been resolved as part of the grant:
- RT#130460 Can we relax indir's test on the target directory?: Resolved by making indir's default test to be only
:d - RT#130900: nul in pathname: Resolved by checking the path for nul and throwing when found
- RT#127407: [RFC] (1) add method IO::Path.stemname; (2) expand method IO::Path.parts: RFC rejected, but the described functionality is now available via the .extension method that was made much more powerful as part of IO Action Plan
Possibly more tickets were addressed by the IO Action Plan implementation, but they still need further review.
Bugs Fixed
- Fixed a bug in
IO::Path.resolvewith combiners tucked on the path separator. Fix in rakudo/9d8e391f3b; tests in roast/92217f75ce. The bug was identified by Timo Paulssen while testing secure implementation of IO::Path.child
IO Bug Fixes in 2017.04.2 Done by Other Core Members:
- Timo Paulssen fixed a bug with IO::Path types not being accepted by
is nativeNativeCall trait rakudo/99840804 - Elizabeth Mattijsen fixed an issue in assignment to dynamics. This made it possible to
temp$*TMPDIRvariable rakudo/1b9d53 - Jonathan Worthington fixed a crash when slurping large files in binary mode with &slurp or IO::Path.slurp rakudo/d0924f1a2
- Jonathan Worthington fixed a bug with binary slurp reading zero bytes when another thread is causing a lot of GC rakudo/756877e
Commits
So far, I've commited 192 IO grant commits to rakudo/roast/doc repos.
Rakudo
69 IO grant commits:
c6fd736Make IO::Spec::Win32.is-absolute about 63x faster7112a08Add :D on invocant for file tests8bacad8Implement IO::Path.siblinga98b285Remove IO::Path.child-secure0b5a41bRename IO::Path.concat-with to .add9d8e391Fix IO::Path.resolve with combiners; timotimo++1887114Implement IO::Path.child-secureb8458d3Reword method child for cleaner code51e4629Amend rules for last part in IO::Path.resolve9a2446cMove Bool return value to signature214198bImplement proper args for IO::Handle.lockc95c4a7Make IO::Path/IO::Special do IO rolefd503f8grant] Remove role IO and its .umask method"0e36bb2Make IO::Spec::Win32!canon-cat 2.3x faster40217edSwap .child to .concat-with in all the guts490ffd1Do not use self.Str in IO::Path errors1f689a9Fix up IO::Handle.Strc01ebeaMake IO::Path.mkdir return invocant on successd46e8dfAdd IO::Pipe .path and .IO methods6ee71c2Coerce mode in IO::Path.mkdir to Int0d9ecaeRemove multi-dir &mkdirff97083Straighten up rename, move, and copy7f73f92Make IO::Path.new-from-absolute-path privateda1dea2Fix &symlink and &link8c09c84Fix symlink and link routines90da80fRework read methods in IO::Path/IO::Handlec13480cIO::Path.slurp: make 12%-35% faster; propagate Failuresf1b4af7Implement IO::Handle.slurp184d499Make IO::Handle.Supply respect handle's modeb6838eeRemove .f check in .z6a8d63dImplement :completely param in IO::Path.resolvee681498Make IO::Path throw when path contains NUL byteb4358afDelete code for IO::Spec::Win32.catfile0a442ceRemove type constraint in IO::Spec::Cygwin.canonpath0c8bef5Implement :parent in IO::Spec::Cygwin.canonpatha0b82edMake IO::Path::* actually instantiate a subclass67f06b2Run S32-io/io-special.t test file954e69eFix return value of IO::Special methodsa432b3dRemove IO::Path.abspath (part 2)94a6909Clean up IO::Spec::Unix.abs2rel a bit966a7e3Implement IO::Path.concat-with50aea2bRestore IO::Handle.IO15a25daFix ambiguity in empty extension vs no extensionb1e7a01Implement IO::Path.extension 2.0b62d1a7Give $*TMPDIR a container099512bClean up and improve all spurt routinescb27bceClean up &open and IO::Path.open4c31903Add S32-io/chdir-process.t to list of test files to run5464b82Improve &*chdir2483d68Fix regression in &chdir's failure modeca1acb7Fix race in &indir(IO::Path …)a0ef2edImprove &chdir, &indir, and IO::Path.chdiraa62cd5Remove &tmpdir and &homedira5800a1Implement IO::Handle.spurt36ad92aRemove 15 methods from IO::Handle87987c2Remove role IO and its .umask method9d8d7b2Log all changes to plan made during review period0c7e4a0Do not capture args in .IO methodc360ac2Fix smartmatch of Cool ~~ IO::Pathfa9aa47Make R::I::SET_LINE_ENDING_ON_HANDLE 4.1x Faster0111f10Make IO::Spec::Unix.catdir 3.9x Faster4fdebc9Make IO::Spec::Unix.split 36x Fasterdcf1bb2Make IO::Spec::Unix.rel2abs 35% faster55abc6dImprove IO::Path.child perf on *nix4032953Make IO::Handle.open 75% fastera01d679Remove IO::Path.pipe212cc8aRemove IO::Path.Bridge76f7187Do not cache IO::Path.e resultsdd4dfb1Fix crash in IO::Special .WHICH/.Str
Perl 6 Specification
47 IO grant commits:
3b36d4dTest IO::Path.sibling7a063b5Fudge .child-secure tests39677c4IO::Path.concat-with got renamed to .add92217f7Test IO::Path.child-secure with combinersf3c5daeTest IO::Path.child-securea716962Amend rules for last part in IO::Path.resolve4194755Test IO::Handle.lock/.unlock64ff572Cover IO::Path/IO::Pipe's .Str/.path/.IO637500dSpec IO::Pipe.path/.IO returns IO::Path type object8fa49e1Test link routines416b746Test symlink routinesd4353b6Rewrite .l on broken symlinks test7e4a2aeSwap .slurp-rest to .slurpa4c53b0Use bin IO::Handle to test its .Supplyfeecaf0Expand file testsa809f0fExpand IO::Path.resolve testsee7f05bMove is-path sub to top so it can be reusedb16fbd3Add tests to check nul byte is rejected8f73ad8Change \0 roundtrip test to \t roundtrip test7c7fbb4Cover :parent arg in IO::Spec::Cygwin.canonpath896033aCover IO::Spec::QNX.canonpathc3c51edCover IO::Spec::Win32.basenamed8707e7Cover IO::Spec::Unix.basenamebd8d167Test IO::Path::* instantiate a subclass43ec543Cover methods of IO::Speciale5dc376Expand IO::Path.accessed tests0e47f25Test IO::Path.concat-with305f206Test empty-string extensions in IO::Path.extension2f09f18Fix incorrect testb23e53eTest IO::Path.extension1d4e881Test $*TMPDIR can be temped79ff022Expand &spurt and IO::Path.spurt testsba3e7beMerge S32-io/path.t and S32-io/io-path.t3c4e81bTest IO::Path.Str works as advertised86c5f9cDelete qp{} tests430ab89Test &*chdir86f79ceExpand &chdir tests73a5448Remove two fudged &chdir tests04333b3Test &indir fails with non-existent paths by defaultbd46836Amend &indir race testsf48198fTest &indir5a7a365Expand IO::Spec::*.tmpdir tests14b6844Use Numeric instead of IO role in dispatch test8d6ca7aCover IO::Path.ACCEPTS091931aExpand &open tests465795cTest IO::Path.lines(*) does not crash63370feTest IO::Special .WHICH/.Str do not crash
Documentation
76 IO grant commits:
61cb776Document IO::Path.siblingb9c9117Toss IO::Path.child-secure6ca67e4Start sketching out Definitive IO Guide™81a5806Amend IO::Path.resolve: :completelyc5524efRename IO::Path.concat-with to .add3145979Document IO::Path.child-secure160c6a2Document IO::Handle.lock/.unlock53f2b99Document role IO's new purpose2aaf12aDocument IO::Handle.Strbd4fa68Document IO::Handle/IO::Pipe.IOfd8a5edDocument IO::Pipe.path8d95371Expand IO::Handle/IO::Pipe.path docs60b9227Change return value for mkdir47b0526Explicitly spell out caveats of IO::Path.Str923ea05Straighten up mkdir docsaeeec94Straighten up copy, move, renamefff866fFix docs for symlink/link routinesf83f78cUse idiomatic Perl 6 in examplee60da5cList utf-* alias examples too since they're common0f49bb5List Rakudo-supported encodings in open()017acd4Improve docs for IO::Path.slurp56b50feDocument IO::Handle.slurp2aa3c9fDocument new behaviour of IO::Handle.Supplya30fae6Avoid potential confusion with use of word "object"372545cStraighten up file test docs1527d32Document :completely arg to IO::Path.resolve4090446Improve chmod docsd436f3cDocument IO::Spec::* don't do any validation69b2082Document IO::Path.chdirb9de84fRemove DateTime tutorial from IO::Path docs45e84adMove IO::Path.path to attributes0ca2295Reword/expand IO::Path intro prosedbdc995Document IO::Spec::*.catpath50e5565Document IO::Spec::*.catdir and .catfile28b6283Document IO::Spec::*.canonpatha1cb80bDocument IO::Spec::Win32.basename5c1d3b6Document IO::Spec::Unix.basename9102b51Fix up IO::Path.basenamee9b6809Document IO::Path::* subclassesa43ecb9Document IO::Path's $.SPEC and $.CWD7afd9c4Remove unrelated related classes6bd0f98Dissuade readers from using IO::Spec*184342cDocument IO::Special.what56256d0Minor formatting improvements in IO::Special1cd7de0Fix up type graphb3a9324Expand/fix up IO::Path.accessed1973010Document IO::Path.ACCEPTScc62dd2Kill IO::Path.abspath1f75ddcDocument IO::Spec*.abs2rel24a6ea9Toss all of the TODO methods in IO::Spec*65cc372Document IO::Path.concat-withb9e692eDocument new IO::Path.extensiond5abcebWrite docs for all spurt routinesb8fba97Point out my $*CWD = chdir … is an errorb78d4fdInclude type names in links to methodsbdd18f1Fix desc of IO::Path.Stra53015aClarify value of IO::Path.path5aa614fImprove suggestion for Perl 5's opendirbf377c7Document &indire5225beFix URL to &*chdire1a299cReword "defined as" for &*chdir3fdc6dcDocument &*chdir1d0e433Document &chdird050d4bRemove IO::Path.chdir prose839a6b3Expand docs for $*HOME and $*TMPDIRdb36655Remove tip to use $*SPEC to detect OS0511e07Document IO::Spec::*.tmpdircc6539bRemove 8 methods from IO::Handle335a98dRemove mention of role IOcc496ebRemove mention of IO.umask3cf943dExpand IO::Path.relativeccae74aFix incorrect information for IO::Path.absoluted02ae7dRemove IO::Handle.rw and .rwx69d32daRemove IO::Handle.z110efb4No need for .ends-withfd7a41bImprove code example
Leave a comment