diff --git a/Makefile b/Makefile index 7d1b32e3d9..6757f2a985 100644 --- a/Makefile +++ b/Makefile @@ -159,7 +159,8 @@ racket/src/build/Makefile: racket/src/configure racket/src/Makefile.in # Catalog for sources and native packages; use "local" to bootstrap # from package directories (in the same directory as this makefile) # plus the GitHub repository of raw native libraries. Otherwise, it's -# a URL (spaces allowed). +# a catalog URL (spaces allowed), and the catalog is copied to ensure +# consistency across queries: SRC_CATALOG = local # A URL embedded in documentation for remote searches, where a Racket @@ -284,7 +285,7 @@ WIN32_RACO = racket\racket $(USER_CONFIG) -N raco -l- raco X_AUTO_OPTIONS = --skip-installed --deps search-auto --pkgs $(JOB_OPTIONS) USER_AUTO_OPTIONS = --scope user $(X_AUTO_OPTIONS) LOCAL_USER_AUTO = --catalog build/local/catalog $(USER_AUTO_OPTIONS) -SOURCE_USER_AUTO_q = --catalog "$(SRC_CATALOG)" $(USER_AUTO_OPTIONS) +SOURCE_USER_AUTO_q = --catalog build/catalog-copy $(USER_AUTO_OPTIONS) REMOTE_USER_AUTO = --catalog $(SVR_CAT) $(USER_AUTO_OPTIONS) REMOTE_INST_AUTO = --catalog $(SVR_CAT) --scope installation $(X_AUTO_OPTIONS) CONFIG_MODE_q = "$(CONFIG)" "$(CONFIG_MODE)" @@ -389,7 +390,12 @@ fresh-user: rm -rf build/user set-server-config: - $(RACKET) -l distro-build/set-server-config build/user/config/config.rktd $(CONFIG_MODE_q) "$(DOC_SEARCH)" "" "" "" + $(RACKET) -l distro-build/set-server-config build/user/config/config.rktd $(CONFIG_MODE_q) "" "" "$(DOC_SEARCH)" "" + +server-cache-config: + $(RACO) pkg config -i --set download-cache-dir build/cache + $(RACO) pkg config -i --set download-cache-max-files 1023 + $(RACO) pkg config -i --set download-cache-max-bytes 671088640 # Install packages from the source copies in this directory. The # packages are installed in user scope, but we set the add-on @@ -408,9 +414,12 @@ packages-from-local: # `SRC_CATALOG': build-from-catalog: $(MAKE) fresh-user + rm -rf build/catalog-copy + $(RACO) pkg catalog-copy "$(SRC_CATALOG)" build/catalog-copy + $(MAKE) server-cache-config $(RACO) pkg install --all-platforms $(SOURCE_USER_AUTO_q) $(REQUIRED_PKGS) $(DISTRO_BUILD_PKGS) $(MAKE) set-server-config - $(RACKET) -l- distro-build/pkg-info -o build/pkgs.rktd $(SRC_CATALOG) + $(RACKET) -l- distro-build/pkg-info -o build/pkgs.rktd build/catalog-copy $(RACKET) -l distro-build/install-pkgs $(CONFIG_MODE_q) "$(PKGS)" $(SOURCE_USER_AUTO_q) --all-platforms $(RACO) setup --avoid-main $(JOB_OPTIONS) diff --git a/racket/collects/pkg/lib.rkt b/racket/collects/pkg/lib.rkt index a8fec591d5..9312c7547d 100644 --- a/racket/collects/pkg/lib.rkt +++ b/racket/collects/pkg/lib.rkt @@ -2655,14 +2655,10 @@ (update-pkg-cfg! 'installation-name val)] [(list (and key "download-cache-dir") val) - (unless (complete-path? val) - (pkg-error (~a "invalid value for config key\n" - " not an absolute path\n" - " config key: ~a\n" - " given value: ~a") - key - val)) - (update-pkg-cfg! (string->symbol key) val)] + (update-pkg-cfg! (string->symbol key) (if (complete-path? val) + val + (path->string + (path->complete-path val))))] [(list (and key (or "download-cache-max-files" "download-cache-max-bytes")) val)