leif
2020-7-21 22:38:25

@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.)


leif
2020-7-21 22:40:17

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


samth
2020-7-21 22:52:40

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


leif
2020-7-21 22:54:35

Ah, okay, thanks.


badkins
2020-7-21 23:41:31

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?


badkins
2020-7-21 23:46:17

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.


badkins
2020-7-21 23:51:43

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


samth
2020-7-21 23:53:28

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


badkins
2020-7-21 23:53:52

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


badkins
2020-7-21 23:55:09

badkins
2020-7-21 23:56:32

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


badkins
2020-7-22 00:10:52

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)))


notjack
2020-7-22 01:11:36

@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.


cris2000.espinoza677
2020-7-22 01:40:34

from which file?


cris2000.espinoza677
2020-7-22 01:40:43

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


samth
2020-7-22 01:49:11

Or you can use contract-out with the struct form


sorawee
2020-7-22 03:39:13

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\""))


sorawee
2020-7-22 03:39:33

Are you running it from DrRacket?


sorawee
2020-7-22 03:39:37

What OS are you using?


sorawee
2020-7-22 03:40:34

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


sorawee
2020-7-22 03:42:07

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.


cris2000.espinoza677
2020-7-22 04:42:40

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


cris2000.espinoza677
2020-7-22 05:13:27

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


cris2000.espinoza677
2020-7-22 05:14:05

.../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
2020-7-22 06:12:05

@sofya.garmash has joined the channel