Bogdanp / setup-racket

A GH action for installing Racket.
MIT License
50 stars 9 forks source link

`deps` and `build-deps` from `info.rkt` seem to be ignored?? #15

Closed greghendershott closed 3 years ago

greghendershott commented 3 years ago

I'm doing a fire drill to switch from Travis CI to GitHub Actions, across a half dozen projects.

Your setup-racket action is great -- thank you!

It's already worked for me on a couple projects, such as sha and http, which don't in turn depend on any of my other projects.

But now I'm updating aws, which depends on both of those. The aws info.rkt:

#lang info
(define version "1.15")
(define collection 'multi)
(define deps '(["base" #:version "6.3"]
               ["http" #:version "0.3"]
               "sha"))
(define build-deps '("at-exp-lib"
                     "racket-doc"
                     "rackunit-lib"
                     "scribble-lib"))

And I'm finding it is failing to install the sha and http deps with the usual

raco pkg install --auto --link aws

Run locally, or on Travis CI, the --auto means that sha and http would be installed.

But not when run on GH Actions. raco pkg install acts as if the deps don't exist (?!?).

Instead I need to add an extra, "hack" step:

name: CI

on:
  push:
  pull_request:

jobs:
  test:
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        racket_version:
          - '6.9'
          - '7.9'
          - 'current'
        include:
          - racket_version: 'current'
            allow_failure: true
    name: Test Racket ${{ matrix.racket_version }}
    steps:
      - name: Checkout
        uses: actions/checkout@master
      - name: Install Racket
        uses: Bogdanp/setup-racket@v0.8
        with:
          architecture: 'x64'
          distribution: 'full'
          version: ${{ matrix.racket_version }}
      # This next step should not be necessary: The step after it --
      # `raco pkg install --auto` ought to install `deps` and
      # `build-deps` from aws/info.rkt. And e.g. that used to work on
      # Travis CI. Why is it not working with Bogdanp/setup-racket --
      # I am stumped??? This hack is similar to using the `packages:`
      # field, but that barfs before Racket 7.4 due to using
      # --no-docs. Anyway, I don't like that, either, because it means
      # duplicating dependency information in info.rkt and here, which
      # is bad.
      - name: Install Dependencies b/c info.rkt deps being ignored
        run: raco pkg install --auto sha http
      - name: Install Package
        run: raco pkg install --auto --link aws
      - name: Run Tests
        run: raco test -x -p aws

Do you have any idea what's going on here? I must be doing something dumb, to cause this issue.

Meanwhile the hack "works". I just don't love it as a general solution because it's not DRY and now 2 places must be updated if/when deps change.

greghendershott commented 3 years ago

p.s. An example of how it fails: https://github.com/greghendershott/aws/runs/1455055421?check_suite_focus=true

Bogdanp commented 3 years ago

I think you want just raco pkg install --auto, rather than raco pkg install --auto --link aws because the info.rkt with the dependency information is in the root of your repository, not in /aws. So

      - name: Install Dependencies b/c info.rkt deps being ignored
        run: raco pkg install --auto sha http
      - name: Install Package
        run: raco pkg install --auto --link aws

should be

      - name: Install Package
        run: raco pkg install --auto
greghendershott commented 3 years ago

Oh. So. Much. Derp. Yes, in Travis CI scripts I would cd .. first. Either I should do that, here, or do what you say.

I think the rationale for doing cd .. and then --link <subdir-name> is that the implicit "create link in current directory" behavior didn't used to work in older Rackets.

But I think those Rackets are too old to work with your GH Action in other ways, and I probably can stop testing against them by now, anway.

Thank you!

Bogdanp commented 3 years ago

You're welcome! I was actually surprised when I looked at your build that installing 6.9 worked. Previously, I hadn't tried anything prior to 7.3. I'd be happy to help make older versions work, too, if you have any trouble running them and still would like to support them.

greghendershott commented 3 years ago

I think yours might work back to 6.5. At least, from glancing at install-racket.sh that is where there was a URL change (and more for even older Rackets). Honestly, maintaining that I felt more like a domain name server or old-school Yahoo index maintainer, than anything else. :)

Anyway, for my own projects, I'm not sure I need to go older than 6.9.

Thanks again!!