Project

General

Profile

Actions

Bug #8379

closed

json dependency problem

Added by akr (Akira Tanaka) almost 11 years ago. Updated almost 11 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.1.0dev (2013-05-07 trunk 40599) [i686-linux]
[ruby-dev:47327]

Description

json の Makefile の依存関係ですが、generator.o と parser.o の依存先の
ヘッダファイルが足りないようです。

過不足を調べてくれるスクリプト (update-deps) によれば、以下が足りないようです。

ext/json/generator/generator.o は以下が依存先として記述されていない:
include/ruby.h
include/ruby/ruby.h
.ext/include/i686-linux/ruby/config.h
include/ruby/defines.h
include/ruby/missing.h
include/ruby/intern.h
include/ruby/st.h
include/ruby/subst.h
include/ruby/encoding.h
include/ruby/oniguruma.h
include/ruby/re.h
include/ruby/regex.h

ext/json/parser/parser.o は以下が依存先として記述されていない:
ext/json/parser/parser.rl
include/ruby.h
include/ruby/ruby.h
.ext/include/i686-linux/ruby/config.h
include/ruby/defines.h
include/ruby/missing.h
include/ruby/intern.h
include/ruby/st.h
include/ruby/subst.h
include/ruby/encoding.h
include/ruby/oniguruma.h

http://www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20130507T121000Z.log.html.gz#update-deps

たとえば、generator.o について試すと、
以下のように ruby.h を更新した (ゴミをつけくわえた) 後に
make しても 再コンパイルされません。

% cd ext/json/generator
% make
installing default generator libraries
% ls -l ../../../include/ruby.h generator.o
-rw-r--r-- 1 akr akr 868 May 7 23:31 ../../../include/ruby.h
-rw-r--r-- 1 akr akr 214264 May 7 23:31 generator.o
% echo foo >> ../../../include/ruby.h
% make
installing default generator libraries

そして、generator.o を消して make すると再コンパイルされ、
(ruby.h にゴミがついているので) エラーになります。

% rm generator.o
% make
compiling generator.c
In file included from ../../.././include/ruby/encoding.h:23,
from ../fbuffer/fbuffer.h:29,
from generator.c:1:
../../.././include/ruby/oniguruma.h:101: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘#pragma’
In file included from ../../.././include/ruby/re.h:25,
from generator.h:11,
from generator.c:2:
../../.././include/ruby/regex.h:27: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘#pragma’

つまり、generator.o の生成のためには ruby.h が必要ですが、
Makefile にその依存関係が記述されていないため、
ruby.h が更新されるだけでは make で generator.o が更新されないという
問題があります。

Actions #1

Updated by naruse (Yui NARUSE) almost 11 years ago

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

This issue was solved with changeset r40608.
Akira, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • ext/json/generator/depend: fix dependencies [Bug #8379]

  • ext/json/parser/depend: ditto.

Actions

Also available in: Atom PDF

Like0
Like0