Skip to content

Use a small local file instead of fetching one from Stackage #10951

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chreekat
Copy link
Collaborator

This would be a fix for #10950, except that the test is failing and I don't know why. Pointers welcome.

@chreekat
Copy link
Collaborator Author

When I ran the test locally, I get an error that looks like the original fix hadn't been applied. It looks for a file with a space in its name and can't find it.

The test does pass if I go back to the previous commit.

I can't see why my change would have broken cabal again...

$ cabal run cabal-testsuite:cabal-tests -- --with-cabal=$(cabal list-bin cabal) --pattern /UntrimmedImport/
No Cabal library specified, using boot Cabal library with cabal-install tests
threads: 1
tests to run: 1
cabal-testsuite/PackageTests/ProjectImport/UntrimmedImport/cabal.test.hs  FAIL (0.47s)
$ /nix/store/n7w2ij17y9mykhikh6kwplw4v59a0xs7-ghc-9.6.6-with-packages/bin/runghc -- '--ghc-arg=-i' '--ghc-arg=-hide-all-packages' '--ghc-arg=-no-user-package-db' '--ghc-arg=-package-db' '--ghc-arg=/home/b/.cabal/store/ghc-9.6.6/package.db' '--ghc-arg=-package-db' '--ghc-arg=/home/b/HaskellFoundation/clones/cabal/dist-newstyle/packagedb/ghc-9.6.6' '--ghc-arg=-package-id' '--ghc-arg=Cabal-3.15.0.0-inplace' '--ghc-arg=-package-id' '--ghc-arg=Cabal-hooks-3.16-inplace' '--ghc-arg=-package-id' '--ghc-arg=Cabal-syntax-3.15.0.0-inplace' '--ghc-arg=-package-id' '--ghc-arg=base-4.18.2.1' '--ghc-arg=-package-id' '--ghc-arg=bytestring-0.11.5.3' '--ghc-arg=-package-id' '--ghc-arg=cabal-testsuite-3-inplace' '--ghc-arg=-package-id' '--ghc-arg=containers-0.6.7' '--ghc-arg=-package-id' '--ghc-arg=directory-1.3.9.0-775f9413e55593b45ce124f298f3b92be9435f0765965a931fa840be0ca69003' '--ghc-arg=-package-id' '--ghc-arg=exceptions-0.10.7' '--ghc-arg=-package-id' '--ghc-arg=filepath-1.4.300.1' '--ghc-arg=-package-id' '--ghc-arg=process-1.6.26.0-826df9419547ffde404b325e41a78e525c52d0fc1c8a0f10b1517bbcf0d41005' '--ghc-arg=-package-id' '--ghc-arg=time-1.12.2' '--ghc-arg=-package-id' '--ghc-arg=transformers-0.6.1.0' '--ghc-arg=-package-id' '--ghc-arg=unix-2.8.6.0-afcfe75a9bf80753c4e0a2a60e3475731d5abb1dd688854ac0f7f76cc8957821' cabal-testsuite/PackageTests/ProjectImport/UntrimmedImport/cabal.test.hs --builddir dist-newstyle/build/x86_64-linux/ghc-9.6.6/cabal-testsuite-3 cabal-testsuite/PackageTests/ProjectImport/UntrimmedImport/cabal.test.hs --with-cabal /home/b/HaskellFoundation/clones/cabal/dist-newstyle/build/x86_64-linux/ghc-9.6.6/cabal-install-3.15.0.0/x/cabal/build/cabal/cabal
stdout:
+ /run/current-system/sw/bin/git ls-files --cached --modified
cabal.config
cabal.out
cabal.test.hs
my.cabal
tabs-and-spaces.project
trailing-space.project
Copying /home/b/HaskellFoundation/clones/cabal/cabal-testsuite/PackageTests/ProjectImport/UntrimmedImport/cabal.config to /tmp/cabal-testsuite-1160356/cabal.config
Copying /home/b/HaskellFoundation/clones/cabal/cabal-testsuite/PackageTests/ProjectImport/UntrimmedImport/cabal.out to /tmp/cabal-testsuite-1160356/cabal.out
Copying /home/b/HaskellFoundation/clones/cabal/cabal-testsuite/PackageTests/ProjectImport/UntrimmedImport/my.cabal to /tmp/cabal-testsuite-1160356/my.cabal
Copying /home/b/HaskellFoundation/clones/cabal/cabal-testsuite/PackageTests/ProjectImport/UntrimmedImport/tabs-and-spaces.project to /tmp/cabal-testsuite-1160356/tabs-and-spaces.project
Copying /home/b/HaskellFoundation/clones/cabal/cabal-testsuite/PackageTests/ProjectImport/UntrimmedImport/trailing-space.project to /tmp/cabal-testsuite-1160356/trailing-space.project
# checking project import with trailing space
# cabal v2-build
+ /home/b/HaskellFoundation/clones/cabal/dist-newstyle/build/x86_64-linux/ghc-9.6.6/cabal-install-3.15.0.0/x/cabal/build/cabal/cabal v2-build '-vverbose +markoutput +nowrap' --builddir /tmp/cabal-testsuite-1160356/cabal.dist/work/./dist -j1 --dry-run '--project-file=trailing-space.project'
Warning: this is a debug build of cabal-install with assertions enabled.
Project settings changed, reconfiguring...
/tmp/cabal-testsuite-1160356/cabal.config : withBinaryFile: does not exist (No such file or directory)

stderr:
*** Exception: Command /home/b/HaskellFoundation/clones/cabal/dist-newstyle/build/x86_64-linux/ghc-9.6.6/cabal-install-3.15.0.0/x/cabal/build/cabal/cabal v2-build '-vverbose +markoutput +nowrap' --builddir /tmp/cabal-testsuite-1160356/cabal.dist/work/./dist -j1 --dry-run '--project-file=trailing-space.project' failed.
Output:
Warning: this is a debug build of cabal-install with assertions enabled.
Project settings changed, reconfiguring...
/tmp/cabal-testsuite-1160356/cabal.config : withBinaryFile: does not exist (No such file or directory)



*** unexpected failure for cabal-testsuite/PackageTests/ProjectImport/UntrimmedImport/cabal.test.hs

1 tests, 0 skipped, 0 unexpected passes, 1 unexpected fails, 0 flaky passes, 0 flaky fails.
UNEXPECTED FAIL: cabal-testsuite/PackageTests/ProjectImport/UntrimmedImport/cabal.test.hs

@chreekat
Copy link
Collaborator Author

Maybe I'm using the wrong cabal lib. That was also fun to figure out:

I try --intree-cabal-lib, and it says, Missing: --test-tmp ARG. Fair.

I try --intree-cabal-lib --test-tmp /tmp, and it says, Missing: --test-tmp ARG. Ummm

I try --intree-cabal-lib . --test-tmp /tmp, and it says, Warning: Specifying an absolute path to the project file is deprecated. And fails with The Package location './Cabal' does not exist.. Where is the absolute path? Huh?

I try --intree-cabal-lib $PWD --test-tmp /tmp, and it finally starts building. But now I am specifying an absolute path...?

Unfortunately, the test still failed.

@andreasabel
Copy link
Member

/tmp/cabal-testsuite-1160356/cabal.config : withBinaryFile: does not exist (No such file or directory)

To me this looks like it has not removed the trailing space from the filename cabal.config .

@chreekat
Copy link
Collaborator Author

Yeah, as it's being discussed at #10954 , this is currently by design, which comes as a shock to me.

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

Successfully merging this pull request may close these issues.

2 participants