-
Notifications
You must be signed in to change notification settings - Fork 697
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
Tests requiring hackage-repo-tool don't run on Windows. #5204
Comments
I was able to run most of the hackage-repo-tool tests on AppVeyor with this commit: grayjay@d547107 I temporarily worked around the repo path issues by using a relative path, though I think that caused three of the new-freeze tests to fail. Log: https://ci.appveyor.com/project/grayjay/cabal/build/1.0.507 There was one other test failure, PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs: https://ci.appveyor.com/project/grayjay/cabal/build/1.0.507#L1450 |
…haskell#5204). appveyor.yml currently downloads hackage-security from Github, since the changes that allow building on Windows haven't been released yet. I disabled one test that still fails on Windows: PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
…haskell#5204). I disabled one test that still fails on Windows: PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
…haskell#5204). I disabled one test that still fails on Windows: PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
…haskell#5204). I disabled one test that still fails on Windows: PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
…haskell#5204). I disabled one test that still fails on Windows: PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
…haskell#5204). I disabled one test that still fails on Windows: PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
…haskell#5204). I disabled one test that still fails on Windows: PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
…#5204). I disabled one test that still fails on Windows: PackageTests/NewBuild/CustomSetup/RemotePackageWithCustomSetup/build-package-from-repo-with-custom-setup.test.hs
I tried to run the tests that depend on hackage-repo-tool on AppVeyor, but I ran into several issues:
cabal-tests uses tar to create the repository, but tar misinterprets the colon in the drive letter, as in https://stackoverflow.com/questions/12823499/windows-command-line-tar-cannot-connect-to-d-resolve-failed-with-chef-knife/37996249. I was able to fix this issue by adding
--force-local
to the arguments incabal/cabal-testsuite/Test/Cabal/Prelude.hs
Line 480 in 59bb50b
cabal-testsuite tests can access the Hackage package index on Windows #5187 prevents the tests from reading the repository settings from the test config file. Setting CABAL_CONFIG for each test seemed to work.
The repository
url
field in the config file generated by cabal-tests cannot be parsed as a URI. cabal-tests generates the config file here:cabal/cabal-testsuite/Test/Cabal/Prelude.hs
Line 515 in 59bb50b
That produces a string with backslashes, such as
file:C:\projects\cabal\cabal-testsuite\PackageTests\NewBuild\CustomSetup\LocalPackageWithCustomSetup\build-local-package-with-custom-setup.dist\repo
. cabal parses the field as a URI incabal/cabal-install/Distribution/Client/Config.hs
Lines 1114 to 1117 in 59bb50b
cabal treats the file URI path as a file path when initializing the repository with hackage-security:
cabal/cabal-install/Distribution/Client/GlobalFlags.hs
Lines 248 to 249 in 59bb50b
fromFilePath
seems to expect a platform-specific path:https://github.com/haskell/hackage-security/blob/21519f4f572b9547485285ebe44c152e1230fd76/hackage-security/src/Hackage/Security/Util/Path.hs#L277-L281
It converts the String to a
FsPath
, which contains aPath
, which stores the path as a Posix-style path string: https://github.com/haskell/hackage-security/blob/21519f4f572b9547485285ebe44c152e1230fd76/hackage-security/src/Hackage/Security/Util/Path.hs#L121Later, hackage-security fails to find root.json, because it calls toAbsoluteFilePath on the invalid path:
https://github.com/haskell/hackage-security/blob/21519f4f572b9547485285ebe44c152e1230fd76/hackage-security/src/Hackage/Security/Util/Path.hs#L322-L325 . toAbsoluteFilePath tries to convert the
Absolute
path back to the platform-specific format:https://github.com/haskell/hackage-security/blob/21519f4f572b9547485285ebe44c152e1230fd76/hackage-security/src/Hackage/Security/Util/Path.hs#L257-L258
After I worked around (3), I saw that cabal/hackage-security converted the path of type
Path Absolute
,C:/projects/cabal/cabal-testsuite/PackageTests/NewBuild/CustomSetup/LocalPackageWithCustomSetup/build-local-package-with-custom-setup.dist/repo/root.json
, toC:projects\cabal\cabal-testsuite\PackageTests\NewBuild\CustomSetup\LocalPackageWithCustomSetup\build-local-package-with-custom-setup.dist\repo\root.json
. The result is invalid because it is missing a backslash after the drive letter.After I worked around the previous issues, I saw new warnings about mirrors in the output, though I didn't look into them further.
EDIT: I think (5) was only caused by the changes I made to work around the other issues.
The text was updated successfully, but these errors were encountered: