Commit graph

747 commits

Author SHA1 Message Date
Sebastian Ullrich
4d4d485c19
chore: avoid rebuilding leanmanifest in each build (#5057) 2024-08-15 14:55:36 +00:00
Sebastian Ullrich
c5114c971a fix: Windows needs more LEAN_EXPORTs 2024-08-12 14:14:42 +02:00
Sebastian Ullrich
35e1554ef7
chore: ignore stale leanpkg tests (#4925) 2024-08-06 08:19:33 +00:00
Sebastian Ullrich
9b342efb84
fix: calling programs with spaces on Windows (#4515)
This entire API has been carefully optimized for maximum pain output

---------

Co-authored-by: Mac Malone <tydeu@hatpress.net>
2024-07-26 17:35:05 +00:00
Mac Malone
93c9ae7c20
feat: lake: reservoir require (#4495)
Adds a new type of `require` which fetches package metadata from a
registry API endpoint (i.e., Reservoir) and then clones a Git package
using the information provided. To require such a dependency, the new
syntax is:

```lean
require <scope> / <pkg-name> [@ "git#<rev>"] -- e.g., require "leanprover" / "doc-gen4"
```

Or in TOML:

```toml
[[require]]
name = "<pkg-name>"
scope = "<scope>"
rev = "<rev>"
```

Unlike with Git dependencies, Lake can make use of the richer
information provided by the registry to determine the default branch of
the package. This means for repositories of packages like `doc-gen4`
which have a default branch that is not `master`, Lake will now use said
default branch (e.g., in `doc-gen4`'s case, `main`).

Lake also supports configuring the registry endpoint via an environment
variable: `RESERVIOR_API_URL`. Thus, any server providing a similar
interface to Reservoir can be used as the registry. Further
configuration options paralleling those of Cargo's [Alternative
Registries](https://doc.rust-lang.org/cargo/reference/registries.html)
and [Source
Replacement](https://doc.rust-lang.org/cargo/reference/source-replacement.html)
will come in the future.

Updated and split from #3174.
2024-06-29 01:40:54 +00:00
Sebastian Ullrich
3b4b2cc89d
fix: do not dllexport symbols in core static libraries (#3601)
On Windows, we now compile all core `.o`s twice, once with and without
`dllexport`, for use in the shipped dynamic and static libraries,
respectively. On other platforms, we export always as before to avoid
the duplicate work.

---------

Co-authored-by: tydeu <tydeu@hatpress.net>
2024-03-15 11:58:34 +00:00
Leonardo de Moura
1d3ef577c2
chore: disable some tests on Windows (#3642)
This is a temporary workaround for a limitation on Windows shared
libraries. We are getting errors of the form:
```
ld.lld: error: too many exported symbols (got 65572, max 65535)
```
2024-03-09 23:48:41 +00:00
Leonardo de Moura
30a61a57c3 chore: disable compiler tests on Windows 2024-03-05 20:24:01 -08:00
Alexander Bentkamp
7dc1618ca5
feat: Web Assembly Build (#2599)
Co-authored-by: Rujia Liu <rujialiu@user.noreply.github.com>
2023-10-04 09:04:20 +02:00
tydeu
2e726f5f5a test: lake: give issue tests meaningful names 2023-09-06 17:35:59 -04:00
tydeu
bb09efe1c4 test: lake: rename test to tests
(for consistency with Lean)
2023-09-06 17:35:59 -04:00
tydeu
b328835f4d fix: lake: reverse-ffi, manifest, and 62 tests 2023-08-15 20:33:09 -04:00
Siddharth Bhat
146296b5fa feat: enable LLVM in stage1+ compiler 2023-08-14 13:33:46 +02:00
tydeu
a315fdceb3 test: lake: make 116 deterministic & related tweaks 2023-08-08 16:21:28 -04:00
tydeu
86f11311ba test: merge examples/git and test/104 & use local test repo 2023-08-02 04:03:56 -04:00
Siddharth
a436c225d8
chore: disable lake 116 test (#2358)
The test is flaky due to the presence of a fixed 'sleep()'.

The LLVM backend has introduced a performance
regression in Lake which causes this test to fail, as the
current sleep duration of 3s is insufficient.
Further investigation into the performance regression is pending.

We decided to disable the `leanlaketest_116` entirely on account
of the test being flaky by construction
(https://github.com/leanprover/lean4/pull/2358#issuecomment-1655371232).
2023-07-29 09:40:18 +00:00
Sebastian Ullrich
544b704a25 test: add Lake tests 2023-07-21 09:19:19 +02:00
Siddharth Bhat
dfb5548cab fix: update libleanrt.bc, rename to lean.h.bc
This adds `lean.h.bc`, a LLVM bitcode file of the Lean
runtime that is to be inlined. This is programatically generated.

1. This differs from the previous `libleanrt.ll`, since it produces an
   LLVM bitcode file, versus a textual IR file. The bitcode file
   is faster to parse and build an in-memory LLVM module from.
2. We build `lean.h.bc` by adding it as a target to `shell`,
   which ensures that it is always built.

3. We eschew the need for:

```cpp
```

which causes breakage in the build, since changing the meaning of
`static` messes with definitions in the C++ headers.

Instead, we build `lean.h.bc` by copying everything in
`src/include/lean/lean.h`, renaming `inline` to
`__attribute__(alwaysinline)` [which forces LLVM to generate
`alwaysinline` annotations], then running the `-O3` pass pipeline
to get reasonably optimised IR, and will be perfectly inlined
when linked into the generated LLVM code by
`src/Lean/Compiler/IR/EmitLLVM.lean`.

Co-authored-by: Sebastian Ullrich <sebasti@nullri.ch>
2022-11-28 16:20:12 +01:00
Sebastian Ullrich
c112ae7c58 test: fix Lake rename 2022-11-28 15:12:18 +01:00
Siddharth
48b6fee467
chore: remove stray STATIC in src/shell (#1736) 2022-10-15 14:27:13 +02:00
Sebastian Ullrich
4a9bc88a4e chore: fix USE_GMP=OFF by removing GMP linking customization 2022-03-26 16:29:52 +01:00
Leonardo de Moura
52a52fbed7 chore: add doc/examples to the test suite 2022-03-24 15:20:18 -07:00
Sebastian Ullrich
8cbd7ccf09 test: reimplement package tests using Lake 2022-02-09 12:21:11 -08:00
Sebastian Ullrich
a7ba103e0a chore: remove leanpkg 2022-02-04 19:03:40 +01:00
Leonardo de Moura
d953ac8d0d feat: allow users to use initialize registerBuiltinDerivingHandler ... 2022-01-11 09:50:09 -08:00
Leonardo de Moura
448bac5b3e chore: one add_test per lake test 2021-12-14 11:48:14 -08:00
Sebastian Ullrich
7333de1766 refactor: cmake: make more use of string(APPEND)
I guess CMake might not actually be that painful if one was motivated to
learn it

```
sed -Ei 's/set\(([A-Z_]+) "\$\{\1\}/string(APPEND \1 "/' src/**/CMakeLists.txt
```
2021-11-18 10:09:55 +01:00
Sebastian Ullrich
db5b150b38 chore: do not use bundled compiler for foreign test 2021-11-18 09:42:35 +01:00
Sebastian Ullrich
09d549aecd chore: fix foreign test on macOS, again 2021-11-18 09:42:35 +01:00
Sebastian Ullrich
d2a1e20dd0 feat: bundling LLVM on Linux 2021-11-18 09:42:35 +01:00
Sebastian Ullrich
a345a98ef7 chore: fix foreign test on macOS 2021-11-09 11:03:14 +01:00
Sebastian Ullrich
d7b8479760 chore: use configured C++ compiler for foreign test
Fixes #775
2021-11-09 09:27:10 +01:00
Sebastian Ullrich
697e34e229 test: --load-dynlib 2021-11-04 15:32:07 -07:00
Leonardo de Moura
f01a124f18 fix: builtin attribute initialization
The failure was triggered if a module declared (only) builtin
attributes that do not have any persistent extension associated with
them.

Fixes #726
2021-10-20 13:55:54 -07:00
Sebastian Ullrich
89f9045646 test: add lake tests 2021-10-15 06:56:02 -07:00
Chris Lovett
ad7c5b26a7
fix: UTF-8 file path support for lean on Windows
* fix msys2 windows build so the windows apps support utf-8 file paths.

* use windres to compile default-manifest.o

* windres is in binutils.

* stop modifying default-manifest.o

* copy to stage0

* fix semicolon joining of lists in add_custom_target

* undo changes to stage0 as per CR feedback.

* fix makefile

* fix: revert cmakelists.txt COMMAND_EXPAND_LISTS  change

* fix: msys2 dependencies

* add unit test for decoding UTF-8 chars to prove "lean.exe" can read utf-8 encoded files where utf-8 is also used in the file name.

* fix: utf-8 test by using windows-2022

* fix: do we really need cmake 3.11 or will 3.10 do?

* nope, really does require cmake 11.
2021-09-22 12:21:52 +02:00
Sebastian Ullrich
130eac1b77 chore: reintroduce lean.cpp in separate commit so Git doesn't freak out 2021-09-16 07:03:37 -07:00
Sebastian Ullrich
b3bb2bac97 chore: move all C++ code into libleanshared, use C stub for main
Avoids any issues with cross-lib C++
2021-09-16 07:03:37 -07:00
Sebastian Ullrich
c5940f0149 fix: cmake/make dependencies 2021-09-09 18:12:55 +02:00
Sebastian Ullrich
2159a90c8c fix: lean target dependencies
Fixes #661
2021-09-09 11:55:33 +02:00
Sebastian Ullrich
68a3799b7c refactor: build lean in stdlib.make 2021-09-08 17:24:31 +02:00
Sebastian Ullrich
9702fe1981 chore: leanc: use C instead of C++ compiler 2021-09-08 17:24:31 +02:00
Sebastian Ullrich
3787c6081c fix: pass worker cmdline options to Lean code 2021-09-08 11:34:31 +02:00
Leonardo de Moura
c8406a301d chore: reduce src/include/lean 2021-09-07 08:24:54 -07:00
Sebastian Ullrich
5f4b1b1d44 Revert "Revert "feat: reintroduce libleanshared, link lean & leanpkg against it""
This reverts commit ccbc9d00db.
2021-08-20 09:42:05 -07:00
Sebastian Ullrich
ccbc9d00db Revert "feat: reintroduce libleanshared, link lean & leanpkg against it" 2021-08-20 15:39:00 +02:00
Sebastian Ullrich
f33cdf6bf9 fix: linking against dl 2021-08-19 19:44:28 +02:00
Sebastian Ullrich
09a0347fdc chore: fix compilation of executables containing code to be interpreted 2021-08-18 13:54:52 +02:00
Sebastian Ullrich
1ed329b305 test: try reenabling plugin test on Windows 2021-08-18 13:54:52 +02:00
Sebastian Ullrich
6827928594 chore: cpack: copy required libraries via ldd/otool 2021-08-18 13:54:52 +02:00