
@sturgman has joined the channel

@ben Wasn’t that what Milo D. was trying to do for a while? Do you know if he ever succeeded?

This question is easier. I’m ~at phase 1 and~ in typed code. (edit: milo was at phase 1 too, but working with fully expanded untyped code)

OH, oka.

okay*

Well in that case @lexi.lambda’s unsafe-reprovide
’s implementation might actually tell you what you need.

Hmm? I don’t have an unsafe-reprovide
implementation…

how do I make subcollections? I have a main collection, and would like to group several collections under that main collection. I’m not seeing how to do that in the documentation or the user mailing list.

@abmclin I think you just need to make a directory

if you have a package that defines the foo
collection, you can define the foo/bar
collection and foo/bar/baz
collections by putting directories inside foo/

I thought so too but am getting module not found errors, for example (require main/sub)
is giving me main/sub.rkt not found. The main.rkt in the sub directory isn’t being found

maybe I screwed up something, I’ll try redoing it from scratch

no you’re okay

there’s something confusing here

yeah definitely

(require main)
will go to main/main.rkt

(require main/sub)
will go to main/sub.rkt

I was thinking collections and subcollections correspond to a directory structure but maybe I’m mistaken?

(require main/sub/a)
will go to main/sub/a.rkt

ok

hmm

so there’s a special case for just a collection name (goes to main.rkt)

and the others are filepaths without .rkt

ok I think I see now

@scott.watson has joined the channel


will experiment by using your examples


@lexi.lambda I did read that documentation but I was confused because I thought (require main/sub)
would map to main.rkt in the directory main/sub

> If a single rel-string
is provided, and if it consists of multiple /
-separated elements, then each element up to the last names a collection, subcollection, etc., and the last element names a file. If the last element has no file suffix, ".rkt"
is added, while a ".ss"
suffix is converted to ".rkt"
.

(emphasis mine)

indeed, that is clear to me now

Hi folks! I sent this to the mailing list too… but you know, people slack nowadays. Please excuse the big copy paste…

’’’ Here’s what I see… any ideas?
I’ve been running it under dtruss/dtrace to try and spot what is different, but so far no luck.
If run the IDE it also works!
bash–3.2$ racket Welcome to Racket v6.11. standard-module-name-resolver: collection not found for module path: (submod (lib “racket/init”) configure-runtime) collection: “racket” in collection directories: /usr/local/collects /usr/local/Cellar/minimal-racket/6.11/share/racket/pkgs/racket-lib context…: show-collection-err standard-module-name-resolver standard-module-name-resolver: collection not found for module path: racket/interactive collection: “racket” in collection directories: /usr/local/collects /usr/local/Cellar/minimal-racket/6.11/share/racket/pkgs/racket-lib context…: show-collection-err standard-module-name-resolver standard-module-name-resolver: collection not found for module path: racket/base collection: “racket” in collection directories: /usr/local/collects /usr/local/Cellar/minimal-racket/6.11/share/racket/pkgs/racket-lib context…: show-collection-err standard-module-name-resolver
bash–3.2$ sudo racket Password: Welcome to Racket v6.11. > “totally works” “totally works” >

haha, I saw you joined slack & was about to reply to your mail

I’ve checked permissions (as best I can tell) and no luck!

:(

yeah I’m not sure what’s wrong, but can you install from <http://download.racket-lang.org\|download.racket-lang.org>
instead of brew?

That was how I started… which worked for the IDE, but not the command line. I can certainly try again.

oh

you mean you used the installer and typing racket
on the command line didn’t do anything?

Also - I think the cask install uses the .dmg version available there.

It just gave me the error messages above.

Again - it works when I sudo racket
, which makes it sound like a permission issue.

(re, re installing….)

The .dmg puts it in Applications, so running from there generates:

/Applications/Racket v6.11/bin/racket Welcome to Racket v6.11. default-load-handler: cannot open module file module path: (lib “racket/init”) path: /Applications/Racket v6.11/share/pkgs/racket-x86_64-macosx–2/racket/init.rkt system error: No such file or directory; errno=2 context…: standard-module-name-resolver default-load-handler: cannot open module file module path: racket/interactive path: /Applications/Racket v6.11/share/pkgs/racket-x86_64-macosx–2/racket/interactive.rkt system error: No such file or directory; errno=2 context…: standard-module-name-resolver default-load-handler: cannot open module file module path: racket/base path: /Applications/Racket v6.11/share/pkgs/racket-x86_64-macosx–2/racket/base.rkt system error: No such file or directory; errno=2 context…: standard-module-name-resolver bash–3.2$

Which is true, since only info.rkt is in that file. However, if I launch the IDE from the finder, it works. :_(

you got this from brew cask?

And when running as root,

bash–3.2$ sudo /Applications/Racket v6.11/bin/racket Password: Welcome to Racket v6.11. >

I downloaded it directly. Just turns out that the cask install also uses the .dmg

I’ve be looking at dtruss outputs and there is a difference in search directories before it fails… but it doesn’t make any sense to me.

it sounds like Racket is trying to resolve (lib "racket/init")
into a filesystem path & failing

I think racket/init
should be at /Applications/Racket v6.11/racket/collects/racket/init.rkt

but that’s all I know, sorry

Well… at least its not something completely obvious :slightly_smiling_face:

oey, this is weird.

I need to figure out a way to test this.

FYI

ProductName: Mac OS X ProductVersion: 10.12.4 BuildVersion: 16E195

Okay

Are you also using Racket from brew
or brew cask
?

(iirc one is minimal and the other is not)

I just installed via the .dmg, and dragging into Applications, and then running the “configure command line tools” under help

I’ve also tried both the minimal
and brew cask
versions with same results

In looking @ the dtruss output, the first difference is an “Err#60” after setting up some ‘ioctls’ on stdout and stderr. I don’t see then when running as root.

’’‘ioctl(0x1, 0x4004667A, 0x7FFF56C425AC) = 0 0 ioctl(0x2, 0x4004667A, 0x7FFF56C425AC) = 0 0 mmap(0x0, 0x10000, 0x7, 0x1002, 0xFFFFFFFF, 0x0) = 0x10A2C4000 0 __semwait_signal(0xB03, 0x0, 0x1) = –1 Err#60’’’

but permissions look OK

ls -lat /dev/fd/{0,1,2}
crw--w---- 1 scott tty 16, 0 Jan 19 13:36 /dev/fd/0
crw--w---- 1 scott tty 16, 0 Jan 19 13:36 /dev/fd/1
crw--w---- 1 scott tty 16, 0 Jan 19 13:36 /dev/fd/2

Hmm…I’m having some trouble replicating it. Any luck @ben

?*

nope, I can brew cask install racket; /Applications/Racket\ v6.11/bin/racket
no problem

I am running 10.11, so that may have something to do with it.

(OS X 10.11)

what are you on?

me too, 10.11.1

Interesting.

I wonder if its a 10.12 issue then.

My buddies have had no problems, I’ll find out what version they’re running.

Okay cool

Also wow…apparently everyone else in the lab (at least as of this evening) is on os x 10.11 or 10.10…

(I think the ones that are on newer systems are out at the moment…)

Can’t remember what induced me to upgrade… I’m usually a laggard!

would you want to try building from source + built packages? Instructions:


unzip, cd
to racket/src

mkdir build; cd build

../configure && make && make install

and that should make a bin
folder at the top of the unzipped folder

At this point, sure! :slightly_smiling_face:

Will lyk

My friend is on 12.3 and is OK. Also - build error:

/Applications/Xcode.app/Contents/Developer/usr/bin/make xsrc/precomp.h
env XFORM_PRECOMP=yes ../racketcgc -cqu ../../../racket/gc2/xform.rkt --setup . --depends --cpp "gcc -E -I./.. -I../../../racket/gc2/../include -I../../../racket/gc2/../../rktio -I../../rktio -g -O2 -DOS_X -D_DARWIN_UNLIMITED_SELECT -fno-common -DUSE_SENORA_GC -Wno-nullability-completeness " --keep-lines -o xsrc/precomp.h ../../../racket/gc2/precomp.c
default-load-handler: cannot open module file
module path: racket/base
path: /Users/scott/Downloads/racket-6.11/share/pkgs/draw-lib/racket/base.rkt
system error: No such file or directory; errno=2
context...:
standard-module-name-resolver
/Users/scott/Downloads/racket-6.11/src/racket/gc2/xform.rkt:97:24
retry
/Users/scott/Downloads/racket-6.11/src/racket/gc2/xform.rkt: [running body]
make[4]: *** [xsrc/precomp.h] Error 1
make[3]: *** [all] Error 2
make[2]: *** [3m] Error 2
make[1]: *** [3m] Error 2
make: *** [all] Error 2

:( thank you for trying

Well - now I’m wondering what’s up! The file ‘path: /Users/scott/Downloads/racket–6.11/share/pkgs/draw-lib/racket/base.rkt’ is NOT in the /share/…/draw-lib/racket directory

@scott.watson Do you have any environment variables set, especially ones that include “PLT” in the name?

Maybe PLTCOLLECTS
?

maybe… :confused:

that would explain a thing or two..

And we’re building again… :slightly_smiling_face:

If you had environment variables set, you may not need to build after all. That would affect all of your attempts to run Racket.

Yep - I thought sudo left your local env alone and just elevated your permissions, but it resets the env! Honestly - it’s the first thing that should have occured to me.

And ALL is well. THANKS EVERYONE!

I didn’t know that either, but it does make sense in retrospect

btw… it was from years ago. Fun to have a reason to be back in the world of modern schemes!

Running raco setup -D <collection>
compiles modules but not docs. Is there a way to invert this, to only compile docs?

I don’t think so. (It would be impossible to build some docs if some compiled files were out of date.)

Then is it possible to make raco compile only when needed, like make?

Or am I missing some bigger picture? I develop in Emacs, FWIW.

if you run raco make file.rkt
on the same file twice, racket won’t re-compile it

and raco setup collection-name
should run a little faster if only documentation changed since the last setup

does that help?

Sure, thansk @ben.

I was hoping for an easy raco setup
switch because recompiling takes “forever.”

Like 10 seconds sometimes

raco setup
, by default, inspects everything to see if it needs to be rebuilt, but it will still only actually rebuild things that changed. You can restrict the things it checks by passing a package with --pkgs
or a collection with -l
.

On my computer, it takes ~4.5 secs to run raco setup <collection>
with no changes. Most of that time is on raco setup: --- building documentation ---
.

@lexi.lambda the switches have no effect on run time. Compiling after a small change to docs pushes the dining time to 11 seconds, where raco setup
explains which scribble files are being compiled and rendered.

Haha dining time. Autocorrect must be hungry.

I guess 4 is better than 11, but both are higher than expected.

does raco setup
determine what changed based on timestamps of all files in collection directories?

hmm, this section of docs suggests it just does whatever raco make
does: > Running raco setup is sensitive to the PLT_COMPILED_FILE_CHECK environment variable in the same way as raco make. https://docs.racket-lang.org/raco/running.html

and then in raco make
it says it has to SHA1 hash every module to check for changes: > The raco make command accept filenames for Racket modules to be compiled to bytecode format. Modules are re-compiled only if the source Racket file is newer than the bytecode file and has a different SHA–1 hash, or if any imported module is recompiled or has a different SHA–1 hash for its compiled form plus dependencies.

Yes, raco setup
/ raco make
checks the timestamp; it the timestamp is newer, then it double-checks the SHA–1. (It won’t try a SHA–1 check if the timestamps are older.) It doesn’t have to check modules recursively, though, so there are plenty of dependencies of just racket/base
to check.

According to raco setup -v <collection>
, ~50% of the time is while using: <pkgs>/[...].scrbl

And by raco setup -D <collection>
, the other ~50% is deciding not to compile everything before docs.

I think the primary way to speed it up would be architectural changes - raco make
could rely on a daemon that listened for filesystem events for instance. Then the daemon could reliably tell raco make
to skip entire directory trees.

since AFAIK, it’s not common for an OS to provide an API to get the timestamp of when any file in a directory tree changed (at least, not that’s faster than just checking the timestamps of every file in the tree)

This would speed up my Linux workflow. Not sure how portable change notification is these days.

No idea. Still need the daemon though, otherwise two distinct raco make
calls have no way of sharing event listening state.

@notjack I think there are other ways it could be optimized, for example racket looks at a lot of paths to find the right one, and avoiding some IO calls would help, I think

@samth by “primary way” I mean that I think that approach is the only way to get an algorithmic speedup, such that the absolute minimum amount of IO syscall work running plain raco setup
has to do is reduced from O(module-files)
to O(root-collection-directories) + O(changed-module-files)
- I’m sure there’s room for other constant-factor improvements

another way to get algorithmic speedup is to do finer-grained dependency tracking, so that you can avoid looking at some files that are currently examined

I don’t know how that would work across two distinct raco setup
calls - how could the second call know that all files in a collection tree can be skipped without checking the timestamps of each one and comparing to timestamps recorded in the first call? since nobody’s listening for changes in between the two calls, the first call can’t reliably record any information about whole directory tree change timestamps

i just mean that it could reduce the # of module-files in your equation

hmm, I don’t think I understand what you have in mind