


@samth I heard that back in April/May there was a malicious package posted to the package server. Do you happen to know the name of that package (provided its still available.)

Or maybe it was @jeapostrophe was the one who handled it, I forget

The Tweedledee and Tweedledum packages intentionally conflict with each other, currently on the pkg server, to demonstrate an issue with conflicts

Ah, okay, thanks.

I attempted to create a dummy request
struct so I could test a controller action, and I was surprised to get a contract error. I simply supplied a value of #f
for all the fields because in this particular case the action doesn’t make use of any request
fields. So, it appears that a constructor was called, and the contract system complained about the values I supplied. This functionality is new to me. is the #:extra-constructor-name
option the mechanism that makes this happen?

I’ve read through the struct
documentation, and it wasn’t immediately clear to me that there was a way to force a constructor to be called when the user attempts to create a struct via id
.

Hmm… reading through the guide, maybe it’s a contract or a #:guard
that is forcing this.

What do you mean “create a struct via id”?

(request #f #f #f #f #f #f #f #f)


Now that I read the error message again, it appears to state the error is generated by a contract in “request-structs.rkt”

This will do for now: (define (create-test-request method url-str)
(let ([ uri (string->url url-str) ]
[ headers/raw '() ]
[ bindings/raw-promise (delay '()) ]
[ post-data/raw #f ]
[ host-ip "0.0.0.0" ]
[ host-port 80 ]
[ client-ip "0.0.0.0" ])
(request method
uri
headers/raw
bindings/raw-promise
post-data/raw
host-ip
host-port
client-ip)))

@badkins There’s two ways: the module can wrap the constructor while still preserving the static struct info (there’s a bit of a dance you have to do with define-module-boundary-contract
in order to get it to work), or the struct definition can use #:guard
with struct-guard/c
to enforce the contract on all instances of the struct. The latter is generally a better idea.

from which file?

either way it doesn’t work for me :disappointed:

Or you can use contract-out with the struct form

Interesting. eval-test.rkt
works for me:
#lang racket
(require racket/sandbox)
(sandbox-path-permissions
(list*
(list 'execute (current-directory))
(sandbox-path-permissions)))
(define eval2 (make-module-evaluator "#lang reader \"reader.rkt\" misc:hello$ food:\"delicious and nutricious\""))

Are you running it from DrRacket?

What OS are you using?

Actually, I just ran from DrRacket and it works fine, too.

I’m using Racket 7.8.0.5—2020–07–01, btw, which is a development version of Racket. It’s totally possible that the error is due to some bug that was recently fixed in the development version.

Yes I’m running it from DrRacket. Windows 10 Home 64x. DrRacket 7.6, I’ll try that version now.

ok i didnt change to a snapshot but changed from 7.6 3m to 7.7 cs and still get the error

.../syntax/module-reader.rkt:249:18: link: access disallowed by code inspector to unexported variable
variable: token15.1
from module: "C:\Users\USERNAME\AppData\Roaming\Racket\7.7\pkgs\brag-lib\brag\support.rkt"

@sofya.garmash has joined the channel