-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Share installed packages among multiple users #6872
Conversation
Created dotspacemacs-use-shared-packages user option, so that if it is set to non-nil, then directories listed in package-directory-list are also searched for installed packages in addition to package-user-dir. Site administrator can then install packages in one or more of the directories in package-directory-list so that all users at the site can share the same installed packages without each user having to install them. This change has no impact unless dotspacemacs-use-shared-packages is explicitly changed to non-nil from the default value of nil.
This is an update of PR #5464 which is now obsolete. |
I support the idea, but there must be a better way than this, no? AFAIK Also, I'm not sure why change |
(dir (car (directory-files elpa-dir 'full pkg-match)))) | ||
(when dir (file-name-as-directory dir)))))) | ||
"Return the installed directory of PKG. Return `nil' if not found." | ||
(let ((directories (cons package-user-dir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The result of this cons
is not a list. I think you want append
instead. Example from IELM session:
ELISP> (cons (list 1 2 3 4) (list 5 6))
((1 2 3 4)
5 6)
ELISP> (append (list 1 2 3 4) (list 5 6))
(1 2 3 4 5 6)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, realised my mistake (that package-user-dir
is not a list).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is nothing wrong with site-lisp. In fact I want to put installed packaged under site-lisp. With the proposed code, I do have the installed files under site-lisp. The issue is how does spacemacs know that the packages are installed already so that it does not install them under package-user-dir?
AFAIK package-directory-list was created to solve this problem, i.e., to allow site administrators to install packages under site-lisp directories.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not change configuration-layer//get-package-directory?
It never occurred to me. In my testing just applying the change in this PR was sufficient in that
spacemacs honored the packages installed under site-lisp and so it did not install them under
package-user-dir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After examining the value of package-alist, it appears that this variable already has the correct paths, i.e., 'dir' field of package-desc struct points to site-lisp directory rather than package-user-dir.
This brings up a question I had for a while. Why does spacemacs not use package-alist to figure out the location of the installed package, and instead have its own code to search the file system?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If spacemacs used package-alist to figure out package installation directory instead of searching package-user-dir, then I think this PR would not be needed. All I would have to do is just install packages under site-lisp, and package.el would take care of things.
@emacs18 I was trying to understand the idea behind the PR, because it looked weird to me that we need one. My questions were partly to help me understand the code, and partly to make you aware to parts of the code that I didn't know if you're aware of. I still don't understand all the background behind this PR, so I'll stop spamming this PR. |
@emacs18 What's your current solution ? Can you provide more details about your use case ? What are the technologies involved, what is the OS etc ... ? Users cannot mount the shared file system at the correct place to get Spacemacs happy ? |
The use case is with hundreds of developers using many dozens of linux
servers all with NFS shared file system. Starting emacs typically takes
over a minute with about 300 packages enabled. Compare this with about 6
seconds on a laptop. This is assuming that all packages have already been
installed. If packages were not installed, then it takes over 10 minutes
to install 300 packages. This is assuming that all packages are located
within the intranet so that
internet is not accessed to start and use emacs.
My goal was to make it as simple as possible for someone to try out
spacemacs by setting
up emacs so that no package need to be installed on startup. However I
have not been able
to reduce the emacs startup time below about 25 seconds which is just about
the best time
I've seen on a linux server. As I said before, typical time is over a
minute. This is one key reason why I have pretty much have given up trying
to get colleagues to test drive spacemacs. I have dozens of colleagues who
have been using emacs or vim for many years. After trying for over a year,
I have not a single person who uses spacemacs besides myself.
…On 21 June 2017 at 07:56, Sylvain Benner ***@***.***> wrote:
@emacs18 <https://github.com/emacs18> What's your current solution ? Can
you provide more details about your use case ? What are the technologies
involved, what is the OS etc ... ?
Users cannot mount the shared file system at the correct place to get
Spacemacs happy ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6872 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB7fKSKQ7vR0xRM9Bz6J5qR907pJfx60ks5sGS8tgaJpZM4Jo-Wh>
.
|
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this PR is still need merging! |
I've adopted the following method to deploy emacs that multiple folks can use within my group.
|
This PR allows me to install packages once which then can be used by all my colleagues without each
of them having to install the same pacakges. There are potentially hundreds of my colleagues
who can be using the same shared file system so that the ability to share files is important not
only to save disk space, but also to reduce startup time.
Created dotspacemacs-use-shared-packages user option, so that if it is
set to non-nil, then directories listed in package-directory-list are
also searched for installed packages in addition to package-user-dir.
Site administrator can then install packages in one or more of the
directories in package-directory-list so that all users at the site can
share the same installed packages without each user having to install
them.
This change has no impact unless dotspacemacs-use-shared-packages is
explicitly changed to non-nil from the default value of nil.