JuliaCI / PkgTemplates.jl

Create new Julia packages, the easy way
https://juliaci.github.io/PkgTemplates.jl
MIT License
636 stars 101 forks source link

errors with default CI setup #309

Open rryi opened 3 years ago

rryi commented 3 years ago

Hi there,

I use PkgTemplates to generate a skeleton package, that works fine, and was a great help in the past.

Now my packages get into a state where CI reports should show successes, but except from appveyor and codecov, integration with the PkgTemplates generated code does not work "out of the box". To document it, I created a fresh package, set up a github repository, coded a trivial function and a test, and looked at the results, which are disappointing. Details below.

My local environment is a Windows 10 machine running julia 1.6.2 64-bit and VScode 1.60.0 with julia plugin.

Several of my problems maybe due to missing further configuration, but I found no documentation in the user manual on what to do after package generation. And some of the errors look like template errors to me. Any help is highly appreciated!

My test case is a new (not registered) julia package, publicly available at github:

https://github.com/rryi/TestPkgTemplates.jl

I used this script to generate the package:

using PkgTemplates

t = Template(;
           authors="Robert Rudolph",
           julia=v"1.6.2",
       dir="C:\\Users\\RR\\julia",
           plugins=[
               TravisCI(),
               Codecov(),
               AppVeyor(),
               GitHubPages(),
               CirrusCI(),
           ],
       )

print("enter new package name")
pkgName = readline()

generate(t, pkgName)

Log of its execution with current PkgTemplates:

C:\Users\RR\julia\scripts>C:\Users\RR\julia\scripts>julia createPackage.jl

  Activating environment at `C:\Users\RR\.julia\environments\v1.6\Project.toml`
  Activating new environment at `C:\Users\RR\julia\TestPkgTemplates\docs\Project.toml`
   Resolving package versions...
    Updating `C:\Users\RR\julia\TestPkgTemplates\docs\Project.toml`
  [e30172f5] + Documenter v0.27.6s\RR\.julia\registries\General`
    Updating `C:\Users\RR\julia\TestPkgTemplates\docs\Manifest.toml`t`
  [a4c015fc] + ANSIColoredPrinters v0.0.1gTemplates\Project.toml`
  [ffbed154] + DocStringExtensions v0.8.5gTemplates\Manifest.toml`
  [e30172f5] + Documenter v0.27.6
  [b5f81e59] + IOCapture v0.2.2                      ]  0/1
  [682c06a0] + JSON v0.21.2
  [69de0a69] + Parsers v2.0.3
  [2a0f44e3] + Base64
  [ade2ca70] + Dates
  [b77e0a4c] + InteractiveUtils
  [76f85450] + LibGit2
  [56ddb016] + Logging
  [d6f4376e] + Markdown
  [a63ad114] + Mmap
  [ca575930] + NetworkOptions
  [de0858da] + Printf
  [3fa0cd96] + REPL
  [9a3f8284] + Random
  [ea8e919c] + SHA
  [9e88b42a] + Serialization
  [6462fe0b] + Sockets
  [8dfed614] + Test
  [4ec0a83e] + Unicode
   Resolving package versions...
    Updating `C:\Users\RR\julia\TestPkgTemplates\docs\Project.toml`
  [1dc15e0c] + TestPkgTemplates v0.1.0 `..`
    Updating `C:\Users\RR\julia\TestPkgTemplates\docs\Manifest.toml`
  [1dc15e0c] + TestPkgTemplates v0.1.0 `..`
  Activating environment at `C:\Users\RR\.julia\environments\v1.6\Project.toml`
[ Info: Running posthooks
[ Info: New package is at C:\Users\RR\julia\TestPkgTemplates

C:\Users\RR\julia\scripts>

So far, everything is as expected.

As next step, I coded a trivial function, a test for it and tested locally in VScode REPL:

     Project TestPkgTemplates v0.1.0
      Status `C:\Users\RR\julia\TestPkgTemplates\Project.toml` (empty project)

(TestPkgTemplates) pkg> test
     Testing TestPkgTemplates
      Status `R:\Temp\jl_cznAVa\Project.toml`
  [1dc15e0c] TestPkgTemplates v0.1.0 `C:\Users\RR\julia\TestPkgTemplates`
  [8dfed614] Test `@stdlib/Test`
      Status `R:\Temp\jl_cznAVa\Manifest.toml`
  [1dc15e0c] TestPkgTemplates v0.1.0 `C:\Users\RR\julia\TestPkgTemplates`
  [2a0f44e3] Base64 `@stdlib/Base64`
  [b77e0a4c] InteractiveUtils `@stdlib/InteractiveUtils`
  [56ddb016] Logging `@stdlib/Logging`
  [d6f4376e] Markdown `@stdlib/Markdown`
  [9a3f8284] Random `@stdlib/Random`
  [9e88b42a] Serialization `@stdlib/Serialization`
  [8dfed614] Test `@stdlib/Test`
Precompiling project...
  ? TestPkgTemplates
  1 dependency successfully precompiled in 1 seconds
  1 dependency precompiled but a different version is currently loaded. Restart julia to access the new version
     Testing Running tests...
Test Summary:       | Pass  Total
TestPkgTemplates.jl |    1      1
     Testing TestPkgTemplates tests passed 

(TestPkgTemplates) pkg> 

Next step: creation of an empty github repository, create default branch "master" locally and push the repo via VScode. All fine.

I activated github pages: image and activated the project in appvoyer.

After waiting a while, readme.md shows in github: image

Clicking on the badges from left to right, gives:

  1. docs stable returns a 404 error for page https://rryi.github.io/TestPkgTemplates.jl/stable The page https://rryi.github.io/TestPkgTemplates.jl/ exists and shows the readme.md of the repository.

  2. docs dev returns a 404 error for page https://rryi.github.io/TestPkgTemplates.jl/dev

I found nothing concerning "stable" or "dev" in the generated docs folder or any .yml file. Missing code in docs/make.jl which advises Documenter to create "stable" and "dev" directories? Any tags or releases needed in git for "stable" and "dev"?

  1. travisCI build Clicking it opens https://www.travis-ci.com/rryi/TestPkgTemplates.jl Site shows a customized 404 error: image

If I do signin to travis, I see my github projects in travis CI, among them testPkgTemplates. Klick on it opens https://app.travis-ci.com/github/rryi/TestPkgTemplates.jl

Template error? Does PkgTemplates need a correction, replacing "www" in the travis URL in the badge code by "app"?!

The page https://app.travis-ci.com/github/rryi/TestPkgTemplates.jl reports an error, log excerpt:

The command "julia --project=docs -e '
  using Pkg
  Pkg.develop(PackageSpec(path=pwd()))
  Pkg.instantiate()
  using Documenter: DocMeta, doctest
  using TestPkgTemplates
  DocMeta.setdocmeta!(TestPkgTemplates, :DocTestSetup, :(using TestPkgTemplates); recursive=true)
  doctest(TestPkgTemplates)
  include("docs/make.jl")'
" exited with 1.

Something wrong in the CI configuration generated by PkgTemplates?!

  1. appvoyer build: Seems to work, mostly. Build log shows a warning:

    Updating build cache...
    Cache entry not found: C:\Users\appveyor\.julia\artifacts
    Build success

    A configuration error in generated .appvoyer.yml? It has a cache directive.

  2. cirrus CI build Click on badge opens https://cirrus-ci.com/github/rryi/TestPkgTemplates.jl

Looking at the build details, shows an installation error, log excerpt:

sh -c "$(fetch https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh -o -)"
-                                                     5031  B   29 MBps    00s
Updating FreeBSD repository catalogue...
Fetching meta.txz: . done
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
repository FreeBSD has no meta file, using default settings
Fetching packagesite.txz: .......... done
pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2
pkg: Repository FreeBSD load error: meta cannot be loaded No error: 0
Unable to open created repository FreeBSD
Unable to update repository FreeBSD
Error updating repositories!
Exit status: 3

I asked google about "pkg: repository meta /var/db/pkg/FreeBSD.meta has wrong version 2", no helpful results. An error in generated .cirrus.yml? maybe wrong/outdated freebsd instance?

I had a look at my package Tojkens.jl, which also has a PkgTemplates generated cirrus CI, not changed until 09/07/2021. In the past, until 04/04/2020, install step executed successfully. Since 07/04/2020, install step always fails. Looks like there was a change at cirrus during these 4 days, causing failure of the install step.

  1. codecov working as expected, shows 100% test coverage. fine!
rryi commented 3 years ago

I got an answer from cirruslabs concerning the install problem, they wrote:

Sorry for the delayed response. It looks like an issue with the underlying freebsd-12-0 image you are using. It does seem like 12.0 is not supported now. Could you please try 12.2?

Changing line 2 in .cirrus.yml to

image: freebsd-12-2-release-amd64

fixes the install error.