Closed tinygiant98 closed 2 years ago
After some debugging, looks like it's not a pathing issue. Will report back ...
So it appears it's sort of a pathing issue. In options.nim
, changing line 406 from:
of "exclude": target.excludes.add(e.value)
to
of "exclude": target.excludes.add(replace(e.value.absolutePath, '\\', '/'))
solves the issue. Not sure why and I'm wondering if this is a windows-only issue versus a problem across all systems.
Also, not sure what repercussions that change would have on relative pathing within the nasher project folder.
This is not a Windows-only issue. The problem lies in walkSourceFiles
in shared.nim
, since walkGlobs
returns absolute paths.
nasher should always set the current directory to the project root. I doubt this change would create any problems.
Sorry I didn't move on this sooner. I've been having trouble getting it to match exclude
directives that have glob characters in them. It doesn't look like the **/*
syntax works. I've also tried converting the paths yielded by walkGlob
to relative paths with the same issue.
I think the way to resolve this would be walk the exclude
patterns, generate a list of files to be excluded, and then check if each included file is in that list.
Could you try the fix-issue-90
branch and see if it works for you? It includes commit 18abd3a, which allows listing of the source files, so that should make it easier to test.
Yup, but won't be able to for a day or two. Thanks!
@tinygiant98, have you been able to test this yet?
I've recently modified my projects to use the nwn-core-framework module as a base and use nasher's ability to exclude files to override the files I don't want to use (such as
core_c_config.nss
, which are project-specific. Innasher.cfg
, I generally include the framework files like this:and it works fine, but when I want to exclude a specific file, like this, it doesn't exclude that file. I'll still get a "multiple locations" prompt during install/pack operations.
Using an absolute path does make this methodology work, as shown here:
Suggested fix ... modify pathing to use absolute paths instead of relative paths when relative paths are provided. I haven't gotten into the code to see where this should be done, but I will as soon as I have a chance.