# \`for-space\` in the \`provide\` form?

**URL:** <https://racket.discourse.group/t/for-space-in-the-provide-form/1715>\
**Category:** Questions & Answers\
**Tags:** question\
**Created:** [February 15, 2023, 3:26am UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715 "2023-02-15T03:26:50Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antigen-11](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/antigen-11/32/1813_2.png) [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Post date:** [February 15, 2023, 3:26am UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715/1 "2023-02-15T03:26:50Z")

</div>

According to the [for-space](https://docs.racket-lang.org/reference/require.html#%28form._%28%28lib._racket%2Fprivate%2Fbase..rkt%29._for-space%29%29),

> Like the union of the provide-specs, but adjusted to apply to the [binding space](https://docs.racket-lang.org/reference/syntax-model.html#%28tech._binding._space%29) specified by space—where space is either an identifier or #f for the [default binding space](https://docs.racket-lang.org/reference/syntax-model.html#%28tech._default._binding._space%29).

But I got an error as follows.

```scheme
> (module a racket/base
    (provide (for-space #f +)))
make-export: contract violation
  expected: phase+space?
  given: '(0 . #f)
 [,bt for context]

```

And there seems to be an issue describing an analogous phenomenon on [Github](https://github.com/racket/racket/issues/3932).

Is this a bug? Or what can I do to repair it?

---

<div class="post-metadata">

**Author:** ![mflatt](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/mflatt/32/6_2.png) [@mflatt](https://racket.discourse.group/u/mflatt)\
**Post date:** [February 15, 2023, 3:31am UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715/2 "2023-02-15T03:31:29Z")

</div>

Yes, this was a bug. It was fixed only recently, unfortunately, and I don't have a workaround to offer, but you could try a snapshot build via [https://snapshot.racket-lang.org/](https://snapshot.racket-lang.org/).

---

<div class="post-metadata">

**Author:** ![Antigen-11](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/antigen-11/32/1813_2.png) [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Post date:** [February 15, 2023, 3:52am UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715/3 "2023-02-15T03:52:49Z")

</div>

I tried to install several packages with it, and then got an error like this:

```scheme
raco setup: error: during making for <pkgs>/rackjure/rackjure (rackjure)
raco setup: invalid memory reference. Some debugging context lost
raco setup: compiling: <pkgs>/rackjure/rackjure/rackjure.scrbl
raco setup: error: during making for <pkgs>/sugar/sugar/unstable
raco setup: invalid memory reference. Some debugging context lost
raco setup: compiling: <pkgs>/sugar/sugar/unstable/string.rkt

```

---

<div class="post-metadata">

**Author:** ![mflatt](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/mflatt/32/6_2.png) [@mflatt](https://racket.discourse.group/u/mflatt)\
**Post date:** [February 15, 2023, 6:04am UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715/4 "2023-02-15T06:04:34Z")

</div>

That does not look good. Which platform are you running on, and which snapshot site did you download from?

---

<div class="post-metadata">

**Author:** ![Antigen-11](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/antigen-11/32/1813_2.png) [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Post date:** [February 15, 2023, 7:03am UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715/5 "2023-02-15T07:03:58Z")

</div>

[snapshot](https://users.cs.utah.edu/plt/snapshots/current/installers/racket-8.8.0.8-x86_64-linux-xenial-cs.sh)

On x64, Ubuntu22.04.

---

<div class="post-metadata">

**Author:** ![mflatt](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/mflatt/32/6_2.png) [@mflatt](https://racket.discourse.group/u/mflatt)\
**Post date:** [February 15, 2023, 7:29am UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715/6 "2023-02-15T07:29:19Z")

</div>

Thanks! I haven't been able to replicate the problem, so far. Are there packages other than `rackjure` and `sugar` that you installed?

---

<div class="post-metadata">

**Author:** ![Antigen-11](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/antigen-11/32/1813_2.png) [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Post date:** [February 15, 2023, 7:42am UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715/7 "2023-02-15T07:42:50Z")

</div>

`raco` automatically installed these two packages in order to setup pollen, racket-langserver and rash.

---

<div class="post-metadata">

**Author:** ![mflatt](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/mflatt/32/6_2.png) [@mflatt](https://racket.discourse.group/u/mflatt)\
**Post date:** [February 15, 2023, 9:15am UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715/8 "2023-02-15T09:15:23Z")

</div>

Still no crash for me. Let me know if you think of something about your environment that I might be missing.

Do you see the crash again if you use `raco pkg remove --auto pollen racket-langserver rash` and then `raco pkg install --auto pollen racket-langserver rash` again?

---

<div class="post-metadata">

**Author:** ![Antigen-11](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/antigen-11/32/1813_2.png) [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Post date:** [February 15, 2023, 9:55am UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715/9 "2023-02-15T09:55:32Z")

</div>

This time another error is raised:

```scheme
raco setup: error: during making for <pkgs>/parsack-test/parsack/examples
raco setup: illegal instruction. Some debugging context lost
raco setup: compiling: <pkgs>/parsack-test/parsack/examples/url-query-parser.rkt
raco pkg install: packages installed, although setup reported errors

```

---

<div class="post-metadata">

**Author:** ![Antigen-11](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/antigen-11/32/1813_2.png) [@Antigen-11](https://racket.discourse.group/u/Antigen-11)\
**Post date:** [February 15, 2023, 10:02am UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715/10 "2023-02-15T10:02:06Z")

</div>

But when I setup those collections manually, I never met these errors.

---

<div class="post-metadata">

**Author:** ![mflatt](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/mflatt/32/6_2.png) [@mflatt](https://racket.discourse.group/u/mflatt)\
**Post date:** [February 16, 2023, 11:18pm UTC](https://racket.discourse.group/t/for-space-in-the-provide-form/1715/11 "2023-02-16T23:18:27Z")

</div>

I still have no good ideas, but some possible things to explore:

- Do the executables from the Northwestern builds behave any differently? I think they end up linking with a different version of ncurses, for example, although I don't see how that would be relevant to `raco setup`.

- Does it matter if you leave out one of the packages, such as installing only `pollen` and `racket-langserver`?
