Feature/build lib - #1801
Conversation
|
so the way I have the library set up is a I can't say I'm a fan of nimble recreating the output logic that already exists in nim - it would be better if it didn't do that and just relied on what nim does (which also handles things like conflicting directory names etc) |
|
Hmmm, I thought you wanted If you're OK with |
the problem here is that nimble overrides the name that nim chooses by default - if nimble build did not mess up the name with its The broader issue here is that The open question is whether there's a |
100% agree, this is why I removed
I'm totally with you on that. To me,
I think if you can override |
there's a contract to follow here though - ie |
Yeah, I missed that... Well, at least now I understand why the builtin commands are not oevrridable yet, makes sense. |
|
@moigagoo You forgot to import your new test file in tester.nim |
Sorry, added it.
Well, I did try running various commands, apart from the tests of course. I couldn't spot the difference in behavior apart from when I actually do change something that affects the output file name, i.e.
|
|
The more I think about this, the more I come to the conclusion that if we want to support libs, I think we should introduce a first-class lib target variable like I mentioned before in the issue. Without explicit metadata, Nimble cannot reliably know ahead of compilation whether a target is an executable or a library. We could try to infer that by evaluating the compiler configuration or inspecting its output, but that adds complexity and potentially another compiler invocation. It also leaves questions around installation and executable symlinks (i.e how do we know if we should produce a symlink?) This is what I meant by considering how the change interacts with the other actions, although I haven’t mapped out every implication yet. Nimble has accumulated quite a few edge cases where a feature initially addressed one command and later required several follow-up patches to fit with everything else—develop is a good example. I’d like us to avoid repeating that pattern and make sure this fits coherently with the existing model from the beginning. |
|
@jmgomez thanks for the explanation. I'm happily passing the task to you as we discussed. |
No description provided.