Project

General

Profile

Bug #10821

mkmf.rb: Incorrect have_devel? test depending on run order

Added by joshpeek (Joshua Peek) over 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin14.0]
[ruby-core:67962]

Description

have_devel? is usually lazily checked on the first call to try_do(). However, try_do() may be invoked within the scope of a with_ldflags or with_cflags block. If have_devel? is checked for the first time with altered test LDFLAGS or CFLAGS it may crash.

# extconf.rb
$LDFLAGS = "-L/custom/path/to/lib
try_ldflags "-Issl"
# try_ldflags -> try_link -> try_do -> have_devel (with incorrect $LDFLAG in scope)

Related issues

Related to Ruby master - Bug #11434: test_try_ldflag_invalid_opt fails when ruby is not installedRejectedusa (Usaku NAKAMURA)Actions
#1

Updated by nobu (Nobuyoshi Nakada) over 5 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

Applied in changeset r49482.


mkmf.rb: avoid interference

  • lib/mkmf.rb (try_cppflags, try_cflags, try_ldflags): get rid of interference by modifying global variables in have_devel? method. [ruby-core:67962] [Bug #10821]

Updated by tmm1 (Aman Gupta) over 5 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED

Updated by naruse (Yui NARUSE) over 5 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: DONE

ruby_2_2 r49581 merged revision(s) 49482,49487.

Updated by usa (Usaku NAKAMURA) over 5 years ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: REQUIRED, 2.2: DONE to 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE

Updated by usa (Usaku NAKAMURA) over 5 years ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED, 2.2: DONE to 2.0.0: DONE, 2.1: REQUIRED, 2.2: DONE

ruby_2_0_0 r49735 merged revision(s) 49482,49487.
note: need to require envutil because it's not loaded implicitly ruby 2.0.0.

#6

Updated by nagachika (Tomoyuki Chikanaga) about 5 years ago

  • Backport changed from 2.0.0: DONE, 2.1: REQUIRED, 2.2: DONE to 2.0.0: DONE, 2.1: DONE, 2.2: DONE

Backported into ruby_2_1 branch at r49993.

#7

Updated by vo.x (Vit Ondruch) almost 5 years ago

  • Related to Bug #11434: test_try_ldflag_invalid_opt fails when ruby is not installed added

Also available in: Atom PDF