Skip to content

Store absolute path of main at load time#7931

Merged
headius merged 1 commit intojruby:masterfrom
headius:main_absolute_path_fixes
Sep 10, 2023
Merged

Store absolute path of main at load time#7931
headius merged 1 commit intojruby:masterfrom
headius:main_absolute_path_fixes

Conversation

@headius
Copy link
Member

@headius headius commented Sep 9, 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.

Fixes #7394

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 9, 2023
@headius headius merged commit b10f38f into jruby:master Sep 10, 2023
@headius headius deleted the main_absolute_path_fixes branch September 10, 2023 08:57
@headius headius modified the milestones: JRuby 9.3.11.0, JRuby 9.4.4.0 Sep 10, 2023
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.

require_relative confused by chdir

1 participant