Project

General

Profile

Bug #15154

OpenBSD make(1) can't build node_name.inc

Added by kernigh (George Koehler) about 1 year ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 2.6.0dev (2018-09-24 trunk 64826) [x86_64-openbsd6.3]
[ruby-core:89151]

Description

The make(1) command in OpenBSD can't build node_name.inc of Ruby trunk in an out-of-source build. GNU make works. OpenBSD make misses node.h in the source directory, and tries to use node.h in the build directory:

$ gmake
...
$ rm node_name.inc
$ make node_name.inc
/bin/sh: cannot open node.h: No such file or directory
*** Error 1 in /home/kernigh/park/ruby-build (Makefile:1627 'node_name.inc': @ r
uby25 --disable=gems -n ../ruby/tool/node_name.rb < node.h >...)

This seems to be a quirk or bug of OpenBSD make. Other make tools would search VPATH for node.h. OpenBSD make doesn't search VPATH because node.h depends on another file. Makefile shows node.h depending on node_name.rb:

node.h: $(srcdir)/tool/node_name.rb
# This dependency is not really correct, but $? should not include
# node_name.rb in the following recipe.
node_name.inc: node.h
        $(ECHO) generating $@
        $(Q) $(BASERUBY) -n $(srcdir)/tool/node_name.rb < $? > $@

To fix the build with OpenBSD make, I edit the recipe in common.mk, to use $(srcdir)/node.h instead of $?. I attach a git diff of this fix.

The quirk or bug of OpenBSD make might come from src/usr.bin/make/suff.c, where SuffFindNormalDeps() checks OP_NOP(gn->type), so it searches VPATH only if the file has no prerequisites, is "not on the lhs of a dependency operator". Other BSDs use NetBSD bmake, where SuffFindNormalDeps() removes this check, so OpenBSD make might be the only make tool with this issue.

I run OpenBSD 6.3 on amd64. I have OpenBSD packages of autoconf%2.69 bison git gmp metaauto ruby%2.5. I did export AUTOCONF_VERSION=2.69 for metaauto. I put the git checkout in ~/park/ruby, and I configured Ruby in ~/park/ruby-build using

../ruby/configure --prefix=$HOME/prefix --with-baseruby=ruby25 \
    CC=cc CXX=c++ CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib

Files

ruby-node-openbsd.diff (816 Bytes) ruby-node-openbsd.diff fix for OpenBSD make kernigh (George Koehler), 09/25/2018 03:01 AM

Associated revisions

Revision 6da6492d
Added by nobu (Nobuyoshi Nakada) 11 months ago

Workaround for OpenBSD make

  • common.mk: read from node.h in the source directly, without VPATH. [ruby-core:89151] [Bug #15154]

From: kernigh (George Koehler) xkernigh@netscape.net

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 66423
Added by nobu (Nobuyoshi Nakada) 11 months ago

Workaround for OpenBSD make

  • common.mk: read from node.h in the source directly, without VPATH. [ruby-core:89151] [Bug #15154]

From: kernigh (George Koehler) xkernigh@netscape.net

Revision 66423
Added by nobu (Nobuyoshi Nakada) 11 months ago

Workaround for OpenBSD make

  • common.mk: read from node.h in the source directly, without VPATH. [ruby-core:89151] [Bug #15154]

From: kernigh (George Koehler) xkernigh@netscape.net

History

#1

Updated by nobu (Nobuyoshi Nakada) 11 months ago

  • Status changed from Open to Closed

Applied in changeset trunk|r66423.


Workaround for OpenBSD make

  • common.mk: read from node.h in the source directly, without VPATH. [ruby-core:89151] [Bug #15154]

From: kernigh (George Koehler) xkernigh@netscape.net

Also available in: Atom PDF