Bug #13569


Windows - TestRubyOptions#test_search - append to paths instead of replacing

Added by MSP-Greg (Greg L) about 5 years ago. Updated over 4 years ago.

Target version:
ruby -v:
ruby 2.5.0dev (2017-05-11 trunk 58657) [x64-mingw32]


TestRubyOptions#test_search replaces ENV['PATH'], which causes a failure under Windows. PR appends, rather than replacing.

See GitHub PR 1616.

Updated by MSP-Greg (Greg L) almost 5 years ago

Decided to re-run this test, as it's been a while. I've been applying the patch before my normal test runs, so I haven't checked for its (continued) failure for a while. Given that my test results have been consistent across all test sets, I doubt I've got something wrong with my env setup during testing.

Note that if I run this test with runner.rb in a windows env, the test passes. But as noted below, it fails when run with make (I set a make env by adding msys64\mingw64\bin and msys64\usr\bin to my path.)

Below is a command window grab from a make test:

E:\GitHub\ruby-loco\src\build-x86_64>make.exe "TESTOPTS= --show-skip ../ruby/test/ruby/test_rubyoptions.rb" test-all
Run options: "--ruby=./miniruby.exe -I../ruby/lib -I. -I.ext/common  ../ruby/tool/runruby.rb --extout=.ext  -- --disable-gems" --excludes-dir=../ruby/
test/excludes --name=!/memory_leak/ --show-skip

# Running tests:

  1) Skipped:
TestRubyOptions#test_set_program_name [E:/GitHub/ruby/test/ruby/test_rubyoptions.rb:514]:
platform dependent feature

  2) Skipped:
TestRubyOptions#test_setproctitle [E:/GitHub/ruby/test/ruby/test_rubyoptions.rb:533]:
platform dependent feature

  3) Failure:
TestRubyOptions#test_search [E:/GitHub/ruby/test/ruby/test_rubyoptions.rb:303]:

1. [1/2] Assertion for "stdout"
   | <["1"]> expected but was
   | <[]>.

Finished tests in 18.127200s, 3.0341 tests/s, 47.0564 assertions/s.
55 tests, 853 assertions, 1 failures, 0 errors, 2 skips

ruby -v: ruby 2.5.0dev (2017-07-17 trunk 59347) [x64-mingw32]
make: *** [ yes-test-all] Error 1

If you cannot repo this, please feel free to respond.

Updated by h.shirosaki (Hiroshi Shirosaki) over 4 years ago

I can reproduce this with msys2 build.
miniruby.exe and ruby.exe have dependency to libgmp-10.dll.
So path which contains libgmp-10.dll is needed to PATH environment variable.

I can avoid the issue by copying libgmp-10.dll to current directory.

It seems that rubyinstaller2 binary uses manifest dependency instead of PATH.

Updated by MSP-Greg (Greg L) over 4 years ago

My MinGW builds are very similar to rubyinstaller2 builds, and they also use a manifest. They use the rubyinstaller2 runtime.

Speaking of copying files, I do copy a file for another test, but I didn't note which test it affected...

copy /b .\ext\-test-\win32\dln\dlntest.dll dlntest.dll

Re the PR, it could be made dependent on RUBY_PLATFORM, etc.

Thank you for reviewing.

Actions #4

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r59870.

test_rubyoptions.rb: keep paths if necessary

  • test/ruby/test_rubyoptions.rb (TestRubyOptions#test_search):
    PATH must keep library loading paths on a platform where it is
    used for that purpose, for extra libraries.
    [ruby-core:81178] [Bug #13569] [Fix GH-1616]

Also available in: Atom PDF