about summary refs log tree commit diff
path: root/nix/buildLisp (follow)
AgeCommit message (Collapse)AuthorFilesLines
2021-08-24 r/2768 feat(nix/buildLisp): allow implementation-specifc bundled functionssterni1-6/+32
By implementing a bundled function for an implementation, we can use a custom one for a specific implementation. This is useful for implementations like ECL where a require will be compiled as an instruction rather than importing all new symbols into a dump, so using the underlying static or shared object directly would be beneficial. overrideLisp for bundled libraries now only allows overriding the name and implementation arguments. Change-Id: I9036b29157e8daa4d86ff87d603b044373711dbf Reviewed-on: https://cl.tvl.fyi/c/depot/+/3301 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2021-08-24 r/2767 refactor(nix/buildLisp): prepare multi implementation supportsterni1-105/+188
Concept is roughly: * receive extra argument `implementation` that refers to the name of an implementation or rather an attribute in an internal attribute set telling buildLisp how to do certain build steps. * We assume an implementation can execute lisp files as scripts and that we can implement the following main tasks in lisp: - Building a library (`genCompileLisp`) - Building an executable (`genDumpLisp`) - Loading a library dynamically (`genLoadLisp`) Based on that we can implement: - Running a test suite (`genTestLisp`) - A REPL preloaded with a libraries and their dependencies (`lispWith`) Additional attributes for implementing these parts genericly are added as needed (`faslExt` and `runScript`). * `genCompileLisp` no longer prints a shell script which concatenates the individual FASLs. Instead it does the step previously done by the shell script itself. In essence `genCompileLisp` now writes a lisp script which compiles and installs the library to build. This will allow us extra freedom for different implementations, e. g. for ECL we'll want to build a object file archive additionally to fasl files in order to be able to link proper executables. * `genLoadLisp` and `genTestLisp` are almost generic (the former just sometimes would need to use different file extensions), but we integrate them into the implementation “API” to facilitate minor tweaks we need to do like the `fasc` extension for ECL's native FASL files. Change-Id: I1b8ccc0063159638ec7af534e9a6b5384e750193 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3292 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2021-08-12 r/2722 docs(nix/buildLisp): mention drawback of non-parallel compilationsterni1-0/+4
To be fair this hardly matters since SBCL is quite fast, but compiling ironclad with ECL is quite the experience… Change-Id: Ib89cc50e5d557acec51fdb085bcbdfc99736221e Reviewed-on: https://cl.tvl.fyi/c/depot/+/3342 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2021-08-10 r/2716 fix(nix/buildLisp): remove misplaced `makeOverridable`ssterni1-2/+1
`makeOverriddable` doesn't work for bundled sbclWith as is because it uses the `//` operator internally which doesn't work with the types `bundled` and `sbclWith` accept as arguments (string and list respectively). What's more, `bundled` already uses `makeOverridable` and allows to override the internal call to `library` via `overrideLisp`. For `sbclWith` no such mechanism exists, but this seems to be no concern for now: Using `overrideLisp` for this hasn't worked so far (and failed with a _hideous_ evaluation error), so there doesn't seem to be any real demand for this feature. Maybe a feature for another CL. Change-Id: I0b2f34c00a2143cd66dd43a6b1b2880af997ee50 Reviewed-on: https://cl.tvl.fyi/c/depot/+/3296 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2021-08-01 r/2701 refactor(nix/buildLisp): use passthru for extra attributessterni1-15/+17
Using passthru and appending the attributes via `//` have the same effect with a subtle difference: In the latter case re-evaluating the derivation when using the underlying `mkDerivation`'s `overrideAttrs` will delete all appended attributes. Using passthru at least preserves the attributes although the self reference to the derivation in `passthru.sbcl` will become outdated (unless updated manually). Change-Id: I8b85009f386b9375b86a23fd50c4ec8c6a9dea7f Reviewed-on: https://cl.tvl.fyi/c/depot/+/3257 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in> Reviewed-by: grfn <grfn@gws.fyi>
2020-11-08 r/1873 fix(buildLisp): Override LANG in sbclWith for misconfigured machinesVincent Ambo1-1/+2
Machines on which LANG is misconfigured have trouble with SBCL loading files that contain characters in certain encodings. This overrides whichever local LANG (if any) is set. Change-Id: Ic4341a01c4393e7f697de6cecc58dea4f2d85987 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2076 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-08-23 r/1706 feat(nix/buildLisp): Expose an sbcl attributeGriffin Smith1-4/+6
Expose an `sbcl` attribute on packages and programs, to allow for easier development either with SLY or on a REPL. Change-Id: Ide4d087a5223561e1fe192ef32dc593c54b5a20e Reviewed-on: https://cl.tvl.fyi/c/depot/+/1834 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-27 r/1492 feat(nix/buildLisp): Add abstraction for test suitesGriffin Smith2-50/+142
Add support for explicitly specifying tests as part of a buildLisp program or library. Change-Id: I733213c1618f0fa60f645465560bce0522641efd Reviewed-on: https://cl.tvl.fyi/c/depot/+/1481 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-26 r/1487 fix(nix/buildLisp): Set LANG to C.UTF-8 on program buildsGriffin Smith1-0/+1
This was already happening for libraries, but not for programs - as a result, programs built with libraries that contained unicode (eg cl-unicode, uax-15, ...) would fail to build due to character encoding issues when loading the FASLs. Change-Id: I66149b585e85b213d0c026153140a1925536bd29 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1469 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-06 r/1228 fix(buildLisp): use full store path in FASL output pathnameseta1-1/+1
If you compiled dirA/test.lisp and dirB/test.lisp in the same library, they'd both get written to /test.fasl and the second would overwrite the first. Instead, use the whole store path (with / swapped for -) as the fasl filename. Change-Id: I4eb88b5d33757751e1f67e72ed328bd58079b1b9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/944 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-02-21 r/559 chore: Rename pkgs->depot in all Nix file headersVincent Ambo2-5/+4
2020-01-29 r/473 fix(nix/buildLisp): Ensure SBCL uses UTF-8 encodingVincent Ambo1-0/+1
2020-01-29 r/471 docs(nix/buildLisp): Update the README with actual docsVincent Ambo1-11/+86
2020-01-26 r/461 feat(nix/buildLisp): Add 'bundled' function for built-in librariesVincent Ambo1-0/+8
Makes it possible to add virtual dependencies on built-in libraries, e.g. `buildLisp.bundled "sb-posix"`.
2020-01-24 r/455 chore(buildLisp): use lib.optionalString where applicableedef1-4/+1
2020-01-17 r/386 fix(nix/buildLisp): Don't load binaries in sbclWithVincent Ambo1-3/+11
Adds an attribute on each Lisp derivation that specifies whether it is a binary or not. This attribute is then filtered for in sbclWith.
2020-01-17 r/385 feat(nix/buildLisp): Support passing programs to sbclWithVincent Ambo1-1/+1
Adds the necessary attributes on derivations created by buildLisp.program for them to be passed to buildLisp.sbclWith. This makes it possible to easily spin up Lisp environments that contain everything needed for a given program.
2020-01-09 r/365 fix(buildLisp): Wrap executables to set load paths correctlyVincent Ambo2-16/+10
I can not currently find a way to set the CFFI variables correctly to get it to load libraries from Nix. In the absence of that feature, a wrapper also does the trick.
2020-01-09 r/364 feat(buildLisp): Initial implementation of foreign library loadingVincent Ambo1-9/+46
Adds a new 'native' parameter to the buildLisp functions in which libraries can be passed in. This does not yet work with CFFI packages.
2020-01-09 r/355 fix(buildLisp): Perform a topological sort of dependenciesVincent Ambo1-8/+7
This ensures that dependencies are loaded in the correct order in larger dependency graphs.
2020-01-08 r/351 fix(buildLisp): Cursed code to fix load orderingVincent Ambo1-10/+23
It's not enough to compile in the right order - turns out you also have to load the compiled objects in the right order. To achieve this some cursed code has been added that changes the Lisp generated by Nix to compile the other Lisp so that it also generates some bash, which Nix can then use to concatenate the FASLs in the right order to feed them to Lisp again. It works but I'll replace it with a more elegant solution once one is needed.
2020-01-08 r/350 feat(buildLisp): Add initial, tiny example programVincent Ambo3-0/+45
2020-01-08 r/349 feat(buildLisp): Implement buildLisp.program to dump executablesVincent Ambo1-4/+30
Dumps the executable image from SBCL to $out/bin/$name. Image compression is disabled.
2020-01-08 r/348 refactor(buildLisp): Inline dependency loading in genCompileLispVincent Ambo1-35/+44
2020-01-08 r/347 feat(buildLisp): Add function to wrap SBCL with dependenciesVincent Ambo1-2/+4
Adds `buildLisp.sbclWith` which creates an SBCL wrapper the contains all the requested dependencies.
2020-01-08 r/346 feat(buildLisp): Implement dependency loading & propagationVincent Ambo1-4/+16
Similar to buildGo.nix, the library derivations carry information about their dependencies which is merged when a load file is instantiated. The load files are created when compiling libraries, but will in the future also be created when wrapping SBCL and dumping images.
2020-01-08 r/345 fix(buildLisp): Fail the build on compilation errorsVincent Ambo1-1/+4
This needs to be handled explicitly in the COMPILE-FILE form.
2020-01-08 r/343 feat(nix/buildLisp): Add initial sketch including buildLisp.libraryVincent Ambo2-0/+97
Adds a Nix function to build a Lisp library out of a specified set of Nix files. All files are combined into a single FASL. This is by design only compatible with SBCL (for now).