pocmatos
2018-6-5 13:40:51

Why is it that if I do a raco setup --clean --pkgs s10, it will issue a clean on all packages instead of just s10? I started noticing this after making the racket directory read-only.


greg
2018-6-5 13:53:02

@pocmatos I’m not sure. By “all packages” do you mean the entire Racket installation? I tend to be set-and-forget with raco commands because I usually have a Makefile for each project. The clean target is something like: # Note: Each collection's info.rkt can say what to clean, for example # (define clean '("compiled" "doc" "doc/<collect>")) to clean # generated docs, too. clean: raco setup --fast-clean --pkgs $(PACKAGE-NAME)


greg
2018-6-5 13:54:27

(And in Emacs I have a keybinding for projectile-compile-project. So I type that, and type e.g. make setup or make clean (it remembers the last-entered).)


pocmatos
2018-6-5 13:54:48

I do very similar… my output looks like: raco setup --fast-clean --pkgs s10 raco setup: version: 6.12 raco setup: platform: x86_64-linux [3m] raco setup: installation name: 6.12 raco setup: variants: 3m raco setup: main collects: /home/pmatos/installs/racket-6.12/collects raco setup: collects paths: raco setup: /home/pmatos/.racket/6.12/collects raco setup: /home/pmatos/installs/racket-6.12/collects raco setup: main pkgs: /home/pmatos/installs/racket-6.12/share/pkgs raco setup: pkgs paths: raco setup: /home/pmatos/installs/racket-6.12/share/pkgs raco setup: /home/pmatos//.racket/6.12/pkgs raco setup: links files: raco setup: /home/pmatos/installs/racket-6.12/share/links.rktd raco setup: /home/pmatos//.racket/6.12/links.rktd raco setup: main docs: /home/pmatos/installs/racket-6.12/doc raco setup: --- cleaning collections --- raco setup: deleting: in <pkgs>/eli-tester/tests delete-file: cannot delete file path: /home/pmatos/installs/racket-6.12/share/pkgs/eli-tester/tests/compiled/eli-tester_rkt.dep system error: Permission denied; errno=13 ...


pocmatos
2018-6-5 13:54:56

followed by long backtraces.


pocmatos
2018-6-5 13:55:40

I am curious, is your racket folder writable? I have purposefully done a chmod -w -R /home/pmatos/installs/racket-6.12. All started falling apart, which as quite surprising.


greg
2018-6-5 13:56:34

I assume it’s writable — whatever default would be on macOS.


greg
2018-6-5 13:58:00

I’m surprised only because I do “clean” fairly frequently, and the subsequent “setup” is not taking the many many many minutes it would if it were rebuilding all of Racket.


greg
2018-6-5 13:59:13

(And/or, the execution of my program isn’t taking the many many minutes it would, if there were no zos and it were expanding the universe from scratch :smile:)


greg
2018-6-5 13:59:43

So honestly I never looked to carefully into what --fast-clean cleans exactly; it’s just seemed to do what I expected.


greg
2018-6-5 14:05:30

@pocmatos Is s10 actually installed as a package — i.e. do you see it in raco pkg show?


pocmatos
2018-6-5 14:08:19

yes, it shows up. it’s a dev install - link.


pocmatos
2018-6-5 14:08:45

also, if I do raco setup --pkgs s10, it succeeds but I get:


pocmatos
2018-6-5 14:09:20
raco setup: WARNING: with-output-to-file: error deleting file
  path: /home/pmatos/installs/racket-6.12/share/info-cache.rktd
  system error: Permission denied; errno=13

pocmatos
2018-6-5 14:09:57

I always install my rackets in my home dir, but I wonder how it works if it’s installed system-wide. This kind of thing would never work, that’s why I am surprised this is happening.


pocmatos
2018-6-5 14:10:17

Unless racket just does this when it detects it’s installation to be in a user home.


greg
2018-6-5 14:11:43

Is the double slash in /home/pmatos//.racket/6.12/pkgs correct and if so what does that mean?


greg
2018-6-5 14:12:34

(Also /home/pmatos//.racket/6.12/links.rktd)


pocmatos
2018-6-5 14:20:09

I am not sure why the double slash shows but that’s correct. it’s basically the racket home dir in $HOME/.racket


greg
2018-6-5 14:33:21

@pocmatos Sorry, I don’t know. Just FYI, make clean on frog for me does: make clean raco setup --fast-clean --pkgs frog raco setup: version: 6.10 raco setup: platform: x86_64-macosx [3m] raco setup: installation name: 6.10 raco setup: variants: 3m raco setup: main collects: /Applications/Racket_v6.10/collects raco setup: collects paths: raco setup: /Users/greg/Library/Racket/6.10/collects raco setup: /Applications/Racket_v6.10/collects raco setup: main pkgs: /Applications/Racket_v6.10/share/pkgs raco setup: pkgs paths: raco setup: /Applications/Racket_v6.10/share/pkgs raco setup: /Users/greg/Library/Racket/6.10/pkgs raco setup: links files: raco setup: /Applications/Racket_v6.10/share/links.rktd raco setup: /Users/greg/Library/Racket/6.10/links.rktd raco setup: main docs: /Applications/Racket_v6.10/doc raco setup: --- cleaning collections --- raco setup: deleting: in <pkgs>/frog/frog raco setup: deleting: in <pkgs>/frog/frog/config raco setup: deleting: in <pkgs>/frog/frog/config/lang raco setup: deleting: in <pkgs>/frog/frog/config/private raco setup: deleting: in <pkgs>/frog/frog/private raco setup: deleting: in <pkgs>/frog/frog/private/enhance-body/add-doc-links raco setup: deleting: in <pkgs>/frog/frog/private/enhance-body/syntax-highlight raco setup: deleting: in <pkgs>/frog/frog/private/upgrade After which my other pkgs, both personal and Racket-supplied, still have zos/deps — they were not deleted.


greg
2018-6-5 14:35:25

By any chance does your info.rkt for s10 have a (define clean ___) that includes eli-tester ??


greg
2018-6-5 14:37:38

@pocmatos Oh. Hmm. Does s10 happen to have a tests subdirectory?


greg
2018-6-5 14:38:02

greg
2018-6-5 14:39:19

I guess what I’m getting at is the docs say, bold mine: > —pkgs ‹pkg› … — constrain setup actions to collections that are within (or partially within) the named ‹pkg›s.


pocmatos
2018-6-5 14:39:33

hummm, i have a tests subfolder but nowhere I have a (define clean __).


greg
2018-6-5 14:40:00

I wonder if s10 and eli-tester packages could somehow both be contributing to a tests collection


pocmatos
2018-6-5 14:40:18

but interestingly I don’t even know what eli-tester is, I imagine it’s a dep of rackunit but I don’t use eli-tester directly at all.


greg
2018-6-5 14:40:18

And that “intersection” causes --fast-clean to try to clean both contributing packages.


pocmatos
2018-6-5 14:40:30

hummm, interesting.


greg
2018-6-5 14:40:42

I don’t know if that even makes sense ¯_(ツ)_/¯


pocmatos
2018-6-5 14:40:55

I do have a tests directory that doesn’t define a collection name.


pocmatos
2018-6-5 14:41:14

if it defaults to ‘tests’ then maybe it becomes part of eli-tester?


pocmatos
2018-6-5 14:41:23

what are you doing in frog? will check…


pocmatos
2018-6-5 14:41:46

oh, you have no tests dir…


pocmatos
2018-6-5 14:42:45

rosette has a test dir instead of tests. I will probably clash with rosette if I rename my folder to test.


pocmatos
2018-6-5 14:43:17

was not aware that collections could clash like this. I expected all to be somehow encapsulated by the project name, although I know little about package/collection internals.


pocmatos
2018-6-5 14:43:31

maybe I should name by tests as s10-tests and retry.


samth
2018-6-5 14:44:37

you can have multiple packages that all have tests directories


greg
2018-6-5 14:46:14

But if they’re packages whose info.rkt has (define collection 'multi), don’t each of the top-level directories end up being collections of those names?


samth
2018-6-5 14:47:20

yes, but collections can have files from multiple packages


pocmatos
2018-6-5 14:47:46

officially confused


greg
2018-6-5 14:48:07

This is a feature I’ve never wanted to use for the pkgs I’ve happened to write, so, I’ve always found it a bit confusing.


greg
2018-6-5 14:48:17

But IIUC one use case is a data collection


greg
2018-6-5 14:48:29

And you want different pkgs to be able to contribute different data structures.


pocmatos
2018-6-5 14:48:30

so a collection name can clash with any package known by racket?


samth
2018-6-5 14:48:47

I’m not sure what you mean by clash


pocmatos
2018-6-5 14:49:02

if i create a package with a collection called frog, add it to pkgs, will I cause problems when frog tries to build?


samth
2018-6-5 14:49:16

no


pocmatos
2018-6-5 14:49:56

how come my tests folder, seems to require eli-tester to be recompiled?


samth
2018-6-5 14:50:55

do your tests depend on eli-tester?


pocmatos
2018-6-5 14:51:38

no.


samth
2018-6-5 14:51:50

then that seems weird


pocmatos
2018-6-5 14:52:08

they might depend on something, that depends on eli-tester though. Is there a way to print the dep tree?


samth
2018-6-5 14:52:29

there’s a gui visualizer by mflatt that’s a package


pocmatos
2018-6-5 14:52:35

This is what I have on my root info.pkg: (define deps '("benchmark" "profile-flame-graph" "profile-lib" "errortrace-lib" "aws" "rosette" "htdp-lib" "parser-tools-lib" "anaphoric" "rackunit-lib" "base")) (define build-deps '("scribble-lib" "quickcheck" "rackunit" "racket-doc"))


pocmatos
2018-6-5 14:54:34

samth
2018-6-5 14:57:02

no



greg
2018-6-5 15:10:22

@samth It looks to me that the eli-tester package contributes an eli-tester.rkt module to the tests collection. So e.g. to use it I must (require tests/eli-tester) If @pocmatos has a (define collection 'multi) in the info.rkt for his s10 package, and he has a tests top-level subdir, then that means he is also contributing stuff within to the tests collection. Therefore, that is why raco setup --fast-clean --pkgs s10 is trying to delete zos/deps from eli-tester. The docs say (bold mine): > —pkgs ‹pkg› … — constrain setup actions to collections that are within (or partially within) the named ‹pkg›s. And in his case, that’s failing because read-only Racket install dir. ^^^ This is my “theory of the bug a.k.a. surprising behavior” :smile: Yay? Nay?


samth
2018-6-5 15:10:50

yes, that sounds plausible


samth
2018-6-5 15:11:20

that --pkgs p means do things to all of any collection that p has some files in


greg
2018-6-5 15:19:56

@pocmatos So depending on what s10 is, one simple thing might be to move almost everything except README and info.rkt down into an s10 subdirectory of your existing s10 “project” directory. That way, your tests folder is a s10/tests collection instead of a tests collection. In fact that foo/foo/* layout is probably a good pattern for any (define collection 'multi) that’s really just supplying a single collection. OR, use the single-collection incantation I can’t remember because it didn’t exist when I first learned about packages. :slightly_smiling_face:


samth
2018-6-5 15:21:26

@pocmatos is there actually a problem that needs to be solved here?



greg
2018-6-5 15:22:52

TL;DR raco setup --clean or --fast-clean fails because his Racket dir is read-only and eli-tester is in there


greg
2018-6-5 15:23:15

We were both confused how/why that could be.


pocmatos
2018-6-5 15:23:37

@greg @samth sorry, was interrupted by my kids. still need to investigate what’s going on on this side.


samth
2018-6-5 15:24:04

what if you pass --avoid-main?


pocmatos
2018-6-5 15:26:26

@greg i think you are on the money with your explanation regarding the problem.


pocmatos
2018-6-5 15:26:50

Might need a s10/s10 directory structure then.


samth
2018-6-5 15:27:30

I really think you don’t need to change anything


pocmatos
2018-6-5 15:27:54

--avoid-main seems to do the trick.


pocmatos
2018-6-5 15:29:00

@samth it seems a should do something, I don’t think it’s the correct behaviour to have racket confuse my tests with eli-tester tests collection.


pocmatos
2018-6-5 15:29:25

using --avoid-main looks to me as being just a workaround.


samth
2018-6-5 15:29:53

it’s not confusing things, it’s just that --pkgs s10 doesn’t have as narrow a scope as you might want


pocmatos
2018-6-5 15:31:52

But at the same time, racket thinks that there’s a connection between my tests and eli-tester tests so it sounds like I should clarify that. Not just for now, but in the future, I certainly wouldn’t want another sudden surprise because my tests and eli-tester tests files are in the same collection.


samth
2018-6-5 15:33:14

no, Racket doesn’t think there’s a connection


samth
2018-6-5 15:34:00

what’s happening is that raco setup --pkgs s10 looks at the s10 package, and sees what collections are in it, such as s10 and tests, and then does the equivalent of raco setup s10 tests


greg
2018-6-5 15:36:07

ICYI https://github.com/LeifAndersen/racket-_/tree/master seems to be an example of a single-collection package <=> https://pkgs.racket-lang.org/package/_


pocmatos
2018-6-5 15:36:18

i understand that. but when it does raco setup ... tests it seems confusing to me, that racket goes pick up eli-tester tests collection to clean/setup.


abmclin
2018-6-5 15:37:47

Is it because a collection can have multiple root directories contributed from different packages, so when one root directory is cleaned or setup, all other root directories receive the same treatment in case there are cross-references in documentation files?


samth
2018-6-5 15:38:37

@pocmatos raco setup tests means “run setup in all the places that have a tests collection”, which happens to include eli-tester (but there’s nothing special about eli-tester in this)


pocmatos
2018-6-5 15:39:59

Understood but the downside is of course, that if I have other packages installed which happen to have a tests collection, then I am suddenly cleaning/rebuilding those collection when it was not my initial intention to do so.


samth
2018-6-5 15:40:39

right, the implementation isn’t as precise as it could be, and so it sometimes does extra work (and this is more annoying for --clean)


samth
2018-6-5 15:41:08

I think it works this way because raco setup is collection-oriented


samth
2018-6-5 15:41:13

but I’m not certain


pocmatos
2018-6-5 15:41:26

ok.


pocmatos
2018-6-5 15:42:22

i certainly need to understand this better but I think this discussion was already a great help.


ben
2018-6-5 17:47:07

@samth quick update on immutable vectors: I have a small program that takes a long time to typecheck, and the time seems to be spent in infer.rkt when the args to infer are: X = (g49724 g49725) Y = () S = ((U (Immutable-Vectorof Exact-Rational) (Mutable-Vectorof Exact-Rational))) T = ((U (Immutable-Vectorof (U g49724 g49725)) (Mutable-Vectorof (U g49724 g49725)))) R = g49724 (edit: simplified S,T — its still slow with this smaller list of arguments)


ben
2018-6-5 17:47:35

its much faster if the program uses only Mutable-Vectorof, and also if I solve for each var in X one-by-one


ben
2018-6-5 17:48:24

do you know if (1) this is just a bad question to ask infer in the first place or (2) there might be a way to get the answer faster ?


samth
2018-6-5 17:51:36

that should definitely be fast


samth
2018-6-5 17:52:05

if you change Exact-Rational to String is it much faster?


samth
2018-6-5 17:52:26

can you write a program that just makes that call to infer?


ben
2018-6-5 17:56:46

I’ll try those things — how would I make a program that just calls infer? (serialize the arguments?)


samth
2018-6-5 17:57:17

you just require various parts of typed racket


samth
2018-6-5 17:57:27

there are unit tests for infer that should be helpful as a guide


ben
2018-6-5 19:18:01

ok, finally, this test case is slow (15 seconds): (infer-t (Un (-ivec -Rat) (-mvec -Rat)) (Un (-ivec (Un (-v a) (-v b))) (-mvec (Un (-v a) (-v b)))) #:vars '(a b)) and changing -Rat to -String makes it fast


ben
2018-6-5 19:18:34

samth
2018-6-5 19:22:01

hmm, those changes seem fine


samth
2018-6-5 19:22:36

what if you change (-ivec E) to (-pair E (-val null))?


ben
2018-6-5 19:35:13

still slow


ben
2018-6-5 19:39:34

and this test takes 15 seconds for me on TR master: (infer-t (Un (-pair -Rat (-val null)) (-vec -Rat)) (Un (-pair (Un (-v a) (-v b)) (-val null)) (-vec (Un (-v a) (-v b)))) #:vars '(a b))


samth
2018-6-5 19:47:54

ok then it seems not to be your fault


ben
2018-6-5 19:49:37

I’m trying now to open a separate issue .. maybe we can get this fixed in a few days


ben
2018-6-5 19:50:02

because I would like to merge the vector PR before the 7th, but not if its going to slow down the math library like it does


samth
2018-6-5 19:59:14

you might look at the call trace of infer