Problem building racket in-place

91 views
Skip to first unread message

Reuben Thomas

unread,
Nov 8, 2019, 6:41:18 AM11/8/19
to Racket Users
I have a CONFIG_SITE environment variable which contains the following line:

test "$prefix" = NONE && prefix="$HOME_LOCAL"

(HOME_LOCAL is set to $HOME/.local)

Things then go wrong because racket/src/start/configure.ac code relies on prefix still being set to NONE in order to finally set prefix to `cd "${srcdfir}/.." && pwd`.

Is there some reason that prefix cannot be passed in from the top-level Makefile for an in-place build?

--

Matthew Flatt

unread,
Nov 12, 2019, 12:53:46 PM11/12/19
to Reuben Thomas, Racket Users
I think it would be ok to add `--prefix=NONE` to `CONFIG_IN_PLACE_ARGS`
in the top-level makefile (alongside `--enable-origtree`). Does that
solve the problem?


Matthew

Reuben Thomas

unread,
Nov 12, 2019, 5:47:47 PM11/12/19
to Matthew Flatt, Racket Users
Thanks for the suggestion! That doesn't work, because when configure is run, it reads CONFIG_SITE, loads my config file that checks `$prefix = NONE` (it is!), which thus overrides it.
Adding `--prefix=`cd ../.. && pwd` to `CONFIG_IN_PLACE_ARGS` works for setting `prefix`, but of course configure will then fail to set `inplacebuild`, because to do so it tests `${prefix} = "NONE"`. Is there some reason configure can't test `enable_origtree`? Is there some time the build system is supposed to build in-tree even without --enable-origtree? If so, could it test `"${prefix}" = "NONE" -o "${enable_origtree}" = "yes"`?

--

Matthew Flatt

unread,
Nov 13, 2019, 8:40:22 AM11/13/19
to Reuben Thomas, Racket Users
At Tue, 12 Nov 2019 22:47:33 +0000, Reuben Thomas wrote:
> Is there
> some reason configure can't test `enable_origtree`? Is there some time the
> build system is supposed to build in-tree even without --enable-origtree?
> If so, could it test `"${prefix}" = "NONE" -o "${enable_origtree}" = "yes"`?

Unless I misremember, the `--enable-origtree` and `--prefix=` options
are supposed to work together to create an installation at the given
prefix that has the same directory structure as an in-place build. So,
if I understand your question, that's why `--enable-origtree` doesn't
make `prefix` ignored.

Maybe the solution is to add `--disable-prefix` and have the top-level
makefile use that along with `--enable-origtree`?

Reuben Thomas

unread,
Nov 13, 2019, 4:58:39 PM11/13/19
to Matthew Flatt, Racket Users
On Wed, 13 Nov 2019 at 13:40, Matthew Flatt <mfl...@cs.utah.edu> wrote:

Maybe the solution is to add `--disable-prefix` and have the top-level
makefile use that along with `--enable-origtree`?

Sounds good to me.

While looking into implementing this, I discovered that `racket/src/start/configure.ac`, which seems to have been introduced with the introduction of CS, is not generated from racket/src/ac/*.m4, while all the other configure.ac's are.

I guess this explains why the fix to `src/ac/path.m4` in commit a56c984db0 (inter alia) has not been applied to `start/configure.ac`?

Since as far as I can tell, the putative `--disable-prefix` needs to be implemented in both `start/configure.ac` and `ac/path{,_arg}.m4`, I thought it was worth sorting this out before trying to attempt the fix.

[I must say that despite having long and even over-zealous experience with autotools hacking (up to and including auto-generating an autoconf and running the generated configure from within a Makefile.am), I am somewhat terrified by the dizzying many-layered depth of Racket's build system, so please forgive any incomprehension in the foregoing.]

--

Matthew Flatt

unread,
Nov 14, 2019, 7:51:46 AM11/14/19
to Reuben Thomas, Racket Users
At Wed, 13 Nov 2019 21:58:24 +0000, "'Reuben Thomas' via Racket Users" wrote:
> While looking into implementing this, I discovered that `racket/src/start/
> configure.ac`, which seems to have been introduced with the introduction of
> CS, is not generated from racket/src/ac/*.m4, while all the other
> configure.ac's are.
>
> I guess this explains why the fix to `src/ac/path.m4` in commit a56c984db0
> (inter alia) has not been applied to `start/configure.ac`?
>
> Since as far as I can tell, the putative `--disable-prefix` needs to be
> implemented in both `start/configure.ac` and `ac/path{,_arg}.m4`, I thought
> it was worth sorting this out before trying to attempt the fix.

Yes, it's definitely a mistake that "start/configure.ac" doesn't use
"src/ac/path.m4". (I must have lost track of that part when creating
"start/configure.ac" and other files out of the old single
"configure.ac".)

A repair for that as part of adding `--disable-prefix` would be very
welcome.

> [I must say that despite having long and even over-zealous experience with
> autotools hacking (up to and including auto-generating an autoconf and
> running the generated configure from within a Makefile.am), I am somewhat
> terrified by the dizzying many-layered depth of Racket's build system, so
> please forgive any incomprehension in the foregoing.]

It's a monster.

Reuben Thomas

unread,
Nov 14, 2019, 3:00:11 PM11/14/19
to Matthew Flatt, Racket Users
On Thu, 14 Nov 2019 at 12:51, Matthew Flatt <mfl...@cs.utah.edu> wrote:
At Wed, 13 Nov 2019 21:58:24 +0000, "'Reuben Thomas' via Racket Users" wrote:
> While looking into implementing this, I discovered that `racket/src/start/
> configure.ac`, which seems to have been introduced with the introduction of
> CS, is not generated from racket/src/ac/*.m4, while all the other
> configure.ac's are.
>
> I guess this explains why the fix to `src/ac/path.m4` in commit a56c984db0
> (inter alia) has not been applied to `start/configure.ac`?
>
> Since as far as I can tell, the putative `--disable-prefix` needs to be
> implemented in both `start/configure.ac` and `ac/path{,_arg}.m4`, I thought
> it was worth sorting this out before trying to attempt the fix.

Yes, it's definitely a mistake that "start/configure.ac" doesn't use
"src/ac/path.m4". (I must have lost track of that part when creating
"start/configure.ac" and other files out of the old single
"configure.ac".)

A repair for that as part of adding `--disable-prefix` would be very
welcome.

I will look into that.

--

Reuben Thomas

unread,
Nov 15, 2019, 4:33:34 PM11/15/19
to Matthew Flatt, Racket Users
I've looked into it and I can't work out what start/*.ac are used. Having read the various README.txt files and grepped around, I tried removing them (start/configure.ac and start/install2.ac) and it didn't seem to prevent a complete build from git checkout.

However, I see that some generated files like various "configure"s are checked in, so maybe I'm overlooking something, a buried generated reference to those files? (But I can't find install2 mentioned anywhere!)

--

Matthew Flatt

unread,
Nov 16, 2019, 10:06:29 AM11/16/19
to Reuben Thomas, Racket Users
At Fri, 15 Nov 2019 21:33:17 +0000, "'Reuben Thomas' via Racket Users" wrote:
> I've looked into it and I can't work out what start/*.ac are used.

Ah, right again. That explains why I didn't update "start/configure.ac"
to use "path.m4". It's because "start/configure.ac" isn't supposed to
exist. I'm pretty sure we should just delete it.

> However, I see that some generated files like various "configure"s are
> checked in, so maybe I'm overlooking something, a buried generated
> reference to those files? (But I can't find install2 mentioned anywhere!)

The checked-in `configure` scripts are generated by "make-configure" in
"racket/src/ac", and that script doesn't refer to "start/configure.ac".

Reuben Thomas

unread,
Nov 16, 2019, 1:32:15 PM11/16/19
to Matthew Flatt, Racket Users
On Sat, 16 Nov 2019 at 15:06, Matthew Flatt <mfl...@cs.utah.edu> wrote:

The checked-in `configure` scripts are generated by "make-configure" in
"racket/src/ac", and that script doesn't refer to "start/configure.ac".

Thanks for the confirmation. What about start/install2.ac?

--

Matthew Flatt

unread,
Nov 17, 2019, 1:35:25 AM11/17/19
to Reuben Thomas, Racket Users
Also should be removed. That one was probably an intermediate file from
conversion that I missed in cleanup.

Reuben Thomas

unread,
Nov 17, 2019, 3:27:47 PM11/17/19
to Matthew Flatt, Racket Users
Great, I'll add a commit to remove those two files to my eventual PR on this issue.

--

Reuben Thomas

unread,
Nov 18, 2019, 8:08:05 AM11/18/19
to Matthew Flatt, Racket Users
Reply all
Reply to author
Forward
0 new messages