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

Cache cabal wrapper to avoid invalidating configuration #265

Merged
merged 2 commits into from
Jan 29, 2021

Conversation

wz1000
Copy link
Contributor

@wz1000 wz1000 commented Nov 17, 2020

Leads to much faster ghcide startup times.

@wz1000
Copy link
Contributor Author

wz1000 commented Nov 17, 2020

From CI:

Error: The `add-path` command is disabled. Please upgrade to using Environment Files or opt into unsecure command execution by setting the `ACTIONS_ALLOW_UNSECURE_COMMANDS` environment variable to `true`. For more information see: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/

@fendor
Copy link
Collaborator

fendor commented Nov 17, 2020

I can't see where add-path is allegedly being used...

EDIT: found it

@fendor
Copy link
Collaborator

fendor commented Nov 17, 2020

actions/setup-haskell#44 is related

@jneira
Copy link
Member

jneira commented Nov 17, 2020

actions/setup-haskell#44 is related

It could be avoided with something like haskell/ghcide@5b36a5f

@fendor
Copy link
Collaborator

fendor commented Nov 18, 2020

I know, but I am wondering whether it is ok to wait for two days, then update CI once and then merge this...

@jneira
Copy link
Member

jneira commented Nov 18, 2020

I know, but I am wondering whether it is ok to wait for two days

Fair enough, not sure if it will be fixed in two days or more though 😝

@fendor
Copy link
Collaborator

fendor commented Nov 18, 2020

@wz1000 I think you have to rebase on top of master, then CI should run as expected

@wz1000
Copy link
Contributor Author

wz1000 commented Nov 18, 2020

I'm stumped. @fendor, @jneira help, please?

@fendor
Copy link
Collaborator

fendor commented Nov 18, 2020

@wz1000 We will get to the bottom of it. I will boot my windows again :) puts on security helmet

@jneira
Copy link
Member

jneira commented Nov 19, 2020

I'll try to take a look too. will share what i find

@jneira
Copy link
Member

jneira commented Nov 19, 2020

Ok, i've tried locally this version and the command is failing in ci works for me:

  • ci
HUnitFailure (Just (SrcLoc {srcLocPackage = "main", srcLocModule = "Main", srcLocFile = "tests\\\\BiosTests.hs", srcLocStartLine = 303, srcLocStartCol = 12, srcLocEndLine = 303, srcLocEndCol = 73})) (Reason "Unexpected cradle failError when calling cabal --builddir=C:\\Users\\runneradmin\\AppData\\Local\\hie-bios\\dist-hie-bios-test-0fe1fee0b81853d0-2894c051acc238b93bf25188905c0e36 v2-exec --with-compiler C:\\Users\\runneradmin\\AppData\\Local\\hie-bios\\wrapper-4da94d68375fab32d2147da1837e9611.exe ghc -v0 -- --print-libdir\n\ncabal: The program 'ghc' version >=7.0.1 is required but the version of\nC:\\Users\\runneradmin\\AppData\\Local\\hie-bios\\wrapper-4da94d68375fab32d2147da1837e9611.exe\ncould not be determined.\n\n\n")
  • locally
PS D:\dev\ws\haskell\hie-bios> cabal --builddir=C:\Users\atrey\AppData\Local\hie-bios\dist-hie-bios-85a445ee2bd89b92376799d3a4db4f95  v2-exec --with-compiler C:\Users\atrey\AppData\Local\hie-bios\wrapper-4da94d68375fab32d2147da1837e9611.exe ghc -v0 -- --print-libdir
D:\bin\stack\x86_64-windows\ghc-8.10.1\lib

It seems the wrapper in ci does not have ghc con $PATH (but it must be!)

readProcessWithCwd
wdir "cabal" (["--builddir="<>buildDir,"v2-exec", "ghc", "-v0", "--"] ++ args) ""
wdir "cabal" (["--builddir="<>buildDir,"v2-exec","--with-compiler", wrapper_fp, "ghc", "-v0", "--"] ++ args) ""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
wdir "cabal" (["--builddir="<>buildDir,"v2-exec","--with-compiler", wrapper_fp, "ghc", "-v0", "--"] ++ args) ""
wdir "cabal" (["v2-exec", "ghc", "-v0", "--"] ++ args) ""

what about if we use the hie-bios cabaldir for cabal repl, but the user cabaldir for cabal exec (without -w)? that way cabal exec will not invalidate neither

@fendor fendor merged commit c16e571 into haskell:master Jan 29, 2021
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.

3 participants