Skip to content

Commit 80a84d4

Browse files
author
Matthias Koeppe
committed
README.md: Add step to sanitize the environment
1 parent 2114066 commit 80a84d4

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

README.md

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,37 @@ in the Installation Guide.
228228
(If the bootstrapping prerequisites are not installed, this command will
229229
download a package providing pre-built bootstrap output instead.)
230230

231-
6. [macOS with homebrew] Set required environment variables for the build:
231+
6. Sanitize the build environment. Use the command
232232

233-
$ source ./.homebrew-build-env
233+
$ env
234234

235-
This is to make some of Homebrew's packages (so-called keg-only packages)
236-
available for the build. Run it once to apply the suggestions for the current
237-
terminal session. You may need to repeat this command before you rebuild Sage
238-
from a new terminal session, or after installing additional homebrew packages.
239-
(You can also add it to your shell profile so that it gets run automatically
240-
in all future sessions.)
235+
to inspect the current environment variables, in particular `PATH`,
236+
`PKG_CONFIG_PATH`, `LD_LIBRARY_PATH`, `CFLAGS`, `CPPFLAGS`, `CXXFLAGS`,
237+
and `LDFLAGS` (if set).
238+
239+
Remove items from these (colon-separated) environment variables
240+
that Sage should not use for its own build. In particular, remove
241+
items if they refer to a previous Sage installation.
242+
243+
- [WSL] In particular, WSL imports many items from the Windows
244+
`PATH` variable into the Linux environment, which can lead to
245+
confusing build errors. These items typically start with `/mnt/c`.
246+
It is best to remove all of them from the environment variables.
247+
For example, you can set `PATH` using the command:
248+
249+
$ export PATH=/usr/sbin/:/sbin/:/bin/:/usr/lib/wsl/lib/
250+
251+
- [macOS with homebrew] Set required environment variables for the build:
252+
253+
$ source ./.homebrew-build-env
254+
255+
This is to make some of Homebrew's packages (so-called keg-only
256+
packages) available for the build. Run it once to apply the
257+
suggestions for the current terminal session. You may need to
258+
repeat this command before you rebuild Sage from a new terminal
259+
session, or after installing additional homebrew packages. (You
260+
can also add it to your shell profile so that it gets run
261+
automatically in all future sessions.)
241262

242263
7. Optionally, decide on the installation prefix (`SAGE_LOCAL`):
243264

0 commit comments

Comments
 (0)