-
Notifications
You must be signed in to change notification settings - Fork 45
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
Use GitHub actions for CI #163
Conversation
3f97b23
to
b13ea3d
Compare
@NorfairKing we need to fix the validity tests on Windows. Apparently Windows build has been broken for a long time... |
@mrkkrp Is it an incorrect test or is there a bug? |
I only checked that all failures are validity-related, so I decided that it will be best to delegate them to you. There were other failures, TH-related, those I fixed myself. |
@mrkkrp I had a look at it but I don't have a windows machine to do any debugging. |
c4eff98
to
005dd36
Compare
I just rebased this on top of master to see if CI passes now. |
@Martinsos this still fails on windows but not linux. Do you have any idea why? |
I just took a quick look at appveyor and I see it passed after merging my PR (https://ci.appveyor.com/project/chrisdone/path/builds/37821901) -> is it because something changed in this PR that caused validity tests to fail, or is it because appveyor was not running validity tests? I haven't been paying attention to validity tests (because they were either passing or were not run, not sure), so it might be that they need to be updated, or there is still some problem in the code. I will be able to catch some time over the weekend to give it a more detailed look. |
@Martinsos the validity tests pass on linux, so it would be great if you could have a look. I cannot reproduce the failure locally. |
Sure, I will give it a look in the next couple of days! Just to make it clear, I also don't have local development setup on Windows so I will not be able to test locally, I normally do all the testing regarding windows on the CI - but nevertheless, I am sure we can figure it out. I will probably be asking more details about the validity tests once I get into them. |
@Martinsos I think the next step will be to make the tests fail on linux, not to get them to pass on windows. |
@NorfairKing Getting them to fail on Linux would be valuable in order to make it possible to catch these during development on Linux machine? In the meantime we at least have Validity Tests running in CI on both Linux and Win! I took some time today to investigate specific errors and I managed to categorize them by two causes, here is what I found out:
|
Oh that's you! Congratulations to you and your brother :D
Keep this train of thought going. You're about to invent validity-based testing :)
Ah right, I forgot about that! Yeah this would be non-trivial but I think an easy-er solution would be to compile the same test suite suite file twice but with different flags. We could do this by having two almost-identical sections in the cabal file that refer to the same test directory but use different compile flags; one for windows and one for posix.
This looks like the tests have found some real bugs. @mrkkrp @chrisdone @sjakobi @harendra-kumar does any of you use windows or have the time to dig into these bugs? |
Ha thanks :D! We are dealing with a lot of files -> reading templates and then generating whole project with relatively complicated structure, so we found Path to be indispensable, I love it.
Congrats on the Validity package, I saw that you are the author (gave it a star)! I was actually thinking somewhat more in the direction of capturing/ensuring these variants directly in the code, so that while I read the code I am aware of them. For example, Path could have smart constructor that does normalization. I don't think it can be done in the measure that would make validity tests redundant, but still it could make it easier to reason about the implementation without checking the tests. But I am guessing there were reasons to not do it also, as I said maybe possible performance impact hm.
I didn't think of that! It might still need a little bit (or maybe none) of rewriting to ensure that validity properties are correctly defined for both platforms, but that shouldn't be much work.
Haha yes, you are right :D 🎉 ! |
Same for me with https://github.com/NorfairKing/smos.
Thanks 🤗
|
You are right, I didn't think it through completely - I think I disregarded these parsers since they can't be used in the |
No worries! This happens to me too :) IIRC, one of @chrisdone 's goals was that |
Indeed, the definition is literally that (</>) (Path a) (Path b) = Path (a ++ b) I found normalisation on append as in other libraries to be confusing. |
@Martinsos I can't seem to figure out why CI fails, would you mind having a look? It looks like the sources are missing somehow, and/or the checkout action is not run... |
It works if left path has separator at the end, and right path has no separator at the start. However, as shown by tests above, there are cases in the current code where one or the other condition failed ( |
@NorfairKing As you said, it seems that source is missing. checkout step is not executed - it has the icon that indicates it was skipped. Looking at the code in the ci.yaml, I see following:
Now, these seem to be conditions under which checkout is done, and I am guessing the idea behind this is to target PRs and the main/master branch. I don't really understand why would you want to conditionally execute only checkout, I would instead assume such condition should be applied to the whole workflow (because if I don't do the checkout, nothing will work anyway), but I didn't read the whole ci.yaml so maybe I am missing smth. Anyway, problem seems to be in |
Typically the parsers do the proper normalization and then the rest of the combinators are trivial. Windows file path formats are very complicated. I think that For example,
I instead push for letting users write whatever junk they want when providing input to your program, and then your program runs "canonicalize path" on it to get something sensible that has a restricted meaning. That includes preventing the programmer from inputting junk like "\foo" as a relative directory in their source code. I think the Let's not get lost in the weeds serving the 1% case when the most important case on Windows file paths is The "universal naming convention" ( |
FYI, I wrote a proper parser of those windows filepaths based on this ABNF grammar which I extended.
Kind of depends what you mean with relative. I'd argue what filepath currently means is: "semantics of the filepath depends on CWD". Following that definition The
Could you be more specific? The problems I see currently are:
At any rate... if I were to finish the ABNF parser and make a release... I could expose an API that allows access to the parsed ADT, which libraries that need more sophisticated information, could leverage. Also note that there are many more forms, some of which cannot be validated or understood without performing IO:
You can see the full hierarchy of those names via https://docs.microsoft.com/en-us/sysinternals/downloads/winobj |
No description provided.