-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
Feature Suggestion: Tupfile.base #132
Comments
I try to encourage people to use tup and adding a new step other than just typing My suggestion is to not only add support for a new file (I like
Just a thought. |
On Wed, Jul 31, 2013 at 1:37 PM, Pat Pannuto notifications@github.comwrote:
One question I have is what would the behavior be if multiple Tupfile.ini ie: super/Tupfile.ini If there is no .tup directory, I think we want to make it at super/.tup -Mike |
On Wed, Jul 31, 2013 at 7:22 PM, Brad Campbell notifications@github.comwrote:
-Mike |
I don't understand why this is so problematic that it requires adding a new file? You've already got '.tup', 'Tupfile', and 'Tuprules.tup' at the root directory. Adding a fourth 'tup' related item to a project's root is a little excessive, don't you think? |
No, in this case you do not have .tup yet, that is the whole point of
|
My current plan for implementation is to build on the existing option mechanism. Specifically, to create a dynamic array of As these are run-time configurations and orthogonal to the build, I believe they should not be tracked in tup's database (this also alleviates the chicken-egg problem for the first run). As these options potentially change the behavior of tup when executing, I believe the appropriate place to hook this scan is As for nested .ini files, my solution would be to have a configuration "root" variable that defaults to false. When parsing the .ini's, if tup encounters This model alleviates some potential confusion for nested .ini's by making the marking of the root directory explicit and opens them to more general directory-sensitive configuration (which is really the only reason I could imagine nesting .ini files). Thoughts? |
It was brought to my attention that just the The plans w.r.t. leveraging the options mechanism stand, but the new plan for directory search would be to go until a As a final detail, if the shallowest .ini file didn't have
|
On Thu, Aug 1, 2013 at 6:30 PM, Pat Pannuto notifications@github.comwrote:
Thanks! |
I've talked to Pat about this and it seems that Tupfile.ini folds in nicely with the existing option infrastructure and option file hierarchy. Tupfile.ini would be added to the search order for tup options and would add repository specific options to the existing user specific options. This could potentially be useful for some projects to set, for instance, Once there is a repo specific way to add options, setting the root location with Also, making Tupfile.ini part of the options system allows for other repository specific options to be included with the repository. A very useful one would be default variants so that users don't have to run |
Brad covered the option point pretty well, as for the 'root' thing, you are I have this mostly implemented, but will be traveling much of this week.
|
I think we can close this, given the #133 has been merged. |
Why did we need an |
That's a good idea, though you may not have a Tupfile at the root of your project if you don't build anything there. |
@qix, Tupfile.ini was always part of a greater vision. Currently there is nowhere to store project-specific configuration for tup. Tupfile.ini was intended to be the home for that. See #144 for an old implementation of this as well as the beginning of this thread for some of the motivation. As for recursing for Tupfiles, that wouldn't work in all scenarios. Easy example, we have some projects that use git submodules where recursing all the way to the "most root" Tupfile would not work correctly. At the same time, something like a |
@ppannuto recurse until a Specifically saying where a parent Tupfile lives breaks the parent-child relationship, and makes no sense. Submodules that build with tup shouldn't have to know anything about their parent. As well, never said If you don't have a Tupfile at the root of your project, that's when you should run In all honesty this is what I expected Tup to do in the first place. |
I think we have a miscommunication somewhere. Tup does recurse right now, until it finds a Tupfile.ini indicating the root of the project it should build. The point is that you cannot correctly stop at the first Tupfile (plenty of Tupfiles in subdirectories of projects) or the "last" Tupfile (submodule example) you find. W.r.t. parent-child, I think we agree. The current .ini system stops a tup call from a child submodule from recursing into the parent. As for Tupfile.ini being another file, think of it more as a partially implemented feature perhaps? There was an intention to use the .ini directives. The explicit goal was to eliminate the need to ever run |
First thing, pointing out that cmake doesn't just compile to make ;) Just being fair here. There's a reason why CMake exists aside from Make. In cases that don't need a Tupfile.ini, though, why should I still have to type It doesn't take long at all to do repeated |
If you have this file structure:
Tup allows you to run Now, someone could realize this was an issue and fix it if tup prints what it's doing and the person catches the mistake. However, if one wants to ensure one's tool doesn't get adoption and use by the community one makes it hard to use from the first command. If one wants people to actually give it a chance, one makes it as foolproof as possible. I think the current solution is the best approach for making tup easy to use. |
Eh? Running
|
What is "the only viable configuration file" if not Tupfile.ini? On Thu, Dec 17, 2015 at 10:02 PM Josh Junon notifications@github.com
|
Recall, this is dealing with the case where the .tup directory does not yet On Thu, Dec 17, 2015 at 10:03 PM Pat Pannuto pat.pannuto@gmail.com wrote:
|
@ppannuto A I don't know how I can make that more clear. |
Expanding on @bradjc's case:
You type |
Find the root-most |
Tup currently / soon will support a significant number of automatically generated files, e.g. Tup*{,.lua,.py}. Why not just treat any valid tup-specific file as a root marker, and define a precedence order? On somewhat of a side note, but still relevant to what's decided. If Tupfile.ini is also intended as a root marker, shouldn't |
@erikbrinkman No, because that introduces more fluff into the repository. Again, having two build files ( I'd go so far as to vote to have |
@Qix- I assume you're responding to having The reason why I included the suggestion to create a As for for removing I can only assume that you agree with generally searching for any related tup-specific file instead of just |
I've found it a minor weakness / annoyance of tup that the first time I check out a copy of a repo, I have to remember to run
tup init
before I cantup upd
. There's a few challenges with running init automatically, the most obvious of which is knowing where the root of the project directory is (assuming it's the current directory feels risky).My proposal is the addition of a new file:
Tupfile.base
(name flexible, maybeTupefile.root
,Tupfile.ini
?)This file would be placed in the root directory of the project to identify it. In addition to identifying the root, I would propose a simple syntax (currently thinking .ini-style syntax) for expressing things such as default variants for the project.
In my current mental model, this file is parsed if and only if tup cannot find a .tup directory. More specifically, as
tup upd
begins enumerating directories searching for the .tup directory, it also searches for Tupfile.base (after looking for .tup). If a Tupfile.base is found, the requisite commands are run to initialize things and then tup continues on withupd
.I'm willing to tackle implementing this feature, but I'd like some input on the design first. Is this a good / desirable idea? Do people have comments / suggestions for improving it?
The text was updated successfully, but these errors were encountered: