{"thread":{"id":"32412","subject":"[RFC] test: Old shells and physical paths","startedAt":"2012-12-19T23:22:03Z","lastAt":"2012-12-20T16:25:42Z","messageCount":5,"participants":["David Michael","Junio C Hamano","David Aguilar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"205229","messageId":"CAEvUa7=sOPF9xwfGuBXv0CBZhT+79+8z3tm9ar_cz3q--kfqRQ@mail.gmail.com","threadId":"32412","inReplyTo":null,"subject":"[RFC] test: Old shells and physical paths","fromName":"David Michael","fromEmail":"fedora.dm0@gmail.com","sentAt":"2012-12-19T23:22:03Z","receivedAt":"2012-12-19T23:22:03Z","isPatch":false,"sender":{"key":"fedora.dm0@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1379865?v=4"},"body":"Hi,\n\nIn working on a port, I have to tolerate an ancient shell.  The \"cd\"\nand \"pwd\" commands don't understand the \"-P\" flag for physical paths,\nas some tests use.  The biggest offender is \"cd -P\" causing a failure\nin t/test-lib.sh (since 1bd9c64), which is sourced by every test\nscript.\n\nThis shell does understand the difference between physical and logical\npaths, but the only way to choose which is with a shell option.  The\nshell option is named \"logical\" which is not portable; GNU bash uses\nthe opposite, \"physical\".\n\nDoes anyone have any suggestions for how to handle this?\n\nWould it be acceptable to instead force the platform's shell option\n(if it exists) to always use physical paths for the tests and drop the\n\"-P\" flags?\n\nIf not, is it worth maintaining compatibility wrappers for this one\nobscure platform?\n\nThanks.\n\nDavid\n"},{"id":"205232","messageId":"7vmwx97f0o.fsf@alter.siamese.dyndns.org","threadId":"32412","inReplyTo":"CAEvUa7=sOPF9xwfGuBXv0CBZhT+79+8z3tm9ar_cz3q--kfqRQ@mail.gmail.com","subject":"Re: [RFC] test: Old shells and physical paths","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-12-20T00:17:59Z","receivedAt":"2012-12-20T00:17:59Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Michael <fedora.dm0@gmail.com> writes:\n\n> In working on a port, I have to tolerate an ancient shell.  The \"cd\"\n> and \"pwd\" commands don't understand the \"-P\" flag for physical paths,\n> as some tests use.  The biggest offender is \"cd -P\" causing a failure\n> in t/test-lib.sh (since 1bd9c64), which is sourced by every test\n> script.\n\nIs \"here is a nickel, get a better shell\" an option?  Running tests\nis one thing, but I'd be worried more about scripted Porcelains\nbroken by a non-POSIX shell if I were you.\n\n> Would it be acceptable to instead force the platform's shell option\n> (if it exists) to always use physical paths for the tests and drop the\n> \"-P\" flags?\n\nAs a patch to the source files in my tree?  Not likely, even though\nI cannot say for sure without looking at how the change would look\nlike.\n"},{"id":"205235","messageId":"CAEvUa7=_iyXxaaRs3WtxZOy5PNnncG-iMAUNkCMLJ19ZtReqaw@mail.gmail.com","threadId":"32412","inReplyTo":"7vmwx97f0o.fsf@alter.siamese.dyndns.org","subject":"Re: [RFC] test: Old shells and physical paths","fromName":"David Michael","fromEmail":"fedora.dm0@gmail.com","sentAt":"2012-12-20T02:28:36Z","receivedAt":"2012-12-20T02:28:36Z","isPatch":false,"sender":{"key":"fedora.dm0@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1379865?v=4"},"body":"Hi,\n\nOn Thu, Dec 20, 2012 at 12:17 AM, Junio C Hamano <gitster@pobox.com> wrote:\n> Is \"here is a nickel, get a better shell\" an option?\n\nIt is, somewhat.  There is a pre-built port of GNU bash 2.03 for the\nplatform, but I was trying to see how far things could go with the\nOS's supported shell before having to bring in unsupported\ndependencies.  Unfortunately, I do not believe the OS fully conforms\nto POSIX.1-2001 yet, so that means no \"-P\" or \"-L\" without going\nrogue.\n\nI'll carry test fixes for this platform locally.\n\nThanks.\n\nDavid\n"},{"id":"205245","messageId":"CAJDDKr78ugSo9hNerHO0Y46_bSzLJWznB3E3+6H98NjMtBwHsw@mail.gmail.com","threadId":"32412","inReplyTo":"CAEvUa7=_iyXxaaRs3WtxZOy5PNnncG-iMAUNkCMLJ19ZtReqaw@mail.gmail.com","subject":"Re: [RFC] test: Old shells and physical paths","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2012-12-20T05:01:28Z","receivedAt":"2012-12-20T05:01:28Z","isPatch":false,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Wed, Dec 19, 2012 at 6:28 PM, David Michael <fedora.dm0@gmail.com> wrote:\n> Hi,\n>\n> On Thu, Dec 20, 2012 at 12:17 AM, Junio C Hamano <gitster@pobox.com> wrote:\n>> Is \"here is a nickel, get a better shell\" an option?\n>\n> It is, somewhat.  There is a pre-built port of GNU bash 2.03 for the\n> platform, but I was trying to see how far things could go with the\n> OS's supported shell before having to bring in unsupported\n> dependencies.  Unfortunately, I do not believe the OS fully conforms\n> to POSIX.1-2001 yet, so that means no \"-P\" or \"-L\" without going\n> rogue.\n>\n> I'll carry test fixes for this platform locally.\n\nDo you know if the differences are relegated to \"cd\",\nor do other common commands such as awk, grep, sed, mktemp, expr,\netc. have similar issues?\n\nI wonder if it'd be helpful to have a low-numbered test that checks\nthe basics needed by the scripted Porcelains and test suite.\nIt would give us an easy way to answer these questions, and could\nbe a good way to document (in code) the capabilities we expect.\n-- \nDavid\n"},{"id":"205270","messageId":"CAEvUa7k8uimzjHd9jA=qjqK2pH-=oNRoY=ypN=bosmyGV52LoQ@mail.gmail.com","threadId":"32412","inReplyTo":"CAJDDKr78ugSo9hNerHO0Y46_bSzLJWznB3E3+6H98NjMtBwHsw@mail.gmail.com","subject":"Re: [RFC] test: Old shells and physical paths","fromName":"David Michael","fromEmail":"fedora.dm0@gmail.com","sentAt":"2012-12-20T16:25:42Z","receivedAt":"2012-12-20T16:25:42Z","isPatch":false,"sender":{"key":"fedora.dm0@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1379865?v=4"},"body":"Hi,\n\nOn Thu, Dec 20, 2012 at 12:01 AM, David Aguilar <davvid@gmail.com> wrote:\n> Do you know if the differences are relegated to \"cd\",\n> or do other common commands such as awk, grep, sed, mktemp, expr,\n> etc. have similar issues?\n\nThere are almost certainly going to be incompatibilities with other\ncommands.  The system implemented UNIX95 plus some extensions, then\nthey began supporting UNIX03/SUSv3/POSIX.1-2001/whatever for certain\ncommands by using an environment variable to toggle between the\nincompatible behaviors.\n\nTheir documentation on the UNIX03 commands indicates it is still only\npartially supported.  For example: \"cp\" supports \"-L\" and \"-P\", but\n\"cd\" doesn't.\n\n> I wonder if it'd be helpful to have a low-numbered test that checks\n> the basics needed by the scripted Porcelains and test suite.\n> It would give us an easy way to answer these questions, and could\n> be a good way to document (in code) the capabilities we expect.\n\nI'd be in favor of something like this as well.\n\nThanks.\n\nDavid\n\n\nP.S.\nIn the meantime, I am handling the \"cd\" situation by replacing \"-P\"\nwith \"$PHYS\" and prepending the following to t/test-lib.sh.\nset +o logical >/dev/null 2>&1 || PHYS=-P\n"}]}