-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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 -MF -MP and -MT in line with gcc dependency tracking. #3087
Conversation
Hmm, did I cause that test failure? I get the same failure locally but it's not clear to me how I could have caused it. /edit: Also, maybe |
Oh, no, Please no more options... Who's gonna to maintain them? It's already plenty of options so that even basic issues take forever to clarify and test (this is not GCC with its zillion active contributors). In it's current state I don't think Less can afford "try to cover all of this" approach. So simple revert of #2830 would be enough.
No, it's the v3 codebase itself (it needs a lot of polishing and clean-up yet, specifically its various build and test stuff). |
I found it remarkably simple to implement these options. I don't think they add a big maintenance burden. All the dependency tracking related options are confined to two functions: In it's current state Telling users to post process the output with sed, tr, or awk is pushing the problem onto users who will inevitably make much more shaky solutions. And thanks to gcc these flags have a solid meaning, so there shouldn't be any confusion on their intended purpose either. |
I think a "make" build of Less with make-specific options would be better suited for an independent repo that imports the Less engine as a dependency. The purpose of The additional benefit of importing Less.js as a dependency is that your tool can maintain its own documentation. And the tool can still go onto the list of Less-related tools on the lesscss.org site. |
Then what is it's purpose? As I see it, As for the complexity of the options:
Only It feels to me you're really overestimating how much complexity this adds versus the gained benefit for the users. However, if you really don't like command line options, we could do it slightly differently. We could drop the Or if even that is to much we could drop all the new flags, don't add optional arguments, but still write the phony rules. Personally, I prefer to have the flags as gcc defines them because they are well known, but the most important thing to me is usable dependency tracking. As for |
It's does not matter how many code a new option require... It's just 2 options -> 2^2 = 4 behaviour variants, 5 options -> 2^5 = 32 and so on... (Not counting documentation etc.). Sometimes they are unavoidable (you don't have too much choice if you must do /arm or /sparc), sometimes they aren't. I would immediately throw in 1000 new cool options if I wouldn't know there's nobody to fix it it's got screwed. |
I do think that the risk of breakage is low because their usage is confined to dependency generation. I could even wrap it in a way that all the code is neatly together in a separate object. Additionally, I'm willing to jump in if they do cause problems. I can be tagged on github and my email address is publicly available on my github profile. But like I said, my main goal is to improve dependency tracking for That leaves the question if |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This PR does a few things:
--no-css
flag. By default--depends
now outputs CSS again. This flag also has the benefit that you can now uselessc
as a syntax/import checker without generating any output (css or dependencies).-MP --depends-phony
,-MT --depends-target
,-MF --depends-file
in line with gcc flags (all of these imply-M
). These flags allow much more efficient integration withmake
.-MP
or--depends-phony
adds phony rules for all dependencies. This preventsmake
from generating errors when a dependency is deleted.Someone also wrote a blog article on post-processing the dependency information to achieve the same result using a pipe of
sed
,tr
andsed
[1]. Personally I've been using anawk
script so far. I hope that shows that there is actual demand for this feature.[1] https://www.thumbtack.com/engineering/makefiles-for-less-and-css/
Example output:
-MT
or--depends-target
overwrite the target of the main rule in the dependency file. This can be useful when the output of lessc is later moved, or if the generated CSS output goes to stdout. Example output:-MF
or--depends-file
writes the dependecy information to a file instead of stdout. Together with-MT
this enables dependency tracking even when CSS output goes to stdout.