Project

General

Profile

Actions

Bug #15154

closed

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

Added by kernigh (George Koehler) about 6 years ago. Updated almost 6 years ago.

Status:
Closed
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
Actions #1

Updated by nobu (Nobuyoshi Nakada) almost 6 years ago

  • Status changed from Open to Closed

Applied in changeset trunk|r66423.


Workaround for OpenBSD make

From: kernigh (George Koehler)

Actions

Also available in: Atom PDF

Like0
Like0