https://ecl.common-lisp.dev/posts/ECL-26327-release.html
- Dropped GCC 15 patches are part of the release.
- write_error.patch no longer applies, but appears to be intended to
resolve an issue that has been fixed years ago according to the bug
tracker.
Because the default C version of clang is not synchronized with gcc, to
avoid further propagation of overriding CFLAGS to downstream packages,
only apply gcc15 compat patches when the compiler is gcc. Therefore, it
can be compiled with clang as well.
Follow up for pr #476147.
Co-authored-by: Aleksana <me@aleksana.moe>
Instead of downgrading to C17, import upstream patches for gcc15
compatibility. So downstream packages e.g. sage can build correctly
without setting CFLAGS.
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.
Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
- add "CFLAGS=-std=gnu17" to `configureFlags`.
There are patches upstream to make it build with `-std=gnu23`
(default in gcc15):
https://gitlab.com/embeddable-common-lisp/ecl/-/merge_requests/325https://gitlab.com/embeddable-common-lisp/ecl/-/merge_requests/345
but applying them makes it not build with `-std=gnu17` (default in gcc14)
instead.
Fixes build failure with gcc15:
```
/build/ecl-24.5.10/src/c/dpp.c:112:13: error: 'bool' cannot be defined
via 'typedef'
112 | typedef int bool;
| ^~~~
/build/ecl-24.5.10/src/c/dpp.c:112:13: note: 'bool' is a keyword
with '-std=c23' onwards
/build/ecl-24.5.10/src/c/dpp.c:112:1: warning: useless type name in
empty declaration
112 | typedef int bool;
| ^~~~~~~
```
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.
Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.
A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.
This commit was automatically created and can be verified using
nix-build a08b3a4d19.tar.gz \
--argstr baseRev b32a094368
result/bin/apply-formatting $NIXPKGS_PATH
In preparation for the deprecation of `stdenv.isX`.
These shorthands are not conducive to cross-compilation because they
hide the platforms.
Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way
One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059
There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.
```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
Done with the help of https://github.com/Mindavi/nixpkgs-mark-broken
Tool is still WIP but this is one of the first results.
I manually audited the results and removed some results that were not valid.
Note that some of these packages maybe should have more constrained platforms set
instead of broken set, but I think not being perfectly correct is better than
just keep trying to build all these things and never succeeding.
Some observations:
- Some darwin builds require XCode tools
- aarch64-linux builds sometimes suffer from using gcc9
- gcc9 is getting older and misses some new libraries/features
- Sometimes tools try to do system detection or expect some explicit settings for
platforms that are not x86_64-linux
Make clearer the difference between `maxima` and `maxima-ecl` top-level
attributes. Use the `lisp-compiler` as a passthru for all of sage's
expressions. Add the `pname` attribute for `ecl` for compatibility with
other lisp implementations.
* Use --with-gmp-incdir and --with-gmp-libdir (like for the main ecl
derivation), so ecl can figure out the flags to pass on its own.
Remove NIX_LDFLAGS hack for gmp.
* Make sure ecl can find boehmgc when linking programs / libraries via
NIX_LDFLAGS. Pass correct -I for boehmgc via NIX_CFLAGS_COMPILE since
there's no --with-boehmgc-prefix configure flag to achieve the same
result.
* Use correct suffixSalt for every flag. This makes NIX_CFLAGS_COMPILE
work properly in the first place and should prevent the extra flags
hacks leaking into other places in some edge cases.
All libraries that ecl will have compiled libraries and executables link
against now have their own --with-<dep>-incdir and --with-<dep>-libdir
flag which is perfect for our distinct lib and dev outputs.
Consequently, we can get rid of the NIX_LDFLAGS-based hack in the
wrapper since ecl can figure out which flags to pass on its own.