Skip to content

Allow to use RBS in symlinked tree#1624

Merged
pocke merged 1 commit intoruby:masterfrom
p0deje:patch-1
Nov 20, 2023
Merged

Allow to use RBS in symlinked tree#1624
pocke merged 1 commit intoruby:masterfrom
p0deje:patch-1

Conversation

@p0deje
Copy link
Contributor

@p0deje p0deje commented Nov 17, 2023

Currently RBS cannot be used from Bazel or any other tool that builds a forest of symlinks because Gemfile.lock has different path:

$ rbs collection install
RBS Collection loads a different Gemfile.lock from before. (RBS::Collection::Config::LockfileGenerator::GemfileLockMismatchError)
The Gemfile.lock must be the same as that is recorded in rbs_collection.lock.yaml.
Expected Gemfile.lock: /private/var/tmp/_bazel_p0deje/d9f7ca256f773f0ccaaf86cfc9fd2df8/execroot/selenium/bazel-out/darwin_arm64-fastbuild/bin/rb/rbs-install.rb.sh.runfiles/selenium/rb/Gemfile.lock
Actual Gemfile.lock: /Users/p0deje/Development/SeleniumHQ/selenium/rb/Gemfile.lock

This commit would allow to resolve the symlink before attempting to paths.

Currently RBS cannot be used from Bazel or any other tool that builds a forest of symlinks because Gemfile.lock has different path:

```
$ rbs collection install
RBS Collection loads a different Gemfile.lock from before. (RBS::Collection::Config::LockfileGenerator::GemfileLockMismatchError)
The Gemfile.lock must be the same as that is recorded in rbs_collection.lock.yaml.
Expected Gemfile.lock: /private/var/tmp/_bazel_p0deje/d9f7ca256f773f0ccaaf86cfc9fd2df8/execroot/selenium/bazel-out/darwin_arm64-fastbuild/bin/rb/rbs-install.rb.sh.runfiles/selenium/rb/Gemfile.lock
Actual Gemfile.lock: /Users/p0deje/Development/SeleniumHQ/selenium/rb/Gemfile.lock
```

This commit would allow to resolve the symlink before attempting to paths.
@p0deje
Copy link
Contributor Author

p0deje commented Nov 17, 2023

Actually, this is not enough because now the Gemfile.lock path is written to the lockfile as a relative path.

gemfile_lock_path: "../../../../../../../../../../../../../../Users/p0deje/Development/SeleniumHQ/selenium/rb/Gemfile.lock"

I would need to figure out the proper way to fix it.

@pocke pocke added this pull request to the merge queue Nov 20, 2023
Merged via the queue into ruby:master with commit 3d6c825 Nov 20, 2023
@soutaro soutaro added this to the RBS 3.3.x milestone Nov 21, 2023
@soutaro soutaro added the Released PRs already included in the released version label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Released PRs already included in the released version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants