MarcKaufmann / congame

The best experimental economics software built in Racket
20 stars 5 forks source link

Error/uncertainty trying to install studies #156

Closed otherjoel closed 4 days ago

otherjoel commented 1 week ago

In the master branch's current README, it says:

The package's info.rkt needs to (define congame-studies) like so:

 (define congame-studies
   ;; Path to package, followed by the study provided by the package that you want to use
   '((congame-example-study/example consent-study)
     (congame-example-study/example simple-study)))

The phrase “the package” here seems ambiguous; I understood it to refer to congame-web, and that the example lines should be thus be added to congame-web/info.rkt. (And I added language to that effect in the intial commits of #153.) But one of Marc's comments reviewing #153 made me wonder whether I had misinterpreted this.

If I do add these lines to congame-web/info.rkt I get an error starting the application:

12:19:25 web.1      |  7 error compiling /Users/joel/code/congame/congame-web/pages/all.rkt
12:19:25 web.1      | /Applications/Racket v8.14/collects/racket/runtime-path.rkt:190:11: module: identifier already defined
12:19:25 web.1      |   at: mod-consent-study
12:19:25 web.1      |   in: (define-values (mod-consent-study) (let-values (((mod-consent-study) (let ((runtime? #t)) `(module ,'congame-example-study/example ,(#%variable-reference))))) (let ((get-dir void)) (apply values (resolve-paths (#%variable-reference) get-dir (list mod-co...
12:19:25 web.1      |   compilation context...:
12:19:25 web.1      |    /Users/joel/code/congame/congame-web/pages/admin.rkt
12:19:25 web.1      |   context...:

The congame-web/info.rkt on the master branch does not have a (define congame-studies …) expression; but without it, I get a different error:

12:31:55 web.1      | info.rkt: no info for congame-studies
12:31:55 web.1      |   context...:
12:31:55 web.1      |    /Applications/Racket v8.14/collects/racket/contract/private/arrow-higher-order.rkt:375:33: ...row-higher-order.rkt:375:33
12:31:55 web.1      |    /Users/joel/code/congame/congame-web/dynamic.rkt:157:0: get-registered-studies
12:31:55 web.1      |    body of "/Users/joel/code/congame/congame-web/dynamic.rkt"
12:31:55 web.1      |    /Applications/Racket v8.14/collects/racket/rerequire.rkt:20:0: rerequire
12:31:55 web.1      |    /Users/joel/Library/Racket/8.14/pkgs/koyo-lib/koyo/runner.rkt:189:4
12:31:55 web.1      |    /Users/joel/Library/Racket/8.14/pkgs/koyo-lib/koyo/runner.rkt:204:2: loop
12:31:55 web.1      |    body of (submod "/Users/joel/Library/Racket/8.14/pkgs/koyo-lib/koyo/runner.rkt" main)

But it does work if I add (define congame-studies '()) to congame-web/info.rkt.

At this point, I believe the line in the README is supposed to refer to the info.rkt in the study package, not in congame-web. However, it seems as though the congame-web/info.rkt file does also need updating because, out of the box, it's missing the (define congame-studies '()) statement that it needs for the application to run.

It seems like congame-web/info.rkt should be amended to include the line (define congame-studies '()). But let me know if I have missed something here.

MarcKaufmann commented 5 days ago

My congame-web/info.rkt does not define congame-studies and it works. This is the totality of it:

#lang info

(define collection "congame-web")
(define deps '("base"
               "component-lib"
               "congame-core"
               "conscript"
               "crypto-lib"
               "db-lib"
               "dbg"
               "deta-lib"
               "forms-lib"
               "gregor-lib"
               "http-easy"
               ["koyo-lib" #:version "0.23.1"]
               "koyo-north"
               "koyo-postmark"
               ["koyo-sentry" #:version "0.1.1"]
               ("libargon2-x86_64-linux" #:platform #rx"x86_64-linux")
               ("libargon2-x86_64-macosx" #:platform #rx"x86_64-macosx")
               "sentry-lib"
               "threading-lib"
               "web-server-lib"))
(define build-deps '())

What may be the problem (and I am just speculating) is that after you added some studies to congame-web/info.rkt, you created some in your DB (or in the cache for compiled files) that expect there to be some. Do you get that error for a clean install of congame? That is, do you get an error message about congame-web even then?

If not, you'll need @Bogdanp to help you out on this one.

otherjoel commented 4 days ago

The fact that your congame-web/info.rkt doesn't have this definition and works fine tells me it’s almost certainly an issue with my environment, so I’ll close this off. You’re probably correct that I need to try again with a clean install.