-
Notifications
You must be signed in to change notification settings - Fork 698
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
Fix run command environment #9341
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test and a changelog.d
entry would be nice.
@geekosaur this is still a Draft PR and I am aware there will be more steps to get this merged. 🙂 More importantly this does not work yet. Printing out the added environment shows just: [("GHC_ENVIRONMENT",Just "/Users/xsebek/Git/haskell-language-server/dist-newstyle/tmp/environment.-20638/.ghc.environment.aarch64-darwin-9.2.8")] The file does not exist, so I assume it's creation was skipped in I would be grateful for any tips. |
I think this PR is confused. env files are ghc package environment env files. The ticket seems to be about just setting the PATH shell environment variable -- a totally different usage of the name "environment". The issue (I think) is that the test action is invoked via the
(that in turn uses The run action is invoked directly, so doesn't have that logic, which will need to be shared/replicated. (This is because there's a |
@gbaz I overlooked where
|
Hrm... porting that from exec to run could likely work! |
f45c16f
to
8ac9633
Compare
@gbaz please take a look now. 🙂 Not sure if there is a good place for |
Similarly to CmdExec and CmdTest, get paths to all dependency binaries and add those to PATH. Unlike CmdExec, add just the explicitly required paths.
I switched to using the existing |
Looks good, we should probably give it a user acceptance test at least. |
@gbaz should I prepare something for the test or are the notes enough? 🙂 |
Can you please add a test? |
@mpickering sure, I will get to it next week and see if there is a similar test that I could modify. 🙂 |
@mpickering as far as I can see, the only integration test that actually runs any Reading the test README leaves me rather confused, as there are no shell scripts that run commands there. Otherwise, I guess I could write an integration test for There are "golden tests" in unit tests that check the cabal files in If there is some up-to-date guidance on how to write new tests in the repo, please point me to it. 🙂 |
@xsebek You should write a test in I can write this test for you if you would like me to. |
@xsebek hey! Any news on this? The last bit remaining is a test. And Matt suggested he could do it for you if you’re having trouble. What do you think? |
I could absorb this PR into #9527. Thoughts? @ulysses4ever |
@jasagredo I'm good with absorbing! |
Closing as it was absorbed by #9527 |
elabExeDependencyPaths
to get run test dependenciescabal test
sees the executable, butcabal run
does not. #8391QA Notes
Calling
cabal run
should run the executable with dependencies on PATH.Run a test that uses the built executable (e.g. fourmolu or HLS) that it depends on via
build-tool-depends
.For example in the case of
func-test
in HLS, the following invocations should now all pass: