Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs 30 packages fail to build with native comp on some machines #318

Open
accelbread opened this issue Apr 14, 2023 · 24 comments
Open

Emacs 30 packages fail to build with native comp on some machines #318

accelbread opened this issue Apr 14, 2023 · 24 comments

Comments

@accelbread
Copy link
Contributor

Since 00f31a3, 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 3655d15.

To reproduce, run 'github:nix-community/emacs-overlay#emacsGit.pkgs.dash'

Log output:

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/3dlqnk9lb7m63ncdhzrxgibsjpawbm0a-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
building

Error: error ("Can't read whole string")
  mapbacktrace(#f(compiled-function (evald func args flags) #<bytecode -0xc75da614510e41>))
  debug-early-backtrace()
  debug-early(error (error "Can't read whole string"))
  error("Can't read whole string")
  package-read-from-string("((emacs \"24\"))")
  (package--prepare-dependencies (package-read-from-string (mapconcat #'identity require-lines " ")))
  (if require-lines (package--prepare-dependencies (package-read-from-string (mapconcat #'identity require-lines " "))) nil)
  (let* ((require-lines (and t (lm-header-multiline "package-requires")))) (if require-lines (package--prepare-dependencies (package-read-from-string (mapconcat #'identity require-lines " "))) nil))
  (package-desc-from-define name version (or (save-excursion (goto-char (point-min)) (and (re-search-forward "^;;; [^ ]*\\.el ---[ \11]*\\(.*?\\)[ \11]*\\(-\\*-.*-\\*-[ \11]*\\)?$" nil t) (match-string-no-properties 1))) "No description available.") (let* ((require-lines (and t (lm-header-multiline "package-requires")))) (if require-lines (package--prepare-dependencies (package-read-from-string (mapconcat #'identity require-lines " "))) nil)) :kind (or type 'single) :url (lm-homepage) :keywords (lm-keywords-list) :maintainer (if (fboundp 'lm-maintainers) (car (lm-maintainers)) (with-no-warnings (lm-maintainer))) :authors (lm-authors) :commit commit)
  (progn (insert-file-contents file) (package-desc-from-define name version (or (save-excursion (goto-char (point-min)) (and (re-search-forward "^;;; [^ ]*\\.el ---[ \11]*\\(.*?\\)[ \11]*\\(-\\*-.*-\\*-[ \11]*\\)?$" nil t) (match-string-no-properties 1))) "No description available.") (let* ((require-lines (and t (lm-header-multiline "package-requires")))) (if require-lines (package--prepare-dependencies (package-read-from-string (mapconcat #'identity require-lines " "))) nil)) :kind (or type 'single) :url (lm-homepage) :keywords (lm-keywords-list) :maintainer (if (fboundp 'lm-maintainers) (car (lm-maintainers)) (with-no-warnings (lm-maintainer))) :authors (lm-authors) :commit commit))
  (unwind-protect (progn (insert-file-contents file) (package-desc-from-define name version (or (save-excursion (goto-char (point-min)) (and (re-search-forward "^;;; [^ ]*\\.el ---[ \11]*\\(.*?\\)[ \11]*\\(-\\*-.*-\\*-[ \11]*\\)?$" nil t) (match-string-no-properties 1))) "No description available.") (let* ((require-lines (and t (lm-header-multiline "package-requires")))) (if require-lines (package--prepare-dependencies (package-read-from-string (mapconcat #'identity require-lines " "))) nil)) :kind (or type 'single) :url (lm-homepage) :keywords (lm-keywords-list) :maintainer (if (fboundp 'lm-maintainers) (car (lm-maintainers)) (with-no-warnings (lm-maintainer))) :authors (lm-authors) :commit commit)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents file) (package-desc-from-define name version (or (save-excursion (goto-char (point-min)) (and (re-search-forward "^;;; [^ ]*\\.el ---[ \11]*\\(.*?\\)[ \11]*\\(-\\*-.*-\\*-[ \11]*\\)?$" nil t) (match-string-no-properties 1))) "No description available.") (let* ((require-lines (and t (lm-header-multiline "package-requires")))) (if require-lines (package--prepare-dependencies (package-read-from-string (mapconcat #'identity require-lines " "))) nil)) :kind (or type 'single) :url (lm-homepage) :keywords (lm-keywords-list) :maintainer (if (fboundp 'lm-maintainers) (car (lm-maintainers)) (with-no-warnings (lm-maintainer))) :authors (lm-authors) :commit commit)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents file) (package-desc-from-define name version (or (save-excursion (goto-char (point-min)) (and (re-search-forward "^;;; [^ ]*\\.el ---[ \11]*\\(.*?\\)[ \11]*\\(-\\*-.*-\\*-[ \11]*\\)?$" nil t) (match-string-no-properties 1))) "No description available.") (let* ((require-lines (and t (lm-header-multiline "package-requires")))) (if require-lines (package--prepare-dependencies (package-read-from-string (mapconcat #'identity require-lines " "))) nil)) :kind (or type 'single) :url (lm-homepage) :keywords (lm-keywords-list) :maintainer (if (fboundp 'lm-maintainers) (car (lm-maintainers)) (with-no-warnings (lm-maintainer))) :authors (lm-authors) :commit commit)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (and (file-exists-p file) (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents file) (package-desc-from-define name version (or (save-excursion (goto-char (point-min)) (and (re-search-forward "^;;; [^ ]*\\.el ---[ \11]*\\(.*?\\)[ \11]*\\(-\\*-.*-\\*-[ \11]*\\)?$" nil t) (match-string-no-properties 1))) "No description available.") (let* ((require-lines (and t (lm-header-multiline "package-requires")))) (if require-lines (package--prepare-dependencies (package-read-from-string (mapconcat #'identity require-lines " "))) nil)) :kind (or type 'single) :url (lm-homepage) :keywords (lm-keywords-list) :maintainer (if (fboundp 'lm-maintainers) (car (lm-maintainers)) (with-no-warnings (lm-maintainer))) :authors (lm-authors) :commit commit)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
  (let* ((file (concat name ".el")) (file (or (car (rassoc file files)) file))) (and (file-exists-p file) (let ((temp-buffer (generate-new-buffer " *temp*" t))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (insert-file-contents file) (package-desc-from-define name version (or (save-excursion (goto-char (point-min)) (and (re-search-forward "^;;; [^ ]*\\.el ---[ \11]*\\(.*?\\)[ \11]*\\(-\\*-.*-\\*-[ \11]*\\)?$" nil t) (match-string-no-properties 1))) "No description available.") (let* ((require-lines (and t (lm-header-multiline "package-requires")))) (if require-lines (package--prepare-dependencies (package-read-from-string (mapconcat #'identity require-lines " "))) nil)) :kind (or type 'single) :url (lm-homepage) :keywords (lm-keywords-list) :maintainer (if (fboundp 'lm-maintainers) (car (lm-maintainers)) (with-no-warnings (lm-maintainer))) :authors (lm-authors) :commit commit)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))))
  package-build--desc-from-library("dash" "20230304.2223" "2853d2fcf46eda788e5a3ea08815d0a2bf9d9d32" (("dash.el" . "dash.el") ("dash.texi" . "dash.texi")) tar)
  (or (package-build--desc-from-package name version commit files) (package-build--desc-from-library name version commit files 'tar) (error "%s[-pkg].el matching package name is missing" name))
  (let ((default-directory source-dir)) (or (package-build--desc-from-package name version commit files) (package-build--desc-from-library name version commit files 'tar) (error "%s[-pkg].el matching package name is missing" name)))
  (let* ((target (expand-file-name (concat name "-" version) tmp-dir)) (desc (let ((default-directory source-dir)) (or (package-build--desc-from-package name version commit files) (package-build--desc-from-library name version commit files 'tar) (error "%s[-pkg].el matching package name is missing" name))))) (package-build--copy-package-files files source-dir target) (package-build--write-pkg-file desc target) (package-build--generate-info-files files source-dir target) (package-build--create-tar name version tmp-dir) (package-build--write-pkg-readme name files source-dir) (package-build--write-archive-entry desc))
  (unwind-protect (let* ((target (expand-file-name (concat name "-" version) tmp-dir)) (desc (let ((default-directory source-dir)) (or (package-build--desc-from-package name version commit files) (package-build--desc-from-library name version commit files 'tar) (error "%s[-pkg].el matching package name is missing" name))))) (package-build--copy-package-files files source-dir target) (package-build--write-pkg-file desc target) (package-build--generate-info-files files source-dir target) (package-build--create-tar name version tmp-dir) (package-build--write-pkg-readme name files source-dir) (package-build--write-archive-entry desc)) (delete-directory tmp-dir t nil))
  (let* ((name (eieio-oref rcp 'name)) (tmp-dir (file-name-as-directory (make-temp-file name t)))) (unwind-protect (let* ((target (expand-file-name (concat name "-" version) tmp-dir)) (desc (let ((default-directory source-dir)) (or (package-build--desc-from-package name version commit files) (package-build--desc-from-library name version commit files 'tar) (error "%s[-pkg].el matching package name is missing" name))))) (package-build--copy-package-files files source-dir target) (package-build--write-pkg-file desc target) (package-build--generate-info-files files source-dir target) (package-build--create-tar name version tmp-dir) (package-build--write-pkg-readme name files source-dir) (package-build--write-archive-entry desc)) (delete-directory tmp-dir t nil)))
  package-build--build-multi-file-package(#<package-github-recipe package-github-recipe-4133ea> "20230304.2223" "2853d2fcf46eda788e5a3ea08815d0a2bf9d9d32" (("dash.el" . "dash.el") ("dash.texi" . "dash.texi")) "/build/working/dash/")
  (cond ((= (length files) 1) (package-build--build-single-file-package rcp version commit files source-dir)) ((> (length files) 1) (package-build--build-multi-file-package rcp version commit files source-dir)) (t (error "Unable to find files matching recipe patterns")))
  (let ((files (package-build-expand-files-spec rcp t))) (cond ((= (length files) 1) (package-build--build-single-file-package rcp version commit files source-dir)) ((> (length files) 1) (package-build--build-multi-file-package rcp version commit files source-dir)) (t (error "Unable to find files matching recipe patterns"))))
  (let ((source-dir (package-recipe--working-tree rcp))) (let ((files (package-build-expand-files-spec rcp t))) (cond ((= (length files) 1) (package-build--build-single-file-package rcp version commit files source-dir)) ((> (length files) 1) (package-build--build-multi-file-package rcp version commit files source-dir)) (t (error "Unable to find files matching recipe patterns")))))
  melpa2nix-build-package-1(#<package-github-recipe package-github-recipe-4133ea> "20230304.2223" "2853d2fcf46eda788e5a3ea08815d0a2bf9d9d32")
  (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit))
  (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit)))
  (let* ((x62 (car-safe x61)) (x63 (cdr-safe x61))) (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit))))
  (if (consp x61) (let* ((x62 (car-safe x61)) (x63 (cdr-safe x61))) (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit)))))
  (let* ((x60 (car-safe x59)) (x61 (cdr-safe x59))) (if (consp x61) (let* ((x62 (car-safe x61)) (x63 (cdr-safe x61))) (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit))))))
  (if (consp x59) (let* ((x60 (car-safe x59)) (x61 (cdr-safe x59))) (if (consp x61) (let* ((x62 (car-safe x61)) (x63 (cdr-safe x61))) (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit)))))))
  (let* ((x58 (car-safe command-line-args-left)) (x59 (cdr-safe command-line-args-left))) (if (consp x59) (let* ((x60 (car-safe x59)) (x61 (cdr-safe x59))) (if (consp x61) (let* ((x62 (car-safe x61)) (x63 (cdr-safe x61))) (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit))))))))
  (if (consp command-line-args-left) (let* ((x58 (car-safe command-line-args-left)) (x59 (cdr-safe command-line-args-left))) (if (consp x59) (let* ((x60 (car-safe x59)) (x61 (cdr-safe x59))) (if (consp x61) (let* ((x62 (car-safe x61)) (x63 (cdr-safe x61))) (if (null x63) (let ((package x58) (version x60) (commit x62)) (melpa2nix-build-package-1 (package-recipe-lookup package) version commit)))))))))
  melpa2nix-build-package()
  command-line-1(("-L" "/build/package-build" "-l" "/nix/store/65hf8xsn31cindnpqcnha1w591jyvzhb-melpa2nix.el" "-f" "melpa2nix-build-package" "dash" "20230304.2223" "2853d2fcf46eda788e5a3ea08815d0a2bf9d9d32"))
  command-line()
  normal-top-level()
Can't read whole string
@accelbread
Copy link
Contributor Author

Here is the relevant diff for emacs between the new commit and old for that version bump:
emacs-mirror/emacs@c146bd8...8fdd771

@accelbread
Copy link
Contributor Author

Flymake stuff doesn't seem relevant so probably one of these two: emacs-mirror/emacs@c146bd8...9d025ea

@leungbk
Copy link
Member

leungbk commented Apr 20, 2023

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.

@accelbread
Copy link
Contributor Author

Works now after updating emacs-overlay to f86e396

@accelbread
Copy link
Contributor Author

Will close since fixed on master

@accelbread
Copy link
Contributor Author

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.

@accelbread accelbread reopened this Apr 21, 2023
@accelbread accelbread changed the title Emacs packages fail to build Emacs packages fail to build on some machines Apr 21, 2023
@accelbread
Copy link
Contributor Author

accelbread commented Apr 21, 2023

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?

@accelbread
Copy link
Contributor Author

accelbread commented Apr 23, 2023

Ok so its definitely emacs-mirror/emacs@ea9831b.
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.

@accelbread accelbread changed the title Emacs packages fail to build on some machines Emacs 30 packages fail to build with native comp on some machines Apr 23, 2023
@accelbread
Copy link
Contributor Author

@accelbread
Copy link
Contributor Author

For now, I'm patching emacs as seen here: accelbread/config-flake@8e5e3ad

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.

@leungbk
Copy link
Member

leungbk commented Apr 24, 2023

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.

@accelbread
Copy link
Contributor Author

Yes, packages successfully native compile when using package.el and calling package-install with package-native-compile enabled.

@Vonfry
Copy link
Contributor

Vonfry commented Apr 30, 2023

I meet this today as well. Packages cannot be natively compile with emacsGit. However, emacs unstable (29) can work.

@accelbread
Copy link
Contributor Author

@Vonfry What CPU do you have? Maybe that can help narrow it down.

@Vonfry
Copy link
Contributor

Vonfry commented Apr 30, 2023

@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

@accelbread
Copy link
Contributor Author

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

@accelbread
Copy link
Contributor Author

accelbread commented Apr 30, 2023

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

@yorickvP
Copy link

yorickvP commented May 5, 2023

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'

@leungbk
Copy link
Member

leungbk commented May 5, 2023

I forwarded this report upstream: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63288

Hopefully they might have some insight.

@accelbread
Copy link
Contributor Author

accelbread commented May 5, 2023

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.

@ParetoOptimalDev
Copy link

ParetoOptimalDev commented Jan 23, 2024

I'm getting failures for aarch64-linux again for b47e82d. I'm not sure, but I believe 70164fb was building.

Changes: https://github.com/nix-community/emacs-overlay/compare/b47e82dbcfdfa4b6ce844565707b51fde1b58988..70164fbf83cdcd4d3772db6193a5b402716271e5

I'll try double-checking it succeeds for 70164f again later.

@leungbk
Copy link
Member

leungbk commented Jan 23, 2024

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.

@leungbk
Copy link
Member

leungbk commented Jan 24, 2024

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, b47e82d 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.

@ParetoOptimalDev
Copy link

Thanks @leungbk, things seem to be building now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants