
@mflatt thanks for the explanation. Trying to extract a smaller example.

I think this is related to me not knowing about define-runtime-paths
and my extensive use of dynamic-require
.

@mflatt I have sent an email to the ml since the small-ish example looked too large to post here.

@norman.kraft has joined the channel

Am I missing something simple for why this doesn’t just work: #lang racket/base
(define nspace (namespace-require
'racket/math
(make-base-namespace)))
(eval '(sqr 6) nspace)
;; require: unknown module
;; module name: #<resolved-module-path:"...../collects/racket/math.rkt">

frustratingly… the resolved-module-path
file it points to indeed exists and is what I want to require >_<

nevermind I figured out something that works (also namespace-require
returns void, oops, so that’s obviously not what I had thought)

I’m having some crazy problems with hash-ref
(possibly memory related)

I have a set of ffi bindings which import a bunch of data structures that have a size of 16-bits

I then add 256 of these data structures into a hash-map as keys

Later on, when I try to access these keys, they don’t show up in the hash table

I’ve made sure that the hash-table is comparing using equal?
by checking with hash-equal?
which returns #t

And I’ve tried a simplified version in the REPL which works fine, so it’s not some weird issue comparing keys

The weird part is that if I call hash-keys
or hash->list
, the keys show up in the produced lists

So I think the keys are in the hash table, they just aren’t being looked up properly

I’ve tried to minimize this example to get a more manageable way to figure out this bug, but I’m also having problems with that

I’ve tried just removing definitions that aren’t needed for the example from my file, and I’ve gotten to the point where if I remove a definition that is unused anywhere else in any files, the hash-ref
starts working

hash-ref
also starts working if I move all the definitions that are important to a new file and just call it from there

Like I said, I’m trying minimize my example, but I’m completely at a loss for how to approach this now

Any ideas?

@dthien can you post the code? that’s almost certainly a bug

I can, but it’s part of a several-thousand line project that I haven’t been able to make any smaller

I would report a bug on the racket/racket
repository with reproduction instructions using your project

Ok, thanks. I’ll do that now

Ok, just posted the bug on racket/racket
, let me know if there’s anything else I can do to help track down this bug

@dthien thanks, that was easy to reproduce at least

what’s the correct incantation to trigger verbose reporting of raco pkg install
’s activity? I tried obvious possibilities such as -v
-vv
--verbose
. Reading pkg source code I see there are log-pk-*
functions so I tried setting PLTSTDOUT=debug@pkg
to no avail.

PLTSTDOUT=debug@pkg
should have worked, although I recommend PLTSTDOUT="debug@pkg error"
so you don’t lose error output. What raco pkg
command were you trying? Maybe there’s just not much logging currently in place.

I was trying raco pkg install
I wanted to see if I could get more information on how that command made its decisions about content types of packages. I created a local directory catalog of a set of ‘binary-lib packages created using raco pkg create
but trying to install using that catalog with —binary-lib
option fails with a package content type not compatible with requested conversion error (or something along those lines, paraphrasing from memory) so was hoping logging could tell me more information. When I checked the relevant package’s info.rkt I see it has a field, I think pkg-content-type
set to ‘binary-lib.
I stopped work for the day but plan to investigate more deeply tomorrow using the available documented API in the pkg
collection.