Skip to content

Store absolute path of main at load time#7932

Merged
headius merged 1 commit intojruby:jruby-9.3from
headius:backport_main_cwd_fix
Sep 10, 2023
Merged

Store absolute path of main at load time#7932
headius merged 1 commit intojruby:jruby-9.3from
headius:backport_main_cwd_fix

Conversation

@headius
Copy link
Member

@headius headius commented Sep 10, 2023

This fix allows dir and Thread::Backtrace::Location and require_relative to use the proper path for a main script specified without a full path.

It's a big hacky to store the path specifically for the main script this way, but it's the only such special case and works well enough to get these cases working.

Fixes #7394

Backported from master.

This fix allows __dir__ and Thread::Backtrace::Location and
require_relative to use the proper path for a main script
specified without a full path.

It's a big hacky to store the path specifically for the main
script this way, but it's the only such special case and works
well enough to get these cases working.

Fixes jruby#7394
@headius headius added this to the JRuby 9.3.11.0 milestone Sep 10, 2023
@headius headius merged commit 02531b3 into jruby:jruby-9.3 Sep 10, 2023
@headius headius deleted the backport_main_cwd_fix branch September 10, 2023 09:40
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 this pull request may close these issues.

1 participant