-
Notifications
You must be signed in to change notification settings - Fork 4.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
Scripts should handle Docker-related errors more gracefully #4056
Comments
Something else which could be improved in the UX area: installing dependencies. From a fresh Ubuntu install: λ sudo gem install github-linguist
Fetching: charlock_holmes-0.7.5.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing github-linguist:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/charlock_holmes-0.7.5/ext/charlock_holmes
/usr/bin/ruby2.3 -r ./siteconf20180313-5065-1seejfp.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.3.0/gems/charlock_holmes-0.7.5 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/charlock_holmes-0.7.5/gem_make.out I had to Google what it was even referring to, and an SO question provided the answer:
@lildude Should |
Another hurdle in the installation process, solved by Googling error feedback and finding this answer: sudo apt-get install zlib1g-dev Which brings my total command history to all this: λ sudo gem install github-linguist
*ERROR*
λ sudo apt-get install ruby-dev
λ sudo gem install github-linguist
*ERROR*
λ sudo apt-get install libicu-dev
λ sudo gem install github-linguist
*ERROR*
λ sudo apt-get install cmake pkg-config libicu-dev
λ sudo gem install github-linguist
*ERROR*
λ sudo apt-get install zlib1g-dev
λ sudo gem install github-linguist ... I don't know whether this should be addressed by Linguist, or by each individual Gem that it depends on (since there are dependencies of dependencies being required here...) |
I think it might be pertinent to document it in our own README as we document the requirement for the dependencies of things like rugged and charlock_holmes. The I'm sorting out the docker side of things in a PR I'm working on right now as adding a grammar is currently broken following the updating of Licensed. |
Question, though: why is Docker even being used? I had to comment out the respective Docker-related lines in |
Woah! You're doing a whole refactor... 🙇 I'm going for the quick-n-nasty "whoopsie, we missed this spot" fix 😁
We've already got dependency hell as you've encountered and this extracts some of that hell for us. |
I'm adding support for rolling back filesystem changes in case of an error. I'm refactoring things to use an object-oriented approach, to save the script from becoming spaghetti-code. 😉
Understood. However, I've added a switch that dictates whether Docker is used for compiling the grammar or not. It's off by default (I was going to bring that up for discussion in the resulting PR), but I can remove it if you want (or invert the logic so it disables Docker rather than enables). |
I'm pretty sure we need the grammar compiler to always run when adding or replacing grammars, right @vmg? |
Oh! Another thing: I had to install the Still unsure why Docker hates me but likes everyone else. 😢 |
Actually, I think I'm gonna refactor I'm sticking these under a new directory at |
It's as good a place as any. |
This issue has been automatically marked as stale because it has not had activity in a long time. If this issue is still relevant and should remain open, please reply with a short explanation (e.g. "I have checked the code and this issue is still relevant because ___."). Thank you for your contributions. |
This issue has been automatically closed because it has not had activity in a long time. Please feel free to reopen it or create a new issue. |
Problem Description (copied from
#4054
)I ran into a few issues when testing an update to the
add-grammar
script:Docker wasn't installed, so I had to
sudo apt-get install docker
Docker still wasn't installed, so I had to double-check what the hell the
docker
package was, and found out the correct name is actuallydocker-ce
(??!)The correct Docker was installed, but it complained about inadequate permissions:
This makes for some pretty unfriendly UX; the scripts should ideally be updated to deal with these hurdles. Even bailing early in
add-grammar
would be preferable to bailing halfway, because each of the above three errors left the user with half-registered grammar modules...Bear in mind I've never used Docker before, and I'm largely ignorant to how/why it's used. So this presents a pretty good example of how The Average User might feel when preparing a PR for adding a new language to Linguist.
The text was updated successfully, but these errors were encountered: