Skip to content
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

Notes on the test suite #10

Open
ndmitchell opened this issue Nov 30, 2015 · 4 comments
Open

Notes on the test suite #10

ndmitchell opened this issue Nov 30, 2015 · 4 comments

Comments

@ndmitchell
Copy link
Contributor

I had a look through the test suite. A couple of questions:

  • What are the multi-letter forms used for? e.g. RR FilePath
  • Why do you catch the upper case variants as well? f ('R':'|':xs) = Just $ R xs. It would be ideal if you guaranteed only to produce one form.
  • os == "mingw32" - this always scares me that Haskell programs use a value called OS, matching against a string which is clearly not an OS, and is a toolkit not even installed probably at the wrong bit size. I prefer the isWindows from the extra library - but what you are doing is the Haskell expected pattern, I just don't like it, so go with whatever you prefer.
@jacereda
Copy link
Owner

RR = Relative Read

I made a mistake in the suite, the upper case variants mean fsatrace was unable to determine the full absolute path for the access. Should be fixed now.

As for the os thing, yes, it also left me wondering why it reports "mingw32". I was aware of isWindows, just decided to go with that to avoid another dependency just for the tests.

@ndmitchell
Copy link
Contributor Author

So is the upper-case R relative thing something Shake should handle? And what is it relative to - the current directory at the time it was captured? Under which circumstances is it generated?

Yep, depending on an extra dependency is always annoying.

@jacereda
Copy link
Owner

I don't think Shake should handle it. It's something that should disappear as soon as everything is working properly. It's there mainly to help figuring out if some tool is using an unimplemented feature.

It's mainly related to the usage of xxxat() function variants, like:

https://github.com/jacereda/fsatrace/blob/master/src/unix/fsatraceso.c#L267

I've never used them and haven't seen them used in any of the major compilers, so I didn't bother to implement them. Those could be asserts, but I decided to report them anyways.

They can also be reported on Windows if obtaining the path associated with a handle fails for some reason. I haven't seen it so far.

@droundy
Copy link

droundy commented May 22, 2016

The "at" variants of functions are wonderful system calls, and it seems well worth supporting them! (And they aren't that hard. Here is how I do it in bigbro:

https://github.com/droundy/bigbro/blob/master/linux-proc.h#L3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants