-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add tests for bios dependencies #233
Conversation
I can reproduce the issue. The "problem" is this call: https://github.com/mpickering/hie-bios/blob/master/src/HIE/Bios/Cradle.hs#L354 cradle:
bios:
shell: |
:; echo "-Wall" >> $HIE_BIOS_OUTPUT
:; echo "A" >> $HIE_BIOS_OUTPUT
:; echo "B" >> $HIE_BIOS_OUTPUT
:; exit 0
ECHO "-Wall" >> %HIE_BIOS_OUTPUT%
ECHO "A" >> %HIE_BIOS_OUTPUT%
ECHO "B" >> %HIE_BIOS_OUTPUT%
dependency-shell: |
:; echo "hie.yaml" >> $HIE_BIOS_OUTPUT
:; exit 0
ECHO "hie.yaml" >> %HIE_BIOS_OUTPUT% > hie-bios debug A.hs
Root directory: /home/munin/Documents/haskell/hie-bios/tests/projects/simple-bios-shell
Component directory: /home/munin/Documents/haskell/hie-bios/tests/projects/simple-bios-shell
GHC options: -Wall A B
GHC library directory: CradleSuccess "/nix/store/vhpfihshqj6sq5f9m2825gzz97nb3qkf-ghc-8.8.3/lib/ghc-8.8.3"
GHC version: CradleSuccess "8.8.3"
Config Location: /home/munin/Documents/haskell/hie-bios/tests/projects/simple-bios-shell/hie.yaml
Cradle: Cradle {cradleRootDir = "/home/munin/Documents/haskell/hie-bios/tests/projects/simple-bios-shell", cradleOptsProg = CradleAction: Bios}
Dependencies: hie.yaml Do you think it is enough to document this or do you prefer writing things to stdout? |
Fixing the README is enough for me. Thanks for looking into this! |
Actually, there is another issue for me. The documentation says that |
how do I fix the Windows tests here? |
Afaict, the windows tests are just broken. Unfortunately, I dont know why they are broken, but you dont have to fix the tests right now, since HEAD is broken, too. |
So, after some digging, it seems like the polyglot bios shell script does not work on CI. Did you test it on windows?
When the hie.yaml file looks like this: cradle:
bios:
shell: |
ECHO "-Wall" >> %HIE_BIOS_OUTPUT%
ECHO "A" >> %HIE_BIOS_OUTPUT%
ECHO "B" >> %HIE_BIOS_OUTPUT%
dependency-shell: |
ECHO "hie.yaml" >> %HIE_BIOS_OUTPUT% otherwise, the test-output is like this:
Seems like the
|
Thanks for investigating! Can the test be fixed at all? If not, what's the solution, disable it on windows? |
Well, at very least we could run two different test, one per os. Please dont disable it 😸 |
To me, it seems like the shell script feature just does not work for windows. Unfortunately, I dont know whether this can be fixed. To be clear, the following does: cmd = concat
[ "ECHO \"-Wall\"\r\n"
, "ECHO \"A\"\r\n"
, "ECHO \"B\"\r\n"
]
> runProcessWithExitCode (shell cmd) ""
(ExitSuccess,"\"-Wall\"\n","") Second and third line are swallowed. Maybe we have to use something different to |
Yeah, it seems it only executes the first line 🤯 . To pass multiline strings to Well, the workaround could be to use only one line:
So the os aware script hack will not work as is cause it needs to put the linux specific things first 😄 |
Well, maybe this reversed hack could work:
You could drop |
d69771b
to
07ac94a
Compare
Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Can this be merged now? |
* Add tests for bios dependencies * Update docs and fix tests * Attempt to fix the Windows tests * Eliminate whitespace in ECHO Co-authored-by: Javier Neira <atreyu.bbb@gmail.com>
Thank you for your patience, merged it now |
No worries, thank you and @jneira for your help! |
I ran into issues trying to define component dependencies in my Bios cradles, and wrote a pair of failing tests to demonstrate.
Please check that I'm not missing anything, and let me know if there is an obvious fix.