Re: [racket-dev] [plt] Push #29214: master branch updated

2014-09-04 Thread Jay McCarthy
My best understanding is that the problem is that path->pkg is used by
"raco setup" to tell whether unstated dependencies are present. If
files from collects/ are in a package, then everything needs to depend
on "base" (which is inconvenient) including other files in collects/
but the files in collects/ aren't part of a package that has
dependencies and "base" isn't actually considered installed (at least
during the collects/ part.)

As mentioned, I also tried "racket" as the package, but that had a
very similar (but slightly different) crash.

Jay


On Wed, Sep 3, 2014 at 6:22 PM, Sam Tobin-Hochstadt
 wrote:
> On Wed, Sep 3, 2014 at 10:53 AM, Jay McCarthy  wrote:
>> I need to revert this because it horribly breaks the bootstrapping
>> phase. It may be possible to make the core have a package in the
>> future, but it's not an easy change.
>
> Is this because code expects #f instead of "base"? Or for some other reason?
>
> Sam



-- 
Jay McCarthy
http://jeapostrophe.github.io

   "Wherefore, be not weary in well-doing,
  for ye are laying the foundation of a great work.
And out of small things proceedeth that which is great."
  - D&C 64:33
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] [plt] Push #29214: master branch updated

2014-09-03 Thread Sam Tobin-Hochstadt
On Wed, Sep 3, 2014 at 10:53 AM, Jay McCarthy  wrote:
> I need to revert this because it horribly breaks the bootstrapping
> phase. It may be possible to make the core have a package in the
> future, but it's not an easy change.

Is this because code expects #f instead of "base"? Or for some other reason?

Sam
_
  Racket Developers list:
  http://lists.racket-lang.org/dev


Re: [racket-dev] [plt] Push #29214: master branch updated

2014-09-03 Thread Jay McCarthy
I need to revert this because it horribly breaks the bootstrapping
phase. It may be possible to make the core have a package in the
future, but it's not an easy change.

Jay

On Wed, Sep 3, 2014 at 10:44 AM,   wrote:
> jay has updated `master' from b942a21846 to 92d5408aa8.
>   http://git.racket-lang.org/plt/b942a21846..92d5408aa8
>
> =[ One Commit ]=
> Directory summary:
>3.9% pkgs/racket-pkgs/racket-test/tests/pkg/
>   96.0% racket/collects/pkg/
>
> ~~
>
> 92d5408 Jay McCarthy  2014-09-03 10:43
> :
> | Fix PR14692
> :
>   M pkgs/racket-pkgs/racket-test/tests/pkg/path.rkt |   7 ++
>   M racket/collects/pkg/path.rkt| 113 
> -
>
> =[ Overall Diff ]===
>
> pkgs/racket-pkgs/racket-test/tests/pkg/path.rkt
> ~~~
> --- OLD/pkgs/racket-pkgs/racket-test/tests/pkg/path.rkt
> +++ NEW/pkgs/racket-pkgs/racket-test/tests/pkg/path.rkt
> @@ -1,10 +1,17 @@
>  #lang racket/base
>  (require pkg/path
> + syntax/modresolve
>   setup/dirs)
>
>  (module+ test
>(require rackunit)
>
> +  (check-equal? (path->pkg (resolve-module-path 'typed/racket #f))
> +"typed-racket-lib")
> +
> +  (check-equal? (path->pkg (resolve-module-path 'racket #f))
> +"base")
> +
>(check-equal? (path->pkg (collection-file-path "path.rkt" "tests" "pkg"))
>  "racket-test")
>(check-equal? (call-with-values
>
> racket/collects/pkg/path.rkt
> 
> --- OLD/racket/collects/pkg/path.rkt
> +++ NEW/racket/collects/pkg/path.rkt
> @@ -69,6 +69,9 @@
> [orig-pkg `(catalog ,(cadr (pkg-info-orig-pkg 
> v)))])
>v)
>
> +(define (mbind m f)
> +  (and m (f m)))
> +
>  (define (path->pkg+subpath+collect* who given-p cache want-collect?)
>(unless (path-string? given-p)
>  (raise-argument-error who "path-string?" given-p))
> @@ -88,62 +91,72 @@
>(define p (explode given-p))
>(define (build-path* l)
>  (if (null? l) 'same (apply build-path l)))
> -  (for/fold ([pkg #f] [subpath #f] [collect #f])
> -  ([scope (in-list (list* 'user
> -  (get-pkgs-search-dirs)))]
> -   #:when (not pkg))
> -(define d (or (and cache
> -   (hash-ref cache `(dir ,scope) #f))
> -  (let ([d (explode (get-pkgs-dir scope))])
> -(when cache (hash-set! cache `(dir ,scope) d))
> -d)))
> -(define (read-pkg-db/cached)
> -  (or (and cache
> -   (hash-ref cache `(db ,scope) #f))
> -  (let ([db (read-pkgs-db scope)])
> -(when cache (hash-set! cache `(db ,scope) db))
> -db)))
> -(cond
> - [(sub-path? < p d)
> -  ;; Under the installation mode's package directory.
> -  ;; We assume that no one else writes there, so the
> -  ;; next path element is the package name (or the package
> -  ;; name followed by "+")
> -  (define len (length d))
> -  (define pkg-name (path-element->string (list-ref p len)))
> -  (if (regexp-match? #rx"pkgs[.]rktd" pkg-name)
> -  (values #f #f #f) ; don't count the database as a package
> -  (values (if (regexp-match? #rx"[+]" pkg-name) ; + used as an 
> alternate path, sometimes
> +  (define cdp (mbind (find-collects-dir) explode))
> +  (cond
> +[(and cdp (sub-path? < p cdp))
> + (define len (length cdp))
> + ;; This might need to be something else in the future, if base
> + ;; gets smaller
> + (values "base"
> + (build-path* (list-tail p (add1 len)))
> + #f)]
> +[else
> + (for/fold ([pkg #f] [subpath #f] [collect #f])
> + ([scope (in-list (list* 'user
> + (get-pkgs-search-dirs)))]
> +  #:when (not pkg))
> +   (define d (or (and cache
> +  (hash-ref cache `(dir ,scope) #f))
> + (let ([d (explode (get-pkgs-dir scope))])
> +   (when cache (hash-set! cache `(dir ,scope) d))
> +   d)))
> +   (define (read-pkg-db/cached)
> + (or (and cache
> +  (hash-ref cache `(db ,scope) #f))
> + (let ([db (read-pkgs-db scope)])
> +   (when cache (hash-set! cache `(db ,scope) db))
> +   db)))
> +   (cond
> + [(sub-path? < p d)
> +  ;; Under the installation mode's package directory.
> +  ;; We assume that no one else writes there, so the
> +  ;; next path element is the package name (or the package
> +  ;; name followed by "+")
> +  (define len (length d))
> +  (define pkg-name (path-element->string (list-ref p len)))
> +  (if (regexp-match? #rx"pkgs[.]rktd" pkg-name)
> +(values #f #f #f) ; do