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

Cannot get Development environment running on Windows 11 #7027

Closed
Cjewett opened this issue Apr 8, 2023 · 7 comments · Fixed by #7040
Closed

Cannot get Development environment running on Windows 11 #7027

Cjewett opened this issue Apr 8, 2023 · 7 comments · Fixed by #7040
Labels
build 🛠 Relates to building and releasing Dependabot core 🍏 Relates to the dependabot-core library itself T: tech-debt ⚙️

Comments

@Cjewett
Copy link

Cjewett commented Apr 8, 2023

I'm having some trouble trying to get this going on a Windows 11 machine and was curious if it's expected for Windows machines to be able to follow the README instructions to setup a development environment. I've tried a few scenarios and all of them lead to some type of issue but I'm going to highlight Visual Studio Code DevContainers scenarios since it seems like the easiest path.

It's worth noting I'm not well versed in Ruby at all, so there is a bit of a learning curve happening on my end as well.

After checking out dependabot-core onto my Windows machine and opening it in Visual Studio Code I tried two options. Reopening in Container and Clone in Volume.

Reopening in Container

Directory tree:
image

Debug dry run:

Could not locate Gemfile or .bundle/ directory

Debug Tests:

2
fatal: not a git repository (or any of the parent directories): .git
bundler: failed to load command: rdebug-ide (/home/dependabot/dependabot-core/omnibus/.bundle/ruby/3.1.0/bin/rdebug-ide)
/usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/rubygems_integration.rb:308:in `block in replace_bin_path': can't find executable rdebug-ide for gem ruby-debug-ide. ruby-debug-ide is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/rubygems_integration.rb:336:in `block in replace_bin_path'
	from /home/dependabot/dependabot-core/omnibus/.bundle/ruby/3.1.0/bin/rdebug-ide:25:in `<top (required)>'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `load'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:58:in `kernel_load'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/cli/exec.rb:23:in `run'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/cli.rb:486:in `exec'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/cli.rb:31:in `dispatch'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/cli.rb:25:in `start'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/exe/bundle:48:in `block in <top (required)>'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
	from /usr/local/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/exe/bundle:36:in `<top (required)>'
	from /usr/local/bin/bundle:25:in `load'
	from /usr/local/bin/bundle:25:in `<main>'

Clone in Volume

Directory tree:
image

Debug dry run:

bundler: command not found: rdebug-ide
Install missing gem executables with `bundle install`

If I run a bundle install and attempt again it leads to this issue

bundler: failed to load command: rdebug-ide (/usr/local/rvm/gems/ruby-3.1.4/bin/rdebug-ide)
/usr/local/rvm/gems/ruby-3.1.4/gems/ruby-debug-ide-0.7.3/lib/ruby-debug-ide.rb:9:in `require': cannot load such file -- debase (LoadError)
	from /usr/local/rvm/gems/ruby-3.1.4/gems/ruby-debug-ide-0.7.3/lib/ruby-debug-ide.rb:9:in `<top (required)>'
	from /usr/local/rvm/gems/ruby-3.1.4/gems/ruby-debug-ide-0.7.3/bin/rdebug-ide:8:in `require_relative'
	from /usr/local/rvm/gems/ruby-3.1.4/gems/ruby-debug-ide-0.7.3/bin/rdebug-ide:8:in `<top (required)>'
	from /usr/local/rvm/gems/ruby-3.1.4/bin/rdebug-ide:25:in `load'
	from /usr/local/rvm/gems/ruby-3.1.4/bin/rdebug-ide:25:in `<top (required)>'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `load'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `kernel_load'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli/exec.rb:23:in `run'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli.rb:486:in `exec'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/libexec/bundle:48:in `block in <top (required)>'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/friendly_errors.rb:120:in `with_friendly_errors'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/libexec/bundle:36:in `<top (required)>'
	from /usr/local/rvm/rubies/default/bin/bundle:31:in `load'
	from /usr/local/rvm/rubies/default/bin/bundle:31:in `<main>'
	from /usr/local/rvm/rubies/default/bin/ruby_executable_hooks:22:in `eval'
	from /usr/local/rvm/rubies/default/bin/ruby_executable_hooks:22:in `<main>'

Debug tests:

bundler: failed to load command: rdebug-ide (/usr/local/rvm/gems/ruby-3.1.4/bin/rdebug-ide)
/usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/rubygems_integration.rb:308:in `block in replace_bin_path': can't find executable rdebug-ide for gem ruby-debug-ide. ruby-debug-ide is not currently included in the bundle, perhaps you meant to add it to your Gemfile? (Gem::Exception)
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/rubygems_integration.rb:336:in `block in replace_bin_path'
	from /usr/local/rvm/gems/ruby-3.1.4/bin/rdebug-ide:25:in `<top (required)>'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `load'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `kernel_load'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli/exec.rb:23:in `run'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli.rb:486:in `exec'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/libexec/bundle:48:in `block in <top (required)>'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/3.1.0/bundler/friendly_errors.rb:120:in `with_friendly_errors'
	from /usr/local/rvm/rubies/ruby-3.1.4/lib/ruby/gems/3.1.0/gems/bundler-2.3.26/libexec/bundle:36:in `<top (required)>'
	from /usr/local/rvm/rubies/default/bin/bundle:31:in `load'
	from /usr/local/rvm/rubies/default/bin/bundle:31:in `<main>'
	from /usr/local/rvm/rubies/default/bin/ruby_executable_hooks:22:in `eval'
	from /usr/local/rvm/rubies/default/bin/ruby_executable_hooks:22:in `<main>'

Ubuntu via WSL

I also tried this but it didn't lead to a positive outcome either. There were whitespace issues where I had to convert use dos2unix to convert files, docker-dev-shell would attempt the docker run at the bottom of the script but seems to fail silently, and a couple other issues but didn't spend time documenting this too much since the VS Code route seemed like the way to go.

What's the expectation when testing dependabot-core on Windows? Is there something I'm getting wrong or is there a recommended flow for Windows that I missed?

Appreciate any help / guidance.

@jeffwidman
Copy link
Member

Hmm... sorry for the hassle here.

I don't personally use Windows, nor does any of the other core maintainers that I'm aware of, so I'm really not sure.

From a quick glance, it looks at least some of the failures you mention sound like it's using the wrong docker container... see the diagram of how the different containers layer on each other here: https://github.com/dependabot/dependabot-core#building-images-from-scratch

The VSCode instructions were originally contributed from the community, so if they're incorrect we'd happily accept a PR to fix.

@mburumaxwell @milind009 @trejjam I think the three of you all worked on your contributions to this project using Windows machines, perhaps you know?

@jeffwidman jeffwidman added core 🍏 Relates to the dependabot-core library itself build 🛠 Relates to building and releasing Dependabot labels Apr 8, 2023
@jeffwidman jeffwidman changed the title Windows 11 Developer Environment Expectations Cannot get Development environment running on Windows 11 Apr 8, 2023
@jeffwidman
Copy link
Member

For the rdebug-ide problem, see:

@dwc0011 do you dev on a windows machine or a unix variant?

@dwc0011
Copy link
Contributor

dwc0011 commented Apr 9, 2023

I use wsl within windows 11 and am able to run without issues with some modifications.

I am on my phone so I do not have everything in front of me. But the cannot find .bundle issue when running is because it’s in the omnibus directory. Update the run Json to point to that and it should find it.

I will create PR(s) after the holidays that will update the instructions, update the gem files, and the outdated extensions. I will definitely have them submitted Monday at the latest.

@Cjewett
Copy link
Author

Cjewett commented Apr 9, 2023

Thanks for the responses! I'll most likely wait until I see some of the changes from @dwc0011's PRs. After I see how it all works using WSL and being able to play around with it I hope to have a better understanding to take a look at the VS Code issues.

@dwc0011
Copy link
Contributor

dwc0011 commented Apr 10, 2023

@Cjewett PR Submitted #7040
Please follow to see if/when approved and merged.

@jeffwidman
Copy link
Member

@Cjewett #7040 fixed this for you, right? Just want to ensure you were able to get a development environment going... if not, please holler.

Also, if you're doing this to debug a problem or submit a PR and run into further problems please let us know...

@Cjewett
Copy link
Author

Cjewett commented Apr 24, 2023

@jeffwidman I haven't had time to circle back to this but should get a chance this upcoming weekend. I'll report back after I test.

Our requirements are:
Scan Git repositories in Bitbucket Server or Bitbucket Data Center
Open ticket in Jira and then create Bitbucket pull request with changes
Deploy to our own k8 cluster

I actually found a PR that does exactly what we need (#6924) on the Bitbucket and Jira front, so my plan is to learn how this all works and try their solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build 🛠 Relates to building and releasing Dependabot core 🍏 Relates to the dependabot-core library itself T: tech-debt ⚙️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants