Skip to content

PATH=$(PATH) in tests/Makefile causes problem in typical WSL environment #1195

@t-mat

Description

@t-mat

Describe the bug
make test doesn't work in typical WSL environment.

Expected behavior
make test works.

To Reproduce
As of today (Nov 28, 2022), we can reproduce this issue with the following commands in WSL environment.

$ cd
$ git clone https://github.com/lz4/lz4.git lz4-issue-path
$ cd lz4-issue-path/
$ git log -1
commit 8a31e6402df11c1bf8fbb1db3b29ec2c76fe6f26 (HEAD -> dev, origin/dev, origin/HEAD)
...
Date:   Wed Nov 23 16:15:10 2022 -0800
...

$ make test
make[1]: Entering directory '/home/wsluser/lz4-issue-path/tests'
make -C ../programs lz4 CFLAGS="-O3  -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wpointer-arith -Wstrict-aliasing=1 -g -DLZ4_DEBUG=1 "
make[2]: Entering directory '/home/wsluser/lz4-issue-path/programs'
make[2]: Leaving directory '/home/wsluser/lz4-issue-path/programs'
cc -O3  -Wall -Wextra -Wundef -Wcast-qual -Wcast-align -Wshadow -Wswitch-enum -Wdeclaration-after-statement -Wstrict-prototypes -Wpointer-arith -Wstrict-aliasing=1 -g -DLZ4_DEBUG=1  -I../lib -I../programs -DXXH_NAMESPACE=LZ4_  -I../programs ../programs/datagen.c datagencli.c -o datagen
ln -sf ../programs/lz4 ../programs/unlz4
ln -sf ../programs/lz4 ../programs/lz4cat

 ---- test lz4 basic compression/decompression ----
PATH=../programs:...:/mnt/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:...
/bin/sh: 1: Syntax error: "(" unexpected
make[1]: *** [Makefile:241: test-lz4-basic] Error 2

System (please complete the following information):

  • OS: Windows 11, WSL2
  • Version 21H2 (22000.1219)
  • Compiler gcc (gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0)
  • Build System Makefile with make (GNU Make 4.3)

I think this error is caused by (space, 0x20) or ( (parentheses, 0x28), in $(PATH).

PATH=$(PATH) ./test-x.sh

is expanded as

PATH=path1:path2:/mnt/c/Program Files (x86)/path3 ./test-x.sh

and it seems first (space) is treated as a command separator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions