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

BashScriptsTests seems to be broken on macOS #15221

Open
bishabosha opened this issue May 18, 2022 · 7 comments · Fixed by #15212
Open

BashScriptsTests seems to be broken on macOS #15221

bishabosha opened this issue May 18, 2022 · 7 comments · Fixed by #15212

Comments

@bishabosha
Copy link
Member

bishabosha commented May 18, 2022

I can't run dotty.tools.scripting.BashScriptsTests on macOS without consistently failing verifyScriptPathProperty, (and sqlDateTest) it appears no output is captured from invoked scripts in ScriptTestEnv.bashCommand, leading to assertion failures. However in the CI, it is fine

@griggt
Copy link
Collaborator

griggt commented May 18, 2022

Just curious, did you first run dist/pack? I believe that is a precondition for this test and some other tests in dotty.tools.scripting (which is not obvious, and inconsistent with the rest of the compiler test suite)

@bishabosha
Copy link
Member Author

bishabosha commented May 18, 2022

I had a look at the GitHub action cli so I did run that before, but I'm not sure what else is happening

@philwalk
Copy link
Contributor

@bishabosha Can you post the output from the failed test? I don't yet have my new mac configured for testing.

@bishabosha
Copy link
Member Author

bishabosha commented May 19, 2022

@philwalk the output can be seen here https://gist.github.com/bishabosha/5157676e96e01a79e6e59c8418114fdb,

from what I see, it looks like compiler/test-resources/scripting/scriptPath.sc is being interpreted as a bash file, and the shebang is not being activated.

so on macOS I can replace the shebang with #!/usr/bin/env dist/target/pack/bin/scala and now it works for me, (Edit, but not the CI)

@bishabosha
Copy link
Member Author

bishabosha commented May 19, 2022

I've included a fix in #15212

Edit: I removed it

@bishabosha bishabosha assigned bishabosha and philwalk and unassigned philwalk and bishabosha May 19, 2022
@bishabosha
Copy link
Member Author

bishabosha commented May 19, 2022

@philwalk I tried to push a change to prepend /usr/bin/env to the shebangs of the problematic files in the gist. However the CI did not like it unless I also add the -S flag, which I think could be problematic when you are specifically testing the preprocessing of arguments, or is this safe to do?

So perhaps there is a way to set up the environment in the subprocess so that the scala script is available in the path when I run the test?

@bishabosha
Copy link
Member Author

bishabosha commented May 25, 2022

reopening due to revert of fix in #15259

@bishabosha bishabosha reopened this May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants