Skip to content
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

vagrant up dies when installing FITS #54

Closed
mjordan opened this issue May 20, 2015 · 22 comments
Closed

vagrant up dies when installing FITS #54

mjordan opened this issue May 20, 2015 · 22 comments

Comments

@mjordan
Copy link
Contributor

mjordan commented May 20, 2015

I'm running a clean vagrant up at c76b8bf and the install is dying, I think at https://github.com/Islandora-Labs/islandora_vagrant/blob/master/scripts/fits.sh#L20 (or more likely at https://github.com/Islandora-Labs/islandora_vagrant/blob/master/scripts/fits.sh#L21). I'm attaching the output from vagrant up (in a Windows cmd shell).

time_of_death

sshing into the vm I can confirm that /vagrant/downloads/fits-0.8.5.zip does exist. Also attaching a screencap of the contents of /usr/local/fits/fits-0.8.5 - everything looks good:

in_fits_dir

Any ideas?

@ksclarke
Copy link
Contributor

There doesn't seem to be a space in the config/variables file on the first line... #!/bin/sh

Try fixing that to: #! /bin/sh or taking that line out altogether?

That wasn't changed recently, but it just doesn't look like it's sourcing that file correctly (it's seeing blank lines as commands and doesn't look like the FITS variables are set?)

Alternatively, because of the \r instead of \n I wonder if it's being checked out differently on a Windows machine? Git defaults should be to use Linux line endings, I'd think, but I know you can have it use Windows line endings through configuration: https://help.github.com/articles/dealing-with-line-endings/ -- in this case, though, I'd think it would need to have \n or \r\n line endings and perhaps Windows is just using \r?

@ruebot
Copy link
Contributor

ruebot commented May 20, 2015

Builds fine for me on Linux.

I don't have a Windows machine to test this out on.

That said, configs/variables and scripts/devtools.sh are the only files with shebangs. If there is consensus that they should be removed, then we'll remove them.

@ksclarke
Copy link
Contributor

I'm fine with removing them (for consistency) but leaning towards the Windows line ending theory at the moment as the cause.

@mjordan
Copy link
Contributor Author

mjordan commented May 20, 2015

Testing the shebang hypothesis first...

I'm happy to test on Windows, our box at home has lots of horsepower. I'm all thumbs when it comes to dev tools like git on windows though.

@ksclarke
Copy link
Contributor

I'm not a Windows user at all, but I do have some instances on VirtualBox that I can help test with later this week if the immediate theories don't pan out.

@mjordan
Copy link
Contributor Author

mjordan commented May 20, 2015

Culprit was line endings. I removed the shebang from configs/variables but that didn't solve the problem. I then put back the shebang and changed the line endings in that file from Windows' CR/LF to Linux's LF and everything works as expected. Good catch @ksclarke.

Maybe we suggest in the README that people running Windows hosts change the line endings in the configs/variables file using their favorite text editor before vagrant up?

@ksclarke
Copy link
Contributor

+1 to updating README

Also, in terms of consistency, we could also go the route of putting the shebang in every script file. I must admit I found the absence of them unnerving but thought it must be a vagrant thing/convention.

@ruebot
Copy link
Contributor

ruebot commented May 20, 2015

Why don't we just make all the files have correct line endings? The way I'm reading this is that the build dies on Windows because fits.sh has Windows line endings.

I can also create another issue, and take care of the shebangs.

@mjordan
Copy link
Contributor Author

mjordan commented May 20, 2015

@ruebot it's configs/variables, not fits.sh. If we all set git config core.autocrlf (and everyone else who touches that file sets) as described at https://help.github.com/articles/dealing-with-line-endings/ I think that will work. Worth a try. Want me to cut a new branch, try that, and test?

@ksclarke
Copy link
Contributor

Perhaps put it in a .gitattributes file in the repo so the user doesn't have to do anything, but it's set as a default for the repository?

@mjordan
Copy link
Contributor Author

mjordan commented May 20, 2015

Yeah, doing that now, will then test.

@ruebot
Copy link
Contributor

ruebot commented May 20, 2015

Where are we seeing the Windows line endings in fits.sh, because I'm not seeing them?

$ file scripts/fits.sh 
scripts/fits.sh: ASCII text

@ksclarke
Copy link
Contributor

I don't think they are windows line endings in the repo but only on checkout on a windows machine (git can change line endings on the fly). Setting git to use crlf for the repo should work in all cases, imo.

@ruebot
Copy link
Contributor

ruebot commented May 20, 2015

Vagrantfile:  ASCII text
bootstrap.sh:           ASCII text
devtools.sh:            ASCII text
djatoka.sh:             ASCII text
drupal.sh:              ASCII text
fcrepo.sh:              ASCII text, with very long lines
ffmpeg.sh:              ASCII text, with very long lines
fits.sh:                ASCII text
gsearch.sh:             ASCII text, with very long lines
islandora_libraries.sh: Palm OS dynamic library data "echo "Installing all Islandora Foundation module's required lib"
islandora_modules.sh:   ASCII text
sleuthkit.sh:           ASCII text
solr.sh:                ASCII text
tesseract.sh:           ASCII text
warctools.sh:           ASCII text

@ruebot
Copy link
Contributor

ruebot commented May 20, 2015

@ksclarke Ah, ok. That make sense.

@mjordan
Copy link
Contributor Author

mjordan commented May 20, 2015

I'm testing a fork of my own, https://github.com/mjordan/islandora_vagrant/tree/ISSUE-54.

@mjordan
Copy link
Contributor Author

mjordan commented May 20, 2015

groan. Took an hour and half to build. I guess a 64-bit Win7 machine with an i5 processor and 12 gigs of RAM doesn't have as much horsepower as I thought. Network capacity was surely an issue since there was a lot of pausing at "Downloading...."

Anyhoo, adding the .gitattributes file as in my branch has fixed the problem on Windows hosts. Let me test on Linux when I get to work to make sure I didn't introduce any problems there. If that passes, I'll open a PR.

In the scramble to fix one problem at a time I kinda lost the thread on #55 but now that I'm set up to test on Windows I can take a look at that too.

@ruebot
Copy link
Contributor

ruebot commented May 20, 2015

#55 isn't a priority, unless somebody really wants to go through and implement it.

@mjordan
Copy link
Contributor Author

mjordan commented May 20, 2015

If it's not a high priority, I'm going to pass on it.

@ruebot
Copy link
Contributor

ruebot commented May 20, 2015

😄

@mjordan
Copy link
Contributor Author

mjordan commented May 20, 2015

Build successful in Linux. PR is at #56.

@ruebot
Copy link
Contributor

ruebot commented May 20, 2015

Closed with 388dc02.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants