[ fix ] Only set IDRIS2_PREFIX if it is unset (fixes Issue 3022) (#3024)

This commit is contained in:
CodingCellist 2023-07-31 09:18:15 +02:00 committed by GitHub
parent cbbe761c51
commit 51403ab18c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 61 additions and 38 deletions

View File

@ -43,7 +43,8 @@
* Generated JavaScript files now include a shebang when using the Node.js backend * Generated JavaScript files now include a shebang when using the Node.js backend
* NodeJS now supports `popen`/`pclose` for the `Read` mode. * NodeJS now supports `popen`/`pclose` for the `Read` mode.
* `getChar` is now supported on Node.js and `putChar` is supported on both JavaScript backends. * `getChar` is now supported on Node.js and `putChar` is supported on both
JavaScript backends.
* Integer-indexed arrays are now supported. * Integer-indexed arrays are now supported.
### Compiler changes ### Compiler changes
@ -94,7 +95,8 @@
* Constant folding of trivial let statements and `believe_me`. * Constant folding of trivial let statements and `believe_me`.
* Fixed a bug that caused holes to appear unexpectedly during quotation of dependent pairs. * Fixed a bug that caused holes to appear unexpectedly during quotation of
dependent pairs.
### Library changes ### Library changes
@ -121,8 +123,8 @@
* Add `Show` instance to `Data.Vect.Quantifiers.All` and add a few helpers for listy * Add `Show` instance to `Data.Vect.Quantifiers.All` and add a few helpers for listy
computations on the `All` type. computations on the `All` type.
* Add an alias for `HVect` to `All id` in `Data.Vect.Quantifiers.All`. This is the * Add an alias for `HVect` to `All id` in `Data.Vect.Quantifiers.All`. This is the
approach to getting a heterogeneous `Vect` of elements that is general preferred by approach to getting a heterogeneous `Vect` of elements that is general
the community vs. a standalone type as seen in `contrib`. preferred by the community vs. a standalone type as seen in `contrib`.
* Add `Data.List.HasLength` from the compiler codebase slash contrib library but * Add `Data.List.HasLength` from the compiler codebase slash contrib library but
adopt the type signature from the compiler codebase and some of the naming adopt the type signature from the compiler codebase and some of the naming
from the contrib library. The type ended up being `HasLength n xs` rather than from the contrib library. The type ended up being `HasLength n xs` rather than
@ -151,7 +153,8 @@
* Adds `Vect.allFins` for generating all the `Fin` elements as a `Vect` with * Adds `Vect.allFins` for generating all the `Fin` elements as a `Vect` with
matching length to the number of elements. matching length to the number of elements.
* Add `withRawMode`, `enableRawMode`, `resetRawMode` for character at a time input on stdin. * Add `withRawMode`, `enableRawMode`, `resetRawMode` for character at a time
input on stdin.
* Adds extraction functions to `Data.Singleton`. * Adds extraction functions to `Data.Singleton`.
@ -173,8 +176,8 @@
* `Eq` and `Ord` implementations for `Fin n` now run in constant time. * `Eq` and `Ord` implementations for `Fin n` now run in constant time.
* Adds `getTermCols` and `getTermLines` to the base library. They return the size of the * Adds `getTermCols` and `getTermLines` to the base library. They return the
terminal if either stdin or stdout is a tty. size of the terminal if either stdin or stdout is a tty.
#### System #### System
@ -185,12 +188,13 @@
### Contrib ### Contrib
* Adds `Data.List.Sufficient`, a small library defining a structurally inductive view of lists. * Adds `Data.List.Sufficient`, a small library defining a structurally inductive
view of lists.
* Remove `Data.List.HasLength` from `contrib` library but add it to the `base` library * Remove `Data.List.HasLength` from `contrib` library but add it to the `base`
with the type signature from the compiler codebase and some of the naming library with the type signature from the compiler codebase and some of the
from the `contrib` library. The type ended up being `HasLength n xs` rather than naming from the `contrib` library. The type ended up being `HasLength n xs`
`HasLength xs n`. rather than `HasLength xs n`.
* Adds an implementation for `Functor Text.Lexer.Tokenizer.Tokenizer`. * Adds an implementation for `Functor Text.Lexer.Tokenizer.Tokenizer`.
@ -217,11 +221,16 @@
recognized as a "data" directory by Idris 2. See the recognized as a "data" directory by Idris 2. See the
[documentation on Packages](https://idris2.readthedocs.io/en/latest/reference/packages.html) [documentation on Packages](https://idris2.readthedocs.io/en/latest/reference/packages.html)
for details. for details.
* The compiler no longer installs its own C support library into `${PREFIX}/lib`. This folder's * The compiler no longer installs its own C support library into
contents were always duplicates of files installed into `${PREFIX}/idris2-${IDRIS2_VERSION}/lib`. If you `${PREFIX}/lib`. This folder's contents were always duplicates of files
need to adjust any tooling or scripts, point them to the latter location which still contains installed into `${PREFIX}/idris2-${IDRIS2_VERSION}/lib`. If you need to adjust
any tooling or scripts, point them to the latter location which still contains
these installed library files. these installed library files.
* Renamed `support-clean` Makefile target to `clean-support`. This is in line with most of the `install-<something>` and `clean-<something>` naming. * Renamed `support-clean` Makefile target to `clean-support`. This is in line
with most of the `install-<something>` and `clean-<something>` naming.
* Fixes an error in the `Makefile` where setting `IDRIS2_PREFIX` caused
bootstrapping to fail.
* Updates the docs for `envvars` to match the changes introduced in #2649.
## v0.6.0 ## v0.6.0

View File

@ -34,11 +34,11 @@ IDRIS2_LIB_IPKG := idris2api.ipkg
ifeq ($(OS), windows) ifeq ($(OS), windows)
# This produces D:/../.. style paths # This produces D:/../.. style paths
IDRIS2_PREFIX := $(shell cygpath -m ${PREFIX}) IDRIS2_PREFIX ?= $(shell cygpath -m ${PREFIX})
IDRIS2_CURDIR := $(shell cygpath -m ${CURDIR}) IDRIS2_CURDIR := $(shell cygpath -m ${CURDIR})
SEP := ; SEP := ;
else else
IDRIS2_PREFIX := ${PREFIX} IDRIS2_PREFIX ?= ${PREFIX}
IDRIS2_CURDIR := ${CURDIR} IDRIS2_CURDIR := ${CURDIR}
SEP := : SEP := :
endif endif

View File

@ -8,25 +8,39 @@ Idris 2 recognises a number of environment variables, to decide where to look
for packages, external libraries, code generators, etc. It currently recognises, for packages, external libraries, code generators, etc. It currently recognises,
in approximately the order you're likely to need them: in approximately the order you're likely to need them:
* ``EDITOR`` - Sets the editor used in REPL :e command * ``EDITOR`` - Editor used in REPL ``:e`` command.
* ``IDRIS2_CG`` - Sets which code generator to use when compiling programs * ``PREFIX`` - Default way to set the Idris2 installation prefix.
* ``IDRIS2_PACKAGE_PATH`` - Lists the directories where Idris2 looks for packages, * ``IDRIS2_PREFIX`` - Alternative way to set the Idris2 installation prefix.
* ``IDRIS2_PATH`` - Directories where Idris2 looks for import files, in addition
to the imports in packages
* ``IDRIS2_PACKAGE_PATH`` - Directories where Idris2 looks for Idris 2 packages,
in addition to the defaults (which are under the ``IDRIS2_PREFIX`` and in the in addition to the defaults (which are under the ``IDRIS2_PREFIX`` and in the
``depends`` subdirectory of the current working directory). ``depends`` subdirectory of the current working directory).
Directories are separated by a ``:``, or a ``;`` on Windows Directories are separated by a ``:`` on MacOS and *NIX systems, or a ``;`` on
* ``IDRIS2_PATH`` - Places Idris2 looks for import files, in addition to the Windows
imports in packages * ``IDRIS2_DATA`` - Directories where Idris2 looks for data files. These are
* ``IDRIS2_DATA`` - Places Idris2 looks for its data files. These are typically typically support code for code generators.
support code for code generators. * ``IDRIS2_LIBS`` - Directories where Idris2 looks for libraries (for code
* ``IDRIS2_LIBS`` - Places Idris2 looks for libraries used by code generators. generation).
* ``IDRIS2_PREFIX`` - Gives the Idris2 installation prefix * ``IDRIS2_CG`` - Codegen backend.
* ``CHEZ`` - Sets the location of the ``chez`` executable used in Chez codegen * ``IDRIS2_INC_CGS`` - Code generators to use (comma separated) when compiling modules incrementally.
* ``RACKET`` - Sets the location of the ``racket`` executable used in Racket codegen * ``CHEZ`` - Chez backend: location of the ``chez`` executable.
* ``RACKET_RACO`` - Sets the location of the ``raco`` executable used in Racket codegen * ``RACKET`` - Racket backend: location of the ``racket`` executable.
* ``GAMBIT_GSI`` - Sets the location of the ``gsi`` executable used in Gambit codegen * ``RACKET_RACO`` - Racket backend: location of the ``raco`` executable.
* ``GAMBIT_GSC`` - Sets the location of the ``gsc`` executable used in Gambit codegen * ``GAMBIT_GSI`` - Gambit backend: location of the ``gsi`` executable.
* ``GAMBIT_GSC_BACKEND`` - Sets the ``gsc`` executable backend argument * ``GAMBIT_GSC`` - Gambit backend: location of the ``gsc`` executable.
* ``IDRIS2_CC`` - Sets the location of the C compiler executable used in RefC codegen * ``GAMBIT_GSC_BACKEND`` - Gambit backend: arguments passed to ``gsc``.
* ``CC`` - Sets the location of the C compiler executable used in RefC codegen * ``IDRIS2_CC`` - RefC backend: location of the C compiler executable.
* ``NODE`` - Sets the location of the ``node`` executable used in Node codegen * ``IDRIS2_CFLAGS`` - RefC backend: C compiler flags.
* ``PATH`` - used to search for executables in certain codegens * ``IDRIS2_CPPFLAGS`` - RefC backend: C preprocessor flags.
* ``IDRIS2_LDFLAGS`` - RefC backend: C linker flags.
* ``CC`` - RefC backend: C compiler executable (IDRIS2_CC takes precedence).
* ``CFLAGS`` - RefC backend: C compiler flags (IDRIS2_CFLAGS takes precedence).
* ``CPPFLAGS`` - RefC backend: C preprocessor flags (IDRIS2_CPPFLAGS takes precedence).
* ``LDFLAGS`` - RefC backend: C linker flags (IDRIS2_LDFLAGS takes precedence).
* ``NODE`` - NodeJS backend: ``node`` executable.
* ``PATH`` - PATH variable is used to search for executables in certain
codegens.
* ``NO_COLOR`` - Instruct Idris not to print colour to stdout. Passing the
--colour/--color option will supersede this environment variable.