-
Notifications
You must be signed in to change notification settings - Fork 12
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
Add symlinking ability to lbuild #45
Comments
Yeah, this came up a few times already, there's already a branch for that: https://github.com/modm-io/lbuild/tree/feature/symlink I hesitate to merge this, because it trains people to change the generated files. That's fine as long as you know which files are copied/linked and which are generated. The time will come when you make changes to a generated file and it gets overwritten. Is there a use-case for exposing symlinking via |
Hm, on the other hand, there are a few issues open on tracking the content of the generated files (with hashing) and to generate warnings about what files were modified and are about to be overwritten: like #33. With that I would be more comfortable to add this features. |
Let me know if this makes your life easier, and i'll just merge it with a big fat warning.
|
Is this possible on per-module basis? |
Something in lines of: def init(module):
# ...
module.symlink_without_copy = True
# ... This is false by default (if not with |
Hm, definitely not a fan of changing the module API, I was thinking more of adding module names via Can you explain the use-case for this? Is there an issue with symlinking all modules? Why just a few modules? |
I thought of opt-in approach for debug purposes only. |
I tried enabling symlinking in my
|
Is this an issue with using symlinks with GCC on Windows/NTFS? |
Mixing copied and templated code does not work. |
I can reproduce this, why is GCC following symlinks now? I'm still on ARM GCC v8.3.1. Is there a flag we can pass to GCC? |
Ok, so it follows the symlink to the real file, which is in the modm repository, but of course the include file isn't there because it's a template |
So… this issue is dead, right? Or did you find any ways that you can make this work for GCC? |
Wait. files = [
env.File(r"../../../modm/src/modm/architecture/interface/can.cpp"),
env.File(r"../../../modm/src/modm/architecture/interface/can_message.cpp"),
env.File(r"../../../modm/src/modm/debug/error_report.cpp"),
env.File(r"../../../modm/src/modm/debug/logger/hosted/default_style.cpp"),
env.File(r"../../../modm/src/modm/driver/io/terminal.cpp"),
env.File(r"../../../modm/src/modm/io/iostream.cpp"),
env.File(r"src/modm/io/iostream_printf.cpp"),
env.File(r"../../../modm/src/modm/math/utils/bit_operation.cpp"),
env.File(r"../../../modm/src/modm/math/utils/pc/operator.cpp"),
env.File(r"src/modm/platform/core/assert.cpp"),
env.File(r"src/modm/platform/core/clock.cpp"),
env.File(r"../../../modm/src/modm/platform/core/hosted/memory.cpp"),
env.File(r"../../../modm/src/modm/utils/dummy.cpp"),
] The |
What can be different from your setup?
|
And this is the real culprit ( def reloutpath(self, path, relative=None):
# ....
return os.path.relpath(os.path.realpath(path), os.path.realpath(relative)) which is called from here in modm: env.template("resources/SConscript.in", "SConscript",
filters={"flags_format": flags_format,
"relocate": lambda p: env.relative_outpath(p, repo)}) which was called from template: env.File(r"{{ file | relocate | modm.windowsify(escape_level=0) }}"), |
So symlinks are actually a viable solution, if this issue with relocate can be somehow resolved in |
Oh, that's bad! I don't know why I used realpath there, this may not be intended behavior. |
I fixed that issue in the lbuild branch and this fixes compilation for me! So I'll open a PR with the feature. |
I'm developing library.
I'd like to have ability to symlink files instead of copying for debug. Something in lines of:
I can achieve this behaviour using the following script, but it's way too clunky:
The text was updated successfully, but these errors were encountered: