Skip to contentSkip to conversation

linux-next: build warning after merge of the mm tree

DISCUSSION Stephen Rothwell 3 participants 4 messages Mar 13, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the mm tree, today's linux-next build (powerpc allyesconfig) produced this warning:

Use of uninitialized value $ENV{"abs_srctree"} in concatenation (.) or string at /home/sfr/next/next/lib/build_OID_registry line 38.

Introduced by commit

325f7b0aaea6 ("lib/build_OID_registry: Don't mention the full path of the script in output")

from the mm-nonmm-unstable branch of the mm tree.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 5 lines · Stephen Rothwell

Hi all,

After merging the mm tree, today's linux-next build (powerpc allyesconfig) produced this warning:

Quoted 7 lines

Use of uninitialized value $ENV{"abs_srctree"} in concatenation (.) or string at /home/sfr/next/next/lib/build_OID_registry line 38.

Introduced by commit

325f7b0aaea6 ("lib/build_OID_registry: Don't mention the full path of the script in output")

from the mm-nonmm-unstable branch of the mm tree.

Actually the warning doesn't happen on 325f7b0aaea6. The commit is only problematic in combination with commit

e2bad142bb3d ("kbuild: unexport abs_srctree and abs_objtree")

. This commit suggests to use $(abspath ) or $(realpath ) instead, but I fail to apply this suggestion here.

Obviously

Makefile +1 -1
index 5e09b53b4850..f73a73a125e0 100644
@@ -39,7 +39,7 @@ __all:
 # prepare rule.
 
 this-makefile := $(lastword $(MAKEFILE_LIST))
-abs_srctree := $(realpath $(dir $(this-makefile)))
+export abs_srctree := $(realpath $(dir $(this-makefile)))
 abs_objtree := $(CURDIR)
 
 ifneq ($(sub_make_done),1)

would help.

Any ideas how to properly handle that? Would the export be ok?

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#2 lore raw
Quoted 39 lines · Uwe Kleine-König
Quoted 5 lines · Stephen Rothwell

Hi all,

After merging the mm tree, today's linux-next build (powerpc allyesconfig) produced this warning:

Quoted 7 lines

Use of uninitialized value $ENV{"abs_srctree"} in concatenation (.) or string at /home/sfr/next/next/lib/build_OID_registry line 38.

Introduced by commit

325f7b0aaea6 ("lib/build_OID_registry: Don't mention the full path of the script in output")

from the mm-nonmm-unstable branch of the mm tree.

Actually the warning doesn't happen on 325f7b0aaea6. The commit is only problematic in combination with commit

e2bad142bb3d ("kbuild: unexport abs_srctree and abs_objtree")

. This commit suggests to use $(abspath ) or $(realpath ) instead, but I fail to apply this suggestion here.

Obviously

Makefile +1 -1
index 5e09b53b4850..f73a73a125e0 100644
@@ -39,7 +39,7 @@ __all:
 # prepare rule.
 
 this-makefile := $(lastword $(MAKEFILE_LIST))
-abs_srctree := $(realpath $(dir $(this-makefile)))
+export abs_srctree := $(realpath $(dir $(this-makefile)))
 abs_objtree := $(CURDIR)
 
 ifneq ($(sub_make_done),1)
Quoted 6 lines

would help.

Any ideas how to properly handle that? Would the export be ok?

Best regards
Uwe

Oh well, you are making a lot of effort just for a C comment line.

It is trivial to achieve the equivalent thing.

use Cwd qw(abs_path);

my $abs_srctree = abs_path($ENV{'srctree'});

I would just print a fixed string, as this is not important.

print C_FILE " * Automatically generated by build_OID_registry. Do not edit\n";

OR

print C_FILE " * Automatically generated. Do not edit\n";

Signature · 2 lines
Best Regards
Masahiro Yamada
#3 lore raw

Hello Masahiro,

Quoted 39 lines · Masahiro Yamada
Quoted 37 lines · Uwe Kleine-König
Quoted 5 lines · Stephen Rothwell

Hi all,

After merging the mm tree, today's linux-next build (powerpc allyesconfig) produced this warning:

Quoted 7 lines

Use of uninitialized value $ENV{"abs_srctree"} in concatenation (.) or string at /home/sfr/next/next/lib/build_OID_registry line 38.

Introduced by commit

325f7b0aaea6 ("lib/build_OID_registry: Don't mention the full path of the script in output")

from the mm-nonmm-unstable branch of the mm tree.

Actually the warning doesn't happen on 325f7b0aaea6. The commit is only problematic in combination with commit

e2bad142bb3d ("kbuild: unexport abs_srctree and abs_objtree")

. This commit suggests to use $(abspath ) or $(realpath ) instead, but I fail to apply this suggestion here.

Obviously

Makefile +1 -1
index 5e09b53b4850..f73a73a125e0 100644
@@ -39,7 +39,7 @@ __all:
 # prepare rule.
 
 this-makefile := $(lastword $(MAKEFILE_LIST))
-abs_srctree := $(realpath $(dir $(this-makefile)))
+export abs_srctree := $(realpath $(dir $(this-makefile)))
 abs_objtree := $(CURDIR)
 
Quoted 7 lines
Quoted 5 lines
Makefile +0 -0
 ifneq ($(sub_make_done),1)

would help.

Any ideas how to properly handle that? Would the export be ok?

Oh well, you are making a lot of effort just for a C comment line.

I don't care much either. Given that now I know how to somewhat keep the originally intended information, the effort between a fixed string and a dynamically generated one isn't very relevant.

Quoted 3 lines

use Cwd qw(abs_path);

my $abs_srctree = abs_path($ENV{'srctree'});

Ah, I missed that srctree is an exported variable. Thanks, will prepare a v2. akpm already dropped my initial patch from his queue.

Thanks for your input.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |