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

Debugging Scenic silently exits on launch #194

Closed
tiger808 opened this issue Oct 19, 2019 · 4 comments · Fixed by elixir-lsp/elixir-ls#71
Closed

Debugging Scenic silently exits on launch #194

tiger808 opened this issue Oct 19, 2019 · 4 comments · Fixed by elixir-lsp/elixir-ls#71

Comments

@tiger808
Copy link

Environment

  • Elixir version: "1.9.1 (compiled with Erlang/OTP 22)"
  • Erlang version: "22"
  • Operating system: MacOS 10.13.6
  • Client (editor or IDE): VS Code 1.39.1

Crash Report

Attempting to debug an app using Scenic: https://github.com/boydm/scenic

  1. Make a new Scenic example app:
mix scenic.new.example my_app
cd my_app
mix do deps.get, scenic.run
  1. Add a launch configuration that excludes the NIF modules:
{
        "type": "mix_task",
        "env": {"MIX_ENV": "dev"},
        "name": "mix scenic.run",
        "request": "launch",
        "task": "scenic.run",
        "projectDir": "${workspaceRoot}",
        "excludeModules": ["Scenic.Math.Line", "Scenic.Math.Matrix", "Scenic.Utilities.Texture"]
 }
  1. SELECT THE "mix scenic.run" configuration and debug. Debug console shows:
Started ElixirLS debugger
Elixir version: "1.9.1 (compiled with Erlang/OTP 22)"
Erlang version: "22"

The Scenic app window flashes on the screen for a fraction of a second, and then exits.

I don't see anything suspicious looking in the logs.

@mattraykowski
Copy link

I don't think this is specific to Scenic, as we're seeing it in Phoenix and other non-Phoenix projects as well. See #185 .

@joshua-andrassy
Copy link

joshua-andrassy commented Nov 11, 2019

Have been experiencing this myself with various Plug and Phoenix projects using Elixir 1.9.x. Using 1.8.x always resolves the issue for me.

Did some tinkering this weekend and it appears this is where things are going awry:

defp launch_task(task, args) do

With 1.8.x, Mix.Task.run does not return
With 1.9.x, Mix.Task.run returns with :ok.

Elixir is still very much a language I'm working with in my spare time and next steps for me would be to compare differences between 1.8.x and 1.9.x in regards to Mix.Task.run.

Additional notes
Curious if its related to this change in 1.9.x from 1.8.x where Process.sleep is no longer called in favor of System.no_halt

1.8.2
https://github.com/elixir-lang/elixir/blob/98485daab0a9f3ac2d7809d38f5e57cd73cb22ac/lib/mix/lib/mix/tasks/run.ex#L87

1.9.4
https://github.com/elixir-lang/elixir/blob/055526057ac9992cc1df87441357c4e56d45235d/lib/mix/lib/mix/tasks/run.ex#L86

axelson added a commit to elixir-lsp/elixir-ls that referenced this issue Nov 16, 2019
Ensure debugger process continues to run, adapts to the new behavior in Elixir
1.9 that changed `Mix.Task.run` to return instead of sleeping indefinitely:
elixir-lang/elixir@3673849

- Fixes JakeBecker/elixir-ls#194
- Fixes JakeBecker/elixir-ls#185
@axelson
Copy link

axelson commented Nov 16, 2019

I just published version 0.2.28 of the ElixirLS fork that solves this issue: https://github.com/elixir-lsp/elixir-ls

And thanks @joshua-andrassy for the investigation! That was very helpful.

@JakeBecker
Copy link
Owner

This project has moved!

It's now being maintained by proactive volunteers from the Elixir community over at elixir-lsp/elixir-ls. Updates will continue to be published from that repo to the original VS Code extension, so no need to switch plugins if you're using VS Code.

To avoid inundating the new maintainers with issues, please verify that your issue persists with the latest version of the extension (which is published from the new repo) before re-filing your issue there.

Thanks for using ElixirLS!

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 a pull request may close this issue.

5 participants