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

Add travis #130

Merged
merged 14 commits into from Jun 29, 2018

Conversation

Projects
None yet
4 participants
@zkamvar
Copy link
Contributor

commented Jul 6, 2017

I've added a .travis.yml file. It currently fails because of a few cls files that are either mis-named ore are not in the right place:

It's also failing due to some templates using either xtable or lubridate.

Nevertheless, I'm creating this PR for feedback.

@yufree

This comment has been minimized.

Copy link
Contributor

commented Jul 6, 2017

For acs_article and ams_article, you need to install extra CTAN packages. You could add the following code to .travis.yml to pass the tests:

before_install:
    - tlmgr install achemso ametsoc
@yihui

This comment has been minimized.

Copy link
Member

commented Jul 6, 2017

WAT?! We didn't have .travis.yml for this repo? We should definitely add it. Thanks!

.travis.yml Outdated
notifications:
email:
on_success: change
on_failure: always

This comment has been minimized.

Copy link
@yihui

yihui Jul 6, 2017

Member

I think these are the defaults, so probably not needed.

.travis.yml Outdated
- devel

sudo: false
cran: http://cran.at.r-project.org

This comment has been minimized.

Copy link
@yihui

yihui Jul 6, 2017

Member

Could you use https://cran.rstudio.com?

@zkamvar

This comment has been minimized.

Copy link
Contributor Author

commented Jul 6, 2017

Since some of the formats use lubridate and xtable, should I also add these to the Suggests: in the DESCRIPTION?

@yihui

This comment has been minimized.

Copy link
Member

commented Jul 6, 2017

I think lubridate can be removed. The code can be simply replaced by format(Sys.Date(), '%Y') and format(Sys.Date(), '%m').

I don't have an opinion on xtable. Any of these methods is fine to me:

  • adding it to Suggests
  • install it on Travis only (before_install)
  • if (!require("xtable")) install.packages("xtable") in Rmd
@zkamvar

This comment has been minimized.

Copy link
Contributor Author

commented Jul 6, 2017

Okay! I'll try to get to these within the next couple of days (but the branch is open for edits if you need it before then 😺 ).

zkamvar added some commits Jul 7, 2017

address issues in PR #130
 - add xtable to suggests (and install conditional
   in RMD)
 - remove dependency on lubridate
 - change CRAN url
DESCRIPTION Outdated
@@ -29,4 +29,4 @@ License: GPL-3
Imports: utils, rmarkdown, knitr, yaml
SystemRequirements: GNU make
RoxygenNote: 6.0.1
Suggests: testthat
Suggests: testthat xtable

This comment has been minimized.

Copy link
@yihui

yihui Jul 7, 2017

Member

missing comma here

This comment has been minimized.

Copy link
@zkamvar

zkamvar Jul 7, 2017

Author Contributor

Rupaul screaming like I'm screaming

@zkamvar

This comment has been minimized.

Copy link
Contributor Author

commented Jul 7, 2017

I'm done fiddling with this for tonight. Does anyone have a way to resolve all of these dependency issues all at once? The current LaTeX error I'm getting is:

LaTeX Error: File `needspace.sty' not found.
@cboettig

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2017

I'm probably missing something, but why not just include texlive-full? I know it's big and slow, but apt installs are all cached on .travis, right?

@yufree

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2017

Hi, I have a dirty solution by searching \usepackage in this repo like this. Then grab all packages by regular expression and add them to before_install. However, some packages might be installed by default.

@yufree

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2017

I steal some codes from here if you want to install the texlive-full.

before_install:
- |
  if [[ ! -e ./texlive/bin/x86_64-linux/tlmgr ]]; then
    wget http://mirrors.ctan.org/systems/texlive/Source/install-tl-unx.tar.gz -O - | tar -x --gzip
    mv $(ls | grep install) install-tl
    ./install-tl/install-tl -profile texlive.profile
  fi
- export PATH=$(pwd)/texlive/bin/x86_64-linux:$PATH
- sudo apt-get install texlive-full
- sudo apt-get install latexmk
- tlmgr install $(cat .tlmgr-dep)
- tlmgr update --self
- tlmgr update --all
@zkamvar

This comment has been minimized.

Copy link
Contributor Author

commented Jul 7, 2017

I'm trying out @cboettig's suggestion because it seems to be the simplest answer so far. If I were worried about things that were big and slow, I would have never gone into academia 😆 . I'm about to get on a 🛫 , so I hope this works 🤞.

@zkamvar

This comment has been minimized.

Copy link
Contributor Author

commented Jul 7, 2017

🔥🔥LaTeX errors🔥🔥

@yihui

This comment has been minimized.

Copy link
Member

commented Jul 7, 2017

@cboettig Apt dependencies are probably not cached, and Travis does not recommend caching Debian packages: https://docs.travis-ci.com/user/caching/#Things-not-to-cache

I have been annoyed by this TeXLive issue for several years, and I'm relatively sure that I can come up with a more efficient solution, i.e. you do not need a 5G texlive-full yet you can use most packages. After I finish the blogdown book, I'll try to take a stab at it.

@cboettig

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2017

@yihui thanks. I feel like @jimhester gave me some pointers on some clever LaTeX configurations in r-travis a while back but now I cannot find them.

I'm also happy to see alternatives to texlive-full, fwiw rticles passes check on our rocker/verse image (Dockerfile) which adds about a 300 MB layer, though I'm not sure if all the rticles formats have complete unit tests.

I asked about the assumed tex environment back in #120 with an eye to adding .travis to the repo and documenting the package's tex dependencies for users (e.g. me), but JJ's advice there was that it was better to just assume a full tex environment.

@yihui

This comment has been minimized.

Copy link
Member

commented Jul 7, 2017

LaTeX support for R on Travis was based on my early work at https://github.com/yihui/ubuntu-bin and I think Jim improved my build scripts and hosted the package elsewhere (I stored it via Github releases).

I wanted to say exactly what I said here back when I saw your discussion in #120. Installing texlive-full is indeed the easiest solution at the price of wasting a lot of disk space. It is just whether you care about the disk space (and download time in the case of Travis). I guess most people probably don't care, but I'm not very comfortable with the fact that a large portion of the texlive-full package is mostly useless to most users (in particular, the docs). Installing texlive-full is just like installing the full CRAN to solve the problem of missing R packages. I believe we can come up with a ~100Mb "base" texlive, and give a simple instruction on how to install missing packages like install.packages() in R. I think Debian has made this awfully difficult and awkward. It should have been tlmgr install. That is pretty much the only thing you need to remember about TeXLive package management. No sudo, or whatsoever.

@yihui

yihui approved these changes Jul 7, 2017

@cboettig

This comment has been minimized.

Copy link
Contributor

commented Jul 7, 2017

Thanks @yihui , I'm with you 100% on avoiding the bloat, clearly don't want the our docker images to be much larger than they need to be (which is the main reason why we separated the tex components out of tidyverse and into the separate verse. tlmgr is awesome, but I suspect @jjallaire is right that the average R user will find it much more difficult to manage the tex dependencies of rticles with tlmgr than they do managing R dependencies with install.packages(), particularly since knowing what templates need what style files can be rather opaque behind the layers of Rmd, pandoc etc.

@yihui

This comment has been minimized.

Copy link
Member

commented Jul 7, 2017

The worst case is to emulate MikTeX through an R package, i.e. automatically install missing LaTeX packages (using a more awkward approach, though, by parsing the error log). I believe we can solve 99% of the problems with a significantly smaller texlive package plus an R wrapper package. I have done some work in rmarkdown:::latexmk. So the basic pieces have already been there. I just need some time to put them all together.

@yihui yihui referenced this pull request Nov 11, 2017

Open

Some potential topics for future blog posts #3

38 of 63 tasks complete
@yihui

This comment has been minimized.

Copy link
Member

commented Dec 3, 2017

@cboettig I spent a week working on this problem and here is what I have got so far: https://github.com/yihui/tinytex Please help me test it. Note that you need the dev version of rmarkdown at the moment:

devtools::install_github(c("yihui/tinytex", "rstudio/rmarkdown"))

Two major advantages of TinyTeX:

  1. It is small.

  2. If the LaTeX distribution is TeX Live (e.g., TinyTeX), missing LaTeX packages should be automatically installed by default.

yihui added some commits Jun 29, 2018

@yihui yihui merged commit 8f7f7c6 into rstudio:master Jun 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.