| Age | Commit message (Collapse) | Author |
|
Set dontPatchShebangs=true for per-module link derivation to avoid
unbound variable error in Nix's patch-shebangs.sh script.
The script declares 'local update' but never initializes it, causing
bash set -u to fail. Our ELF binaries don't need shebangs patched
anyway.
Tested: All Haskell targets now build successfully including
Omni/Lint.hs which uses makeWrapper with rundeps.
|
|
- Fix nixBuild to propagate exit code from realise step
- Previously used >> which discarded exit code - Now checks realise
result before running symlink - Fixes false success checkmarks on
build failures
- Fix per-module Nix derivations
- Use cp -rL instead of tar (src is directory not tarball) - Add
coreutils and findutils to pkgs - Copy deps to . and use -i. for
GHC - Use find with --parents to preserve module hierarchy - Set
dontStrip=true to avoid fixup script errors
- Tested: Example.hs, Task.hs, Dragons.hs, Bild.hs all build - Known
issue: makeWrapper fixup scripts have unbound vars (Nix bug)
|
|
When using custom builder, unpackPhase function is not available.
Use tar xzf to manually extract the source archive.
|
|
When using custom builder, standard phases don't run automatically.
Call unpackPhase explicitly and cd to 'source' directory where files
are unpacked.
Fixes 'sourceRoot: unbound variable' error in module compilation.
|
|
The haskell.ghcWith package has setup hooks that override buildPhase
even when explicitly set. Solution: use custom builder = stdenv.shell
with args instead of relying on mkDerivation phases.
Changes: - Module derivations: Use custom builder with single -c script
- Combines unpack, build, and install into one script - Explicitly
call ghc with full path to avoid hook interference - Remove unused
objectPaths computation (now using ghc --make with source)
This fixes builds for Omni/Lint.hs, Omni/Task.hs, and all other
Haskell targets with complex dependency graphs.
|
|
GHC --make was treating -i /nix/store/.../hidir paths as compilation targets.
Solution: Copy all .hi files to local directory and use -i. only.
Also make hsGraph optional with 'or null' for backward compatibility with
old bild binaries during bootstrap.
Amp-Thread-ID: https://ampcode.com/threads/T-fe68faaf-1c1d-4c43-a377-1cf5e6cffb3a
Co-authored-by: Amp <amp@ampcode.com>
|
|
GHC --make interprets arguments before flags as targets. Moving the
entry point source file to the beginning prevents -i paths from being
treated as compilation targets.
This fixes the 'is not a module name or a source file' error.
|
|
This is the core architecture transformation from Phase 3 of the
performance plan. Each Haskell module is now built as a separate
Nix derivation, enabling true incremental builds where only changed
modules and their dependents are rebuilt.
Implementation: - buildHsModuleGraph: Analyzes transitive module
dependencies and builds DAG - TH detection: Falls back to monolithic
build if Template Haskell detected - SCC cycle detection: Falls
back if import cycles found - Per-module Nix builder: Each module ->
separate derivation with .hi and .o - Module dependencies: Copy .hi
files to build dir, use -i flags for imports - Final link: Use ghc
--make with entry point source + -i paths to .hi files - Entry point
fix: Explicitly analyze entry point module separately from deps
Architecture: - Module compilation: ghc -c with -i paths to dependency
.hi files - Source filtering: Each module derivation includes only
its source file - Dependency DAG: Expressed as recursive Nix attrset
with lib.fix - Link phase: ghc --make with entry source file + all .hi
search paths - Fallback: Monolithic ghc --make when hsGraph is null
(TH/cycles)
Performance characteristics: - Change one module -> rebuild only
that + dependents + relink - Nix handles DAG scheduling and caching
automatically - Parallel module compilation (Nix orchestrates) -
Content-addressed caching across machines
Testing: - Added test_buildHsModuleGraph unit test - Verified with
Omni/Bild/Example.hs (4 modules) - Tested incremental rebuild triggers
correct subset
This completes Phase 2 and Phase 3 core optimizations from the plan.
|
|
Only include directories that are ancestors of source files in
allSources. Previously accepted all directories, causing rebuilds
when any new directory was added to the repo.
Implementation: - Precompute normalized source paths and their ancestor
directories - Filter directories against allowedDirs whitelist -
Normalize paths in file filter for consistency - Keep existing skip
list behavior for _ and .direnv
This is optimization #2 from Phase 2 of the performance plan.
|
|
This is actually useful because nix only shows the last 25 log lines, so I'd
like to know how deep the problems go with a summary.
|
|
The colored output is not decoded by the nix log accumulator, so you just get
these control characters. Get rid of them for more readable output.
|
|
This does the full transition: web server, mail server, xmpp. I expect some
disruption, but hopefully this is everything and it just switches over without
any problem.
|
|
I mostly wanted a formatter that would format `inherit` blocks
vertically, because otherwise they are super hard to read when diffing
or even just editing. Both alejandra and the new nixos/nixfmt format
verically like this, but alejandra has slightly better format (I guess)
and for some reason nixfmt did not respect my `GLOBIGNORE` setting when
doing `nixfmt **/*.nix` so it was trying to format stuff in `_/nix`, and
failed. So anyway I went with alejandra.
- https://github.com/kamadorueda/alejandra
- https://discourse.nixos.org/t/enforcing-nix-formatting-in-nixpkgs/49506
|
|
With run.sh, we can build and run the file in one go. This means we can also use
it as an interpreter in a shebang line and properly use the Unix executable bit.
This is pretty cool and gives a few advantages: running any executable file is
just `exec file.hs` or even `./file.hs`, finding all executables is `fd -t x`,
you don't need to specify or know an `out` name to run something, execution of a
program is standardized.
There is a hack to get this to work. In C and Common Lisp, `#!` is illegal
syntax, so I had to use shell syntax to invoke run.sh, call it on the current
file, and then exit the shell script. Meanwhile, run.sh takes the file and evals
the whole thing, building and running it. As long as either `//` or `;` is a
comment character in the target language, then this works. Maybe a better thing
to do would be to pre-process the file and remove the `#!` before passing it to
the C compiler, like [ryanmjacobs/c][1] and [tcc][2]? However this won't work in
Lisp because then I can't just load the file directly into the repl, so maybe
the comment hack needs to stay.
[1]: https://github.com/ryanmjacobs/c/tree/master
[2]: https://repo.or.cz/tinycc.git/blob/HEAD:/tccrun.c
|
|
I was getting confused about what is a product and what is internal
infrastructure; I think it is good to keep those things separate. So I moved a
bunch of stuff to an Omni namespace, actually most stuff went there. Only things
that are explicitly external products are still in the Biz namespace.
|