# Passing INSTALL\_SETUP\_FLAGS to zuo

**URL:** <https://racket.discourse.group/t/passing-install-setup-flags-to-zuo/1260>\
**Category:** Questions & Answers\
**Created:** [August 27, 2022, 11:28pm UTC](https://racket.discourse.group/t/passing-install-setup-flags-to-zuo/1260 "2022-08-27T23:28:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bremner](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bremner](https://racket.discourse.group/u/bremner)\
**Post date:** [August 27, 2022, 11:28pm UTC](https://racket.discourse.group/t/passing-install-setup-flags-to-zuo/1260/1 "2022-08-27T23:28:43Z")

</div>

In the Debian build I previously relied on PLT\_SETUP\_OPTIONS to pass  
--do-docs to (the equivalent of) raco setup. Is there a suggested new  
way? I found that

```
 bin/zuo . install INSTALL_SETUP_FLAGS="$whatever"

```

works, but

```
 env INSTALL_SETUP_FLAGS="$whatever" bin/zuo . install

```

does not. Is this intentional? If so would it be possible to modify the  
generated Makefile to some environment variables to zuo? Presumably I  
could patch things, but that is just makework (geddit?).

For context, we build racket on about 10 architectures, several of which  
can run simple racket programs, but not build the racket docs.

d

---

<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:** [August 28, 2022, 12:32am UTC](https://racket.discourse.group/t/passing-install-setup-flags-to-zuo/1260/2 "2022-08-28T00:32:49Z")

</div>

This is intentional, but not obviously the right choice.

I avoided making Zuo scripts consult environment variables by default, because that has caused me occasional trouble in the past. That is, sometimes an environment variable happens to be set, and it affects a configuration in a way I didn't expect or intend. But I also see how Zuo configuration via environment variable can be useful.

Maybe usefulness outweighs the danger of unintentional configuration, and so defaulting via environment variables should be added. Another possibility is to have an environment variable that means "please use environment variables", or maybe "please use these specific environment variables".

Would a "please use environment variables" environment variable work for your setting? If so, does it seem like a good approach?

---

<div class="post-metadata">

**Author:** ![bremner](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bremner](https://racket.discourse.group/u/bremner)\
**Post date:** [August 28, 2022, 5:58pm UTC](https://racket.discourse.group/t/passing-install-setup-flags-to-zuo/1260/3 "2022-08-28T17:58:46Z")

</div>

Matthew Flatt via Racket Discussions  
[notifications@racket.discoursemail.com](mailto:notifications@racket.discoursemail.com) writes:

> Maybe usefulness outweighs the danger of unintentional configuration,  
> and so defaulting via environment variables should be added. Another  
> possibility is to have an environment variable that means "please use  
> environment variables", or maybe "please use these specific  
> environment variables".
> 
> Would a "please use environment variables" environment variable work  
> for your setting? If so, does it seem like a good approach?

That would be fine for us, as would having some fairly baroque  
environment variable names unlikely to be set by mistake. The latter  
approach has worked ok (prefixing the variables with RACKET\_BUILD e.g.)  
for me on much smaller projects. I have no preference, I just mention it  
in the spirit of brainstorming.

d

---

<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:** [August 30, 2022, 1:41pm UTC](https://racket.discourse.group/t/passing-install-setup-flags-to-zuo/1260/4 "2022-08-30T13:41:42Z")

</div>

Since changing the variable names and using long names is a pain, I've added support for a `ZUO_CONFIG_ENV_VARS` environment variable. Its value is a space-separated set of environment variable names to pull from the environment for defaults.

I haven't yet added a note about it to the Racket build instructions, but I'll do that.

---

<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:** [August 31, 2022, 3:34am UTC](https://racket.discourse.group/t/passing-install-setup-flags-to-zuo/1260/5 "2022-08-31T03:34:24Z")

</div>

On further investigation, I've concluded that `ZUO_CONFIG_ENV_VARS` is not worthwhile, so I'm reverting that change. Instead, I made `PLT_SETUP_OPTIONS` work as it used to, at least in combination with `make`. So, there's no need to set `ZUO_CONFIG_ENV_VARS` to get the old support for `PLT_SETUP_OPTIONS`.

It turns out that environment-variable support in Racket's old makefiles was rare. Almost all variables are explicitly defined, which hides any potential definition as an environment variable. The two main exceptions that I can find are `DESTDIR` and `PLT_SETUP_OPTIONS`. There was already support for `DESTDIR` by explicit propagation in the stub makefile. I made `PLT_SETUP_OPTIONS` handled in the same way, just like @bremner suggested in the first place, both for backward-compatibility and because it seems useful and has a sufficiently baroque name. Overall, I like how this makes environment-variable support explicit for the handful of names where it's meant to work.

The variables `SETUP_MACHINE_FLAGS` and `PLT_ISO` also previously could be set as environment variables. `PLT_ISO` was used just the same as `PLT_SETUP_OPTIONS`, and I didn't bother keeping that old name for the new makefiles. `SETUP_MACHINE_FLAGS` is used at the same time as `PLT_SETUP_OPTIONS`, but for the `racket` used to run `raco setup`; I didn't make that one work as an environment variable, because its name is not specific enough to Racket and it seems unlikely that anyone is using it. I'm open to adding support for a small number of additional environment variables as needed.

---

<div class="post-metadata">

**Author:** ![bremner](https://avatars.discourse-cdn.com/v4/letter/b/aca169/32.png) [@bremner](https://racket.discourse.group/u/bremner)\
**Post date:** [September 2, 2022, 2:06am UTC](https://racket.discourse.group/t/passing-install-setup-flags-to-zuo/1260/6 "2022-09-02T02:06:48Z")

</div>

Matthew Flatt via Racket Discussions  
[notifications@racket.discoursemail.com](mailto:notifications@racket.discoursemail.com) writes:

> On further investigation, I've concluded that `ZUO_CONFIG_ENV_VARS` is  
> not worthwhile, so I'm reverting that change. Instead, I made  
> `PLT_SETUP_OPTIONS` work as it used to, at least in combination with  
> `make`. So, there's no need to set `ZUO_CONFIG_ENV_VARS` to get the  
> old support for `PLT_SETUP_OPTIONS`.

I have cherry-picked the second version for the Debian packaging and it  
seems to work fine, no other changes needed for the packaging. Thanks  
for the quick response,

David
