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

✨ Allow setting local_fs_map even when using UI_UnixDomainServer #745

Merged
merged 1 commit into from
Oct 28, 2022
Merged

✨ Allow setting local_fs_map even when using UI_UnixDomainServer #745

merged 1 commit into from
Oct 28, 2022

Conversation

marianosimone
Copy link
Contributor

Description

This is a fix for #741

Basically, allow users to specify the local_fs_map even when using UI_UnixDomainServer. The idea is to maintain the existing behavior when the configuration is not specified, but use it when it is.

From the original context:

Stripe runs ruby on a remote server and VS Code on a laptop. We proxy the unix domain socket from server to laptop, and need to use the fs map feature to translate file paths.

@ko1 ko1 added this to the v1.7.0 milestone Sep 16, 2022
@ko1 ko1 added the enhancement New feature or request label Sep 16, 2022
@marianosimone
Copy link
Contributor Author

@ko1 there's a failing test, but I'm not sure it's related to my changes, as the same test failed in all my other PRs 😕

@ko1
Copy link
Collaborator

ko1 commented Sep 16, 2022

===============================================================================
Failure: test_default_case(DEBUGGER__::Fork_fork_0):
  Test::Unit::AssertionFailedError: 
  --------------------
  | Debugger Session |
  --------------------
  
  > [1, 10] in /tmp/debug-20220916-1804-xhwni.rb
  > =>   1| pid = fork do
  >      2|   binding.b do: 'p :child_enter'
  >      3|   a = 1
  >      4|   b = 2
  >      5|   c = 3
  >      6|   binding.b do: 'p :child_leave'
  >      7| end
  >      8| sleep 0.5
  >      9| binding.b do: 'p :parent_enter'
  >     10| a = 1
  > =>#0	<main> at /tmp/debug-20220916-1804-xhwni.rb:1
  > b 5
  > (rdbg) b 5
  > #0  BP - Line  /tmp/debug-20220916-1804-xhwni.rb:5 (line)
  > b 10
  > (rdbg) b 10
  > #1  BP - Line  /tmp/debug-20220916-1804-xhwni.rb:10 (line)
  > (rdbg) c
  > DEBUGGER: Attaching after process 37[27](https://github.com/ruby/debug/actions/runs/2973698355/jobs/4951402957#step:4:28) fork to child process 37[36](https://github.com/ruby/debug/actions/runs/2973698355/jobs/4951402957#step:4:37)
  > [4, 13] in /tmp/debug-20220916-1804-xhwni.rb
  >      4|   b = 2
  >      5|   c = 3
  >      6|   binding.b do: 'p :child_leave'
  >      7| end
  >      8| sleep 0.5
  > =>   9| binding.b do: 'p :parent_enter'
  >     10| a = 1
  >     11| b = 2
  >     12| c = 3
  >     13| binding.b do: 'p :parent_leave'
  > =>#0	<main> at /tmp/debug-20220916-1804-xhwni.rb:9
  > (rdbg:binding.break) p :parent_enter
  > => :parent_enter
  > [5, 14] in /tmp/debug-20220916-1804-xhwni.rb
  >      5|   c = 3
  >      6|   binding.b do: 'p :child_leave'
  >      7| end
  >      8| sleep 0.5
  >      9| binding.b do: 'p :parent_enter'
  > =>  10| a = 1
  >     11| b = 2
  >     12| c = 3
  >     13| binding.b do: 'p :parent_leave'
  >     14| Process.waitpid pid
  > =>#0	<main> at /tmp/debug-20220916-1804-xhwni.rb:10
  > 
  > Stop by #1  BP - Line  /tmp/debug-20220916-1804-xhwni.rb:10 (line)
  
  
  
  
  -------------------
  | Failure Message |
  -------------------
  
  Expected the debugger program to finish on LOCAL mode.
/home/runner/work/debug/debug/test/support/assertions.rb:97:in `assert_block'
/home/runner/work/debug/debug/test/support/console_test_case.rb:107:in `rescue in block (2 levels) in debug_code'
/home/runner/work/debug/debug/test/support/console_test_case.rb:92:in `block (2 levels) in debug_code'
/home/runner/work/debug/debug/test/support/console_test_case.rb:209:in `prepare_test_environment'
/home/runner/work/debug/debug/test/support/console_test_case.rb:90:in `block in debug_code'
/home/runner/.rubies/ruby-debug/lib/ruby/3.2.0+2/timeout.rb:188:in `block in timeout'
/home/runner/.rubies/ruby-debug/lib/ruby/3.2.0+2/timeout.rb:36:in `block in catch'
/home/runner/.rubies/ruby-debug/lib/ruby/3.2.0+2/timeout.rb:36:in `catch'
/home/runner/.rubies/ruby-debug/lib/ruby/3.2.0+2/timeout.rb:36:in `catch'
/home/runner/.rubies/ruby-debug/lib/ruby/3.2.0+2/timeout.rb:197:in `timeout'
/home/runner/work/debug/debug/test/support/console_test_case.rb:89:in `debug_code'
/home/runner/work/debug/debug/test/console/config_fork_test.rb:51:in `test_default_case'
     [48](https://github.com/ruby/debug/actions/runs/2973698355/jobs/4951402957#step:4:49): 
     [49](https://github.com/ruby/debug/actions/runs/2973698355/jobs/4951402957#step:4:50):   module ForkTestTemplate
     [50](https://github.com/ruby/debug/actions/runs/2973698355/jobs/4951402957#step:4:51):     def test_default_case
  => [51](https://github.com/ruby/debug/actions/runs/2973698355/jobs/4951402957#step:4:52):       debug_code(program) do
     [52](https://github.com/ruby/debug/actions/runs/2973698355/jobs/4951402957#step:4:53):         # type 'config fork_mode = both' # default
     [53](https://github.com/ruby/debug/actions/runs/2973698355/jobs/4951402957#step:4:54):         type 'b 5'
     [54](https://github.com/ruby/debug/actions/runs/2973698355/jobs/4951402957#step:4:55):         type 'b 10'
===============================================================================

It seems to stick at fork example. Let me check...

@marianosimone marianosimone closed this by deleting the head repository Oct 25, 2022
@marianosimone marianosimone reopened this Oct 25, 2022
@ko1 ko1 merged commit 87b6c06 into ruby:master Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

2 participants