Closed accelbread closed 5 days ago
Here is the relevant diff for emacs between the new commit and old for that version bump: https://github.com/emacs-mirror/emacs/compare/c146bd893dfbc8a4c92f9d1f33def8f29e7ece1f...8fdd7710ec0448fe9d3908ad073ddd4d69917719
Flymake stuff doesn't seem relevant so probably one of these two: https://github.com/emacs-mirror/emacs/compare/c146bd893dfbc8a4c92f9d1f33def8f29e7ece1f...9d025eab2492519b26d69667a529865ea01f3318
I encountered this the other day (with vterm
instead of dash
) but have since had no issues; are you still able to reproduce? Using nixpkgs 0d9d4e984ed4dbac5428abc9ca62b7e3808ac412
and emacs-overlay cbca5fd577779cbb9228bcdc65474b8cdfe61a2e
, an emacsGit
with both dash
and vterm
builds properly.
Works now after updating emacs-overlay to f86e3962f7b01ffb470b08c0cf95b6ca85516432
Will close since fixed on master
Reopening. I'd tested the above commit on a different machine. Tried on the machine I encountered the issue on, exact same derivation, and fails.
Have done a bunch of full rebuilds of that same derivation; they keep failing on one machine and passing on the other. To isolate the system state, I also ran builds in podman with the nixos/nix container. Same issue where the builds pass on one machine and not the other.
Build succeeds with emacsUnstable. Also passes with emacsPgtk/emacsGit with nativeComp turned off. So likely an issue with native comp with one of the mentioned commits.
emacsUnstable building with nativeComp makes it seem unlikely to be a libgccjit bug?
Ok so its definitely https://github.com/emacs-mirror/emacs/commit/ea9831bb3cb4878273f6f848051c9b8c3c76d5f1. In particular the second hunk. Current tip of master works fine with that hunk reverted.
However even without that revert, running emacs without emacsWithPackages, and installing packages from inside emacs works, so not a compilation issue.
Either that emacs commit is buggy or part of the package native compilation machinery in nixpkgs needs to be updated.
Well, still can't rule out a libgccjit bug that is only exposed by the aforementioned commit. That might actually make the most sense since it works on my intel laptop but not my amd desktop.
The build line that hits the error seems to be https://github.com/NixOS/nixpkgs/blob/b75b059c747da4e2cd213c23895f49db94b57290/pkgs/build-support/emacs/melpa.nix#L82-L86
For now, I'm patching emacs as seen here: https://github.com/accelbread/config-flake/commit/8e5e3add3eb23a07866b1704da7df5536c14634b
Still don't have a root cause, but likely wont have time to investigate further for a bit.
If someone else is facing this issue, feel free to chime in or take over.
On your AMD machine, are you able to install and natively compile external packages outside of Nix (for example, with the default package.el
, or with straight
)? If so, then the problem may be related to melpa2nix.el
, and not upstream Emacs.
Yes, packages successfully native compile when using package.el
and calling package-install
with package-native-compile
enabled.
I meet this today as well. Packages cannot be natively compile with emacsGit. However, emacs unstable (29) can work.
@Vonfry What CPU do you have? Maybe that can help narrow it down.
@accelbread the following print is from lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 46 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Vendor ID: GenuineIntel
Model name: 13th Gen Intel(R) Core(TM) i9-13900K
CPU family: 6
Model: 183
Thread(s) per core: 2
Core(s) per socket: 24
Socket(s): 1
Stepping: 1
CPU(s) scaling MHz: 53%
CPU max MHz: 5800.0000
CPU min MHz: 800.0000
BogoMIPS: 5990.40
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdp
e1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqd
q dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xs
ave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriori
ty ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx smap clflushopt clwb intel_pt sha_ni xsaveopt xsave
c xgetbv1 xsaves split_lock_detect avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi umip pku osp
ke waitpkg gfni vaes vpclmulqdq tme rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities
Virtualization features:
Virtualization: VT-x
Caches (sum of all):
L1d: 896 KiB (24 instances)
L1i: 1.3 MiB (24 instances)
L2: 32 MiB (12 instances)
L3: 36 MiB (1 instance)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-31
Vulnerabilities:
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Mmio stale data: Not affected
Retbleed: Not affected
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
Srbds: Not affected
Tsx async abort: Not affected
The cpu I am having the issue on is a 5950x.
lscpu output:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Address sizes: 48 bits physical, 48 bits virtual
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Vendor ID: AuthenticAMD
Model name: AMD Ryzen 9 5950X 16-Core Processor
CPU family: 25
Model: 33
Thread(s) per core: 2
Core(s) per socket: 16
Socket(s): 1
Stepping: 0
Frequency boost: enabled
CPU(s) scaling MHz: 70%
CPU max MHz: 5083.3979
CPU min MHz: 2200.0000
BogoMIPS: 6800.48
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf
rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr
_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate pti ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec
xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr rdpru wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avi
c v_vmsave_vmload vgif v_spec_ctrl umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca fsrm
Virtualization features:
Virtualization: AMD-V
Caches (sum of all):
L1d: 512 KiB (16 instances)
L1i: 512 KiB (16 instances)
L2: 8 MiB (16 instances)
L3: 64 MiB (2 instances)
NUMA:
NUMA node(s): 1
NUMA node0 CPU(s): 0-31
Vulnerabilities:
Itlb multihit: Not affected
L1tf: Not affected
Mds: Not affected
Meltdown: Not affected
Mmio stale data: Not affected
Retbleed: Not affected
Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Spectre v2: Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP always-on, RSB filling, PBRSB-eIBRS Not affected
Srbds: Not affected
Tsx async abort: Not affected
Might be related to core count. Tried building with --cores 1
and it works.
Works:
nix-collect-garbage
nix build github:nix-community/emacs-overlay#emacsPgtk.pkgs.emacs --no-link --cores 1
nix build github:nix-community/emacs-overlay#emacsPgtk.pkgs.dash --no-link
Fails:
nix-collect-garbage
nix build github:nix-community/emacs-overlay#emacsPgtk.pkgs.emacs --no-link
nix build github:nix-community/emacs-overlay#emacsPgtk.pkgs.dash --no-link
Reproduce with:
let
f = builtins.getFlake "github:nix-community/emacs-overlay";
nixpkgs = f.packages.${builtins.currentSystem};
lib = f.lib.${builtins.currentSystem};
in
rec {
origEmacs = nixpkgs.emacsPgtk;
emacs = nixpkgs.emacsPgtk.overrideAttrs (o: {
enableParallelBuilding = false;
GNUMAKEFLAGS = "--shuffle=12346 " + o.GNUMAKEFLAGS or "";
});
epkgs = lib.emacsPackagesFor emacs;
dash = epkgs.dash;
}
nix build -f . 'dash'
I forwarded this report upstream: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63288
Hopefully they might have some insight.
So since it might be a core count thing, and I have 32 cores, I've tried building with all the values of the --cores
flag from 1 to 32.
The failing values are: 20, 22, and 25 through 32. (Have not tested past 32)
Odd that 21, 23, and 24 work.
It consistently works with the working core counts, and fails with the failing core counts.
I'm getting failures for aarch64-linux again for b47e82dbcfdfa4b6ce844565707b51fde1b58988. I'm not sure, but I believe 70164fbf83cdcd4d3772db6193a5b402716271e5 was building.
I'll try double-checking it succeeds for 70164f again later.
I've pushed a commit removing the patch; without any knowledge of the byte-compiler, the best I can do is to guess and check.
I've pushed a commit removing the patch; without any knowledge of the byte-compiler, the best I can do is to guess and check.
Never mind, I reverted since I encountered the error described in this issue immediately after removing the patch, whereas adding back the patch fixed it for me.
I'm getting failures for aarch64-linux again for b47e82d. I'm not sure, but I believe 70164fb was building.
Hmm, https://github.com/nix-community/emacs-overlay/commit/b47e82dbcfdfa4b6ce844565707b51fde1b58988 is working for me. It doesn't seem to be a matter of the overlay revision; different people in this thread seem to be encountering the issue at different revisions.
I showed Mattias Engdegard this thread a while ago, but he doesn't believe that it was caused by his changes to the byte-compiler. Again, I'm not familiar with the details of the byte-compiler, so I won't be able to look into this for a while, if ever.
Thanks @leungbk, things seem to be building now.
I am closing all issues that looks unrelated to the overlay itself. Issues reported here should only be pertaining to the overlay infrastructure.
Build issues, runtime issues & the like should be reported to nixpkgs, where this code actually lives.
Since 00f31a3be2f8d42cddd61b9a4e858eb1feae63e5, packages fail to build for emacsGit and emacsPgtk.
Since this is an automated version bump, seems it was triggered by an upstream change. Though the error log makes it seem the nix build stuff might need to be updated to accommodate it?
As a workaround, can use commit 3655d1502e02bafa2668a74e511166ce5415c247.
To reproduce, run
'github:nix-community/emacs-overlay#emacsGit.pkgs.dash'
Log output: