Bug #18666
closedNo rule to make target 'yaml/yaml.h', needed by 'api.o'
Description
When updating my Ruby compilation with make up; make
, I hit the following error:
make[2]: Entering directory '/home/duerst/14ruby/ext/psych'
make[2]: *** No rule to make target 'yaml/yaml.h', needed by 'api.o'. Stop.
make[2]: Leaving directory '/home/duerst/14ruby/ext/psych'
make[1]: *** [exts.mk:262: ext/psych/all] Error 2
make[1]: Leaving directory '/home/duerst/14ruby'
make: *** [uncommon.mk:307: build-ext] Error 2
./ruby -v
is ruby 3.2.0dev (2022-03-22T19:51:05Z master 0140e6c41e) [x86_64-linux]
All of this is on Ubuntu 20.04 on WSL2 on Windows 10.
My guess is that this bug is related to recent changes in psych/yaml/...
Files
Updated by hsbt (Hiroshi SHIBATA) over 2 years ago
Can you install libyaml-dev
package via apt?
Updated by hsbt (Hiroshi SHIBATA) over 2 years ago
- Related to Feature #18571: Removed the bundled sources from release package after Ruby 3.2 added
Updated by duerst (Martin Dürst) over 2 years ago
hsbt (Hiroshi SHIBATA) wrote in #note-1:
Can you install
libyaml-dev
package via apt?
Many thanks for your advice!
I did this. Unfortunately, it didn't help, the error is still the same.
I also tried ./configure --enable-load-relative --disable-install-doc
, but even this didn't help. The output does not include the word yaml
anywhere. Maybe some additional configuration is necessary?
I found a file at /usr/include/yaml.h
. I'm not sure this is the right one. But it definitely cannot be found by yaml/yaml.h
.
I have attached the file mkmf.log
from ext/psych
, maybe this helps.
Updated by duerst (Martin Dürst) over 2 years ago
I created and successfully compiled a completely new clone of Ruby. That had no problem finding the yaml.h
file. The corresponding mkmf.log
file from ext/psych
is attached.
The conclusion seems to be that when bundled sources were removed, there was no mechanism to trigger the right steps to fix whatever needed to be fixing in the Makefile or thereabouts.
I hope this can be fixed in future cases where bundled sources are removed.
Updated by duerst (Martin Dürst) over 2 years ago
I hoped https://github.com/ruby/ruby/commit/8e2a2ba0f9 (Merge psych master; Added files: ext/psych/extlibs; Modified files: ext/psych/extconf.rb; by @hsbt (Hiroshi SHIBATA)) might help with this. It didn't. But after I tried ./configure --enable-load-relative --disable-install-doc
, I got the following in the output:
duerst@Kloentalersee:~/14ruby$ make up; make
Already up to date.
Current branch master is up to date.
Latest commit hash = 8e2a2ba0f9
tool/config.guess already exists
tool/config.sub already exists
downloading for ext/fiddle/extlibs
.downloaded-cache/libffi-3.2.1.tar.gz already exists
checking md5 of .downloaded-cache/libffi-3.2.1.tar.gz ... OK
checking sha512 of .downloaded-cache/libffi-3.2.1.tar.gz ... OK
downloading for ext/psych/extlibs
.downloaded-cache/yaml-0.2.5.tar.gz already exists
checking rmd160 of .downloaded-cache/yaml-0.2.5.tar.gz ... OK
checking sha256 of .downloaded-cache/yaml-0.2.5.tar.gz ... OK
checking sha512 of .downloaded-cache/yaml-0.2.5.tar.gz ... OK
make[1]: Entering directory '/home/duerst/14ruby'
I haven't seen this before (but it could be easy to miss, because the output passes by very quickly). I'm just pasting it here because it could help diagnose this bug.
Updated by hsbt (Hiroshi SHIBATA) about 2 years ago
- Status changed from Open to Assigned
Updated by hsbt (Hiroshi SHIBATA) almost 2 years ago
- Status changed from Assigned to Feedback
@duerst (Martin Dürst) This issue may cause with your environment.