-
Notifications
You must be signed in to change notification settings - Fork 147
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
Request: option to specify alternative path to elpa directory #31
Comments
So:
Maybe we should add a |
How is |
What I mean is that you can add a
But let's skip that for now. An option is a great idea. Do you have any name suggestion? :) |
I'd use --package-dir or --pkg-dir. |
Actually, the variable that controls this is called |
@lunaryorn That would mean that you have to run |
@rejeep Probably this shouldn't be the default anway. I do not think that this is actually necessary for most packages, since the byte code should be fairly compatible within one Emacs series. I have been testing Flycheck against 24.2 and snapshot builds from a single elpa directory without troubles. If the behavior is explicitly enabled with a special directive (such as |
Agreed, all in favor say ayyy!? |
@rejeep Agreed. |
You should. Byte-compiled files are not compatible for different Emacs versions. Incompatibility could happen even if you change some Emacs Lisp macros, without changing Emacs core in C. So, there is absolutely no guarantee that packages compiled by Emacs I suggested to add an option because I thought @rejeep did not like the idea due to the discussion in #3. But yes, I think versioning elpa directory by default is better. FYI, similar Python tool uses directory |
@tkf There is no guarantee for sure, but practially there is no problem either, if you stay within the same series. Within a major version, Emacs Lisp macros usually don't change in backwards incompatible ways. They can't really, or every user's compiled init file would break. As said, I didn't experience any troubles. If you're in doubt, you can also just delete That said, I like the directory scheme you proposed, as long as it is optional. |
I had trouble when updating from 23 to 24 and I helped users suffered the same problem. If there could be a trouble, we should avoid it. It is for test suite. If wasting HDD solves problem then we should waste HDD. I don't want to waste my time for debugging errors because carton mixing versions and then notice that I should just reinstall everything. I find no reason to use |
@tkf Like I said, within a major version there is usually no trouble. Even the Emacs developers themselves do not expect trouble, or they would have used a version-dependent default for Many users, me including, use Carton to manage packages in Using versioned package directories by default breaks this use case and forces users to explicitly configure a version specific |
I wasn't arguing that we should have versioned Does carton know if it is working on |
@tkf I prefer an explicit solution over an implicit one. I think we should refuse the temptation to guess the user's intent. That's bound to break sooner or later. What stands against an explicit directive? Even if we try to guess, we must provide one to allow users to explicitly override our guess in case we guess wrong. |
In development, using the same Also, having different structure under But anyway, having it optional or not is not a big deal at all. Even having just --package-user-dir is OK for me. I think I wrote my opinion above in order to make carton interface more concise. I am happy as long as there is a way to differentiate the location of package-user-dir. |
@tkf I know, but I am not sure whether we can safely differentiate between the |
I don't see why not always use I'm not sure we should allow the whole path to be configured, that would only be confusing. What could be configured though is the base directory, which in this case would be But I don't see why anyone would ever want to change the base dir? Not a good one anyways. Maybe we should store everything under the Carton directory instead, so:
|
I think @lunaryorn's point is that it is better to keep it as same as what package.el does by default. But I'd say versioned
You mean under |
Yeah, better than default. On my OSX machine, Emacs 22.1 is installed by default, but I of course install Emacs 24. That would allow me to use both if I wanted. @lunaryorn What do you think?
Multiple repos? That's what branching is for! But don't worry, I have no plans to switch to that approach, just mentioned it :) |
@rejeep Currently, Carton works well for I don't mind such a change, for I find no difficulties in changing But I came to think that you are both right. We should choose not to care now. Just using versioned directories by default everywhere keeps the code base simpler, and the user interface more predictable. Moreover, I like the directory hierarchy you proposed. Putting all Carton-related data into a So let's just go for versioned directories. But we must document this changes, and we really should provide example code in README that explains how to properly configure |
I don't follow. Why is there any difference between an Emacs package and the local Emacs installation? |
@rejeep I do not start my my Emacs through Carton, i.e. via |
I guess @lunaryorn installed carton via package.el? |
Re .carton: I think what @rejeep has in mind is
I find having local clones is better approach when I am working on more than three branches. Anyway, I think you should not assume people's workflow. Having local clones is valid usecae and one of the strength of DVCS such as git. |
@tkf I agree. A global Carton directory is just a bad idea, for any workflow. |
Yeah, I agree too. You mean like this? https://github.com/rejeep/emacs/blob/master/init.el#L32-L33 |
@rejeep So, in your setting, you called |
@tkf Exactly. For This is not a show stopper, but it definitely must be documented and explained in the README. |
Yeah, for sure. I think it's worth it! |
Does it mean all Carton users must have something like (setq package-user-dir
(locate-user-emacs-file
(format "elpa/%d.%d" emacs-major-version emacs-minor-version))) in their setting? Sounds bit sad. Or can we do this other way around? Let user install carton in |
Re-pinging @lunaryorn and @rejeep. I see two options to use carton in init.el. What do you think? Which one is better?
|
Or start Emacs with |
You mean |
Yes, that's what I'm thinking. We could add that as an option to the README at least. |
I think |
Sounds like a good idea! |
@tkf @rejeep I mean no offense, but this is just a bloody stupid idea. Do you seriously expect me to type This way to start Emacs is ridiculously long, messes with the working directory and can only be used from the terminal. It breaks, if someone tries to give a relative path name to Emacs, or wants to start Emacs via the graphical desktop environment. If we are to use versioned directories in Carton by default, we must make plain |
@lunaryorn You could make an alias. But this is just an alternative method.
Agreed. Maybe I misunderstood you @tkf. When we merge this change to master, everything should be working. What I thought you meant @tkf was that we make This feature will include a DSL change for people using Carton in Emacs today and we only want them to migrate once, no twice. |
For |
What I meant by
At [1], Other idea is to add this in init.el: If we go to |
That's not too bad, actually. We could also do:
Right, the only thing affected are the users. |
The changes to Carton are pretty straight forward, so I'm not that worried that the code won't work. But before we merge to master we first need to update the README. I'm also thinking about deprecation. If we merge #40 right now it will break on a lot of Emacs users machines. I'm not sure how to best go about this. We need a way to notify users and not break before they have migrated. |
How about doing this when changing the project name? We can just warn people that the project is updated and the configuration is a little bit different. |
Yes. I think we should create a branch ( |
v0.4-wip sounds good. Here is the new README: https://github.com/rejeep/carton/tree/versioned#local-emacs-installation (diff: 1aa3ce7) |
Nice. I made a minor document comment on the PR. I created an issue for v0.4 (see #42). If you can think of anything else, just add it to the issue, if you can edit? Otherwise, comment and I will add it. So, now you could create the |
Thinking about the path, maybe |
@tkf I don't mind that. |
@tkf Good idea. |
... or environment variable, if it is easier.
If we have this, we can run test with multiple Emacs versions in parallel.
The text was updated successfully, but these errors were encountered: