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

Server Does not Appear to Work #10842

Closed
jherdman opened this issue Jul 28, 2022 · 0 comments · Fixed by #10852
Closed

Server Does not Appear to Work #10842

jherdman opened this issue Jul 28, 2022 · 0 comments · Fixed by #10852
Assignees
Labels

Comments

@jherdman
Copy link

After reading an article about the new Rubocop server I eagerly attempted it on a project that uses Nix to manage the dev environment. I believe something is awry, possibly related to #10771 (wild guess).


Expected behavior

Initializing a Rubocop server works, and continues to work upon subsequent calls to Rubocop.

Actual behavior

Sample shell commands from a session:

$ bin/rubocop --start-server
RuboCop server starting on 127.0.0.1:61108.

$ bin/rubocop --server-status
RuboCop server (16113) is running.

$ time bin/rubocop
2607 files inspected, no offenses detected

real	0m23.144s
user	0m0.400s
sys	0m0.107s

$ bin/rubocop --server-status
RuboCop server is not running.

rubocop --debug

For /Users/james/Projects/PN/eternal-sledgehammer: configuration from /Users/james/Projects/PN/eternal-sledgehammer/.rubocop.yml
configuration from /Users/james/Projects/PN/eternal-sledgehammer/vendor/cache/ruby/2.7.0/gems/rubocop-performance-1.14.3/config/default.yml
configuration from /Users/james/Projects/PN/eternal-sledgehammer/vendor/cache/ruby/2.7.0/gems/rubocop-performance-1.14.3/config/default.yml
Default configuration from /Users/james/Projects/PN/eternal-sledgehammer/vendor/cache/ruby/2.7.0/gems/rubocop-1.32.0/config/default.yml
configuration from /Users/james/Projects/PN/eternal-sledgehammer/vendor/cache/ruby/2.7.0/gems/rubocop-rails-2.15.2/config/default.yml
configuration from /Users/james/Projects/PN/eternal-sledgehammer/vendor/cache/ruby/2.7.0/gems/rubocop-rails-2.15.2/config/default.yml
configuration from /Users/james/Projects/PN/eternal-sledgehammer/vendor/cache/ruby/2.7.0/gems/rubocop-rspec-2.12.1/config/default.yml
configuration from /Users/james/Projects/PN/eternal-sledgehammer/vendor/cache/ruby/2.7.0/gems/rubocop-rspec-2.12.1/config/default.yml
Inheriting configuration from /Users/james/Projects/PN/eternal-sledgehammer/.rubocop_todo.yml
.rubocop.yml: Metrics/MethodLength:Exclude overrides the same parameter in .rubocop_todo.yml
Use parallel by default.
Running parallel inspection

# elide indications of cache scanning

Please use rubocop --debug when pasting rubocop output as it contains additional information.

Steps to reproduce the problem

See above

RuboCop version

Include the output of rubocop -V or bundle exec rubocop -V if using Bundler.
If you see extension cop versions (e.g. rubocop-performance, rubocop-rspec, and others)
output by rubocop -V, include them as well. Here's an example:

$ [bundle exec] rubocop -V
1.32.0 (using Parser 3.1.2.0, rubocop-ast 1.19.1, running on ruby 2.7.6 arm64-darwin21)
  - rubocop-performance 1.14.3
  - rubocop-rails 2.15.2
  - rubocop-rspec 2.12.1
@koic koic added the bug label Jul 29, 2022
@koic koic self-assigned this Jul 29, 2022
koic added a commit to koic/rubocop that referenced this issue Aug 1, 2022
…line option

Fix rubocop#10771.

This PR makes server mode aware of `--cache-root` command line option.

The logic for getting `--cache-root` from command line option is original to make
the implementation lighter. Because the client of server mode should be lightweight.
rubocop#10842 needs a different solution than `--cache-root` option.
I'm working on it separately from solving this issue.
bbatsov pushed a commit that referenced this issue Aug 1, 2022
…tion

Fix #10771.

This PR makes server mode aware of `--cache-root` command line option.

The logic for getting `--cache-root` from command line option is original to make
the implementation lighter. Because the client of server mode should be lightweight.
#10842 needs a different solution than `--cache-root` option.
I'm working on it separately from solving this issue.
koic added a commit to koic/rubocop that referenced this issue Aug 3, 2022
…d two env vars

Fixes rubocop#10842 and follow up rubocop#10849.

This PR makes server mode aware of `CacheRootDirectory` config option value,
`RUBOCOP_CACHE_ROOT`, and `XDG_CACHE_HOME` environment variables.

`RuboCop::ConfigLoader` and `RuboCop::ResultCache` classes to get these values has many dependencies.
So, it is not suitable for use in server mode where speed is required.

This solution is to extract `ConfigPathFinder` class from `ConfigLoader` class and `CacheRoot` class
from `ResultCache` class.
This allows server mode to depend on lightweight `ConfigPathFinder` and `CacheRoot` classes.
bbatsov pushed a commit that referenced this issue Aug 3, 2022
…nv vars (#10852)

Fixes #10842 and follow up #10849.

This PR makes server mode aware of `CacheRootDirectory` config option value,
`RUBOCOP_CACHE_ROOT`, and `XDG_CACHE_HOME` environment variables.

`RuboCop::ConfigLoader` and `RuboCop::ResultCache` classes to get these values has many dependencies.
So, it is not suitable for use in server mode where speed is required.

This solution is to extract `ConfigFinder` class from `ConfigLoader` class and `CacheConfig` class
from `ResultCache` class.
This allows server mode to depend on lightweight `ConfigFinder` and `CacheConfig` classes.
WJWH pushed a commit to WJWH/rubocop that referenced this issue Aug 8, 2022
…line option

Fix rubocop#10771.

This PR makes server mode aware of `--cache-root` command line option.

The logic for getting `--cache-root` from command line option is original to make
the implementation lighter. Because the client of server mode should be lightweight.
rubocop#10842 needs a different solution than `--cache-root` option.
I'm working on it separately from solving this issue.
WJWH pushed a commit to WJWH/rubocop that referenced this issue Aug 8, 2022
…d two env vars (rubocop#10852)

Fixes rubocop#10842 and follow up rubocop#10849.

This PR makes server mode aware of `CacheRootDirectory` config option value,
`RUBOCOP_CACHE_ROOT`, and `XDG_CACHE_HOME` environment variables.

`RuboCop::ConfigLoader` and `RuboCop::ResultCache` classes to get these values has many dependencies.
So, it is not suitable for use in server mode where speed is required.

This solution is to extract `ConfigFinder` class from `ConfigLoader` class and `CacheConfig` class
from `ResultCache` class.
This allows server mode to depend on lightweight `ConfigFinder` and `CacheConfig` classes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants