Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'make 2>&1' stops if directory has no 'grandparent ' #36

Open
monadnoc opened this issue Oct 28, 2018 · 0 comments
Open

'make 2>&1' stops if directory has no 'grandparent ' #36

monadnoc opened this issue Oct 28, 2018 · 0 comments

Comments

@monadnoc
Copy link

monadnoc commented Oct 28, 2018

On a fresh install of Rocks 7 with kernel, base, core, CentOs, Updates-CentOS (+ sge, hpc, and ganglia):
make 2>&1 to build a roll in the /root/ directory returns /opt/rocks/share/devel/src/roll/../../etc/Rules.mk:622: *** first argument to 'word' function must be greater than 0. Stop.

The offending line in the Rules.mk is part of the last one in this set

PATH.CHILD      = $(notdir $(CURDIR))
PATH.PARENTPATH = $(dir $(CURDIR))
PATH.PARENTLIST = $(subst /, ,$(dir $(CURDIR)))
PATH.PARENT     = $(word $(words $(PATH.PARENTLIST)), $(PATH.PARENTLIST))
PATH.GRANDPARENTLIST = $(subst $(PATH.PARENT),,$(PATH.PARENTLIST))
PATH.GRANDPARENT     = $(word $(words $(PATH.GRANDPARENTLIST)), $(PATH.GRANDPARENTLIST))

Is this rule necessary? Can it be conditioned such that if make is initiated in a folder without a grandparent or even in a directory where '/' itself is a grandparent (that is, any directory not nested twice from '/') , that it does not break the build?

This issue persists from Rocks 6 (except the line was 621 instead of 622 here). See this archived email chain. Credit to @rpwagner for the workaround

The workaround is to just always build in a directory two down from '/', but this fix is not obvious to a novice and the error can draw issues in other repos rather than here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant