-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xxx_dir(os) argument is broken #8
Comments
* see r-lib#8 for discussion, but essentially it is not possible to normalise paths in a manner that matches that of a different platform
OK FWIW, jefferis#4, should fix this issue by removing the http://win-builder.r-project.org/hrb3bZEdtZqU/examples_and_tests/ |
On Jul 16, 2014 4:56 AM, "Gregory Jefferis" notifications@github.com wrote:
Not sure what you mean by "fundamentally broken": Under the "osx"
The os argument allows one to run cross-platform tests i.e. run all
Being able to run the OSX tests on a XDG machine or vice versa is
While unaware of Hadley's effort I wrote a separate "appdirs" package. p.s. I'm on vacation with poor computer access but will return on July 28th. |
I'd rather keep the os argument, since it makes cross-platform testing so much easier. |
OK @hadley. I will make things work on that basis. Just to be clear, this argument is useful for testing but not for end users. In fact it's probably dangerous for end users, because they might imagine that they would get the correct path used on another platform whereas they will get a frankenstein path if they are running on windows and asking for unix/mac or running on unix/mac and asking for windows. @trevorld proposed hiding the argument by having user visible functions without Greg. PS apologies, @trevorld, "fundamentally broken" is somewhat inflammatory language – it was not my intention to be rude. Sorry! |
NB I can make the tests work on Windows when
The fix is to wrap the baseline paths for each test in More generally my personal view is that the only reliable way to test Windows functionality is on Windows and the only reliable way to test unix functionality is on unix. That's what travis (now with multi-os (mac/linux) testing thanks to @krlmlr) and winbuilder do. |
The ability to specify an
os
other than the current one in the xxx_dir functions is fundamentally broken. This is because the internalfile_path
function usesnormalizePath
andpath.expand
, which have no notion of anos
other than the current platform. For example on windows:I vote that we remove the
os
argument from all functions. It was introduced in @trevorld's huge 471aa1c commit without comment. I don't really see a strong case for wanting this. FWIW python appdirs does not have it https://github.com/ActiveState/appdirs/blob/master/appdirs.pyRemoving
os
will in turn invalidate most of the tests, which can only be run in a platform specific way. The best that I think we can do is to run unix and windows tests based on the value of.Platform$OS.type
. Likewise many examples will need to be changed to remove the os argument.Alternatively, we could leave the os argument, but then it would only work for different flavours of unix and would have to error out otherwise. Or we could try to emulate
normalizePath
andpath.expand
with anos
argument but that sounds like it would be costly and fragile and I don't see that the benefits warrant that effort.Views @hadley? I think this is a blocker and you'll need to approve the strategy. @trevorld was there a particularly reason for the
os
argument that I'm missing? It looks like it may have been introduced for testing as much as anything.The text was updated successfully, but these errors were encountered: