Xmake Version
xmake v3.0.4+master.b3a2dba93
Operating System Version and Architecture
Linux 1f76ee561333 6.12.17-powerpc64le-64k #1 SMP Debian 6.12.17-1 (2025-03-01) ppc64le GNU/Linux
Describe Bug
If --project begins with a / but has . or .. components, then includes()-ed target()s will fail to find their files.
Given the following four files in /tmp/xmake-test:
s/s.cc:
int s(int v) { return v; }
s/xmake.lua:
target("s")
set_default(false)
set_kind("static")
add_files("s.cc")
b/b.cc:
int s(int);
int main() { return s(42); }
b/xmake.lua:
includes("../s")
target("b")
set_default(true)
set_kind("binary")
add_deps("s")
add_files("b.cc")
and the following shell function to test things...
function test() {
(rm -rf _ && mkdir _ && cd _; xmake config -v -D --project="$1" && xmake build -v -D)
}
then these work to build the b target() binary:
test /tmp/xmake-test/b -- absolute project path
(cd /tmp/xmake-test; test ../b)" -- relative (to /tmp/xmake-test/_) project path
(cd /tmp/xmake-test; test .././b)" -- similarly
(cd /tmp/xmake-test; test ../../xmake-test/b)" -- similarly
but these don't, because the final link step can't find the definition of s():
test "/tmp/xmake-test/./b"; xmake warns:
warning: /tmp/xmake-test/s/xmake.lua:4: cannot match add_files("../../s/s.cc") in target(s)
test "/tmp/xmake-test/_/../b"; xmake warns:
warning: /tmp/xmake-test/s/xmake.lua:4: cannot match add_files("../../../s/s.cc") in target(s)
Expected Behavior
xmake should treat all valid ways of referring to a --project path equivalently.
Project Configuration
See above.
Additional Information and Error Logs
See above.
Xmake Version
xmake v3.0.4+master.b3a2dba93
Operating System Version and Architecture
Linux 1f76ee561333 6.12.17-powerpc64le-64k #1 SMP Debian 6.12.17-1 (2025-03-01) ppc64le GNU/Linux
Describe Bug
If
--projectbegins with a/but has.or..components, thenincludes()-edtarget()s will fail to find their files.Given the following four files in
/tmp/xmake-test:s/s.cc:s/xmake.lua:b/b.cc:b/xmake.lua:and the following shell function to test things...
then these work to build the
btarget()binary:test /tmp/xmake-test/b-- absolute project path(cd /tmp/xmake-test; test ../b)"-- relative (to/tmp/xmake-test/_) project path(cd /tmp/xmake-test; test .././b)"-- similarly(cd /tmp/xmake-test; test ../../xmake-test/b)"-- similarlybut these don't, because the final link step can't find the definition of
s():test "/tmp/xmake-test/./b";xmakewarns:warning: /tmp/xmake-test/s/xmake.lua:4: cannot match add_files("../../s/s.cc") in target(s)test "/tmp/xmake-test/_/../b";xmakewarns:warning: /tmp/xmake-test/s/xmake.lua:4: cannot match add_files("../../../s/s.cc") in target(s)Expected Behavior
xmakeshould treat all valid ways of referring to a--projectpath equivalently.Project Configuration
See above.
Additional Information and Error Logs
See above.