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

Update request: nyxt 2.2.4 → 3-pre-release-3 #217888

Closed
1 task done
Slime90 opened this issue Feb 23, 2023 · 10 comments · Fixed by #235095
Closed
1 task done

Update request: nyxt 2.2.4 → 3-pre-release-3 #217888

Slime90 opened this issue Feb 23, 2023 · 10 comments · Fixed by #235095
Labels
9.needs: package (update) This needs a package to be updated

Comments

@Slime90
Copy link

Slime90 commented Feb 23, 2023

Currently 3 releases (and over a year) behind.

  • Package name: nyxt
  • Latest released version: 3-pre-release-3
  • Current version on the unstable channel: 2.2.4
  • Current version on the stable/release channel: 2.2.4

Notify maintainers

@nlewo @bhankas


Note for maintainers: Please tag this issue in your PR.

@Slime90 Slime90 added the 9.needs: package (update) This needs a package to be updated label Feb 23, 2023
@Slime90 Slime90 changed the title Update request: NYXT 2.2.4 → 3-pre-release-3 Update request: nyxt 2.2.4 → 3-pre-release-3 Feb 23, 2023
@bhankas
Copy link
Contributor

bhankas commented Feb 24, 2023

Thanks for notifying! I haven't used Nyxt in a long while, so Ive missed the updates. I should remove myself as maintainer, but $LIFE has kept me incredibly occupied this last year. Apologies, but I will not be able to maintain Nyxt in nixpkgs for foreseeable future.

@ScottFreeCode
Copy link

Nyxt recently released 3.0.0; this issue could be updated to reflect that the new version is out of pre-release!

(I see two maintainers in the default.nix file. Are those GitHub usernames we could ping? It would be awesome to get the new version into NixOS 23.05! If it isn't already too late of course.)

@Vonfry
Copy link
Member

Vonfry commented May 21, 2023

I tried to build a new nyxt several weeks, but it failed with a wired error. If someone knows how to fix it, please try to open a pr to update nyxt to version 3.0.

@dariof4
Copy link
Contributor

dariof4 commented May 22, 2023

I've been trying to package 3.0.0, I was able to fix the error @Vonfry got and make it start compiling the lisp files, but now I'm stuck at another error.

Build Log

; wrote /build/source-patched/source/dom-tmpG6VFGMYP.fasl
; compilation finished in 0:00:00.448
; compiling file "NYXT:SOURCE;BUFFER.LISP.NEWEST" (written 01 JAN 1970 12:00:01 AM):

; wrote /build/source-patched/source/buffer-tmp4QIPRMOF.fasl
; compilation finished in 0:00:00.332

debugger invoked on a SB-INT:SIMPLE-PROGRAM-ERROR in thread
#<THREAD tid=430 "main thread" RUNNING {1001098073}>:
  PROMPTER:ACTIONS-ON-RETURN already names an ordinary function or a macro.

Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [CONTINUE                     ] Replace the function binding
  1: [TRY-RECOMPILING              ] Recompile buffer and try loading it again
  2: [RETRY                        ] Retry
                                     loading FASL for #<CL-SOURCE-FILE "nyxt" "Core" "buffer">.
  3: [ACCEPT                       ] Continue, treating
                                     loading FASL for #<CL-SOURCE-FILE "nyxt" "Core" "buffer">
                                     as having been successful.
  4:                                 Retry ASDF operation.
  5: [CLEAR-CONFIGURATION-AND-RETRY] Retry ASDF operation after resetting the
                                     configuration.
  6: [ABORT                        ] Exit debugger, returning to top level.

(ENSURE-GENERIC-FUNCTION PROMPTER:ACTIONS-ON-RETURN :LAMBDA-LIST (SB-PCL::OBJECT))
0]
;
; compilation unit aborted
;   caught 1 fatal ERROR condition
;   printed 2 notes

(full log: https://0x0.st/HqPB.txt)
My progress is in this branch if anybody wants to try their hand at it: https://github.com/dariof4/nixpkgs/tree/nyxt-3

@aadcg
Copy link

aadcg commented May 24, 2023

Unfortunately, I don't know much about Nix and its package definitions and, particularly, how it manages CL libraries. Still I may be able to provide some high-level tips, since I've spotted some issues with the definition @dariof4 wrote. @Ambrevar may have some clues too.

Find the Guix package definition below. Notice that libraries/nasdf is deleted from the Nyxt sources. nasdf can be found at https://github.com/atlas-engineer/ntemplate and you need to point to the latest commit (not the latest release). I'm also sharing the Guix package definition for nasdf below.

Nyxt will soon delete library/nasdf from its sources.

(define-public nyxt
  (package
    (name "nyxt")
    (version "3.0.0")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/atlas-engineer/nyxt")
             (commit version)))
       (sha256
        (base32
         "1jzlpi2iam15f0724nh6pb0zfs8d89mrf3zkvd87g99aq9w2h02a"))
       (file-name (git-file-name "nyxt" version))
       (modules '((guix build utils)))
       (snippet
        `(begin
           (delete-file-recursively "libraries/nasdf")
           #t))))
    (build-system gnu-build-system)
    (arguments
     `(#:make-flags (list "nyxt" "NYXT_SUBMODULES=false"
                          (string-append "DESTDIR=" (assoc-ref %outputs "out"))
                          "PREFIX=")
       #:strip-binaries? #f             ; Stripping breaks SBCL binaries.
       #:phases
       (modify-phases %standard-phases
         (delete 'configure)
         (add-before 'build 'fix-common-lisp-cache-folder
           (lambda _
             (setenv "HOME" "/tmp")
             #t))
         (add-before 'check 'configure-tests
           (lambda _
             (setenv "NYXT_TESTS_NO_NETWORK" "1")
             (setenv "NYXT_TESTS_ERROR_ON_FAIL" "1")
             #t))
         (add-after 'install 'wrap-program
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let* ((bin (string-append (assoc-ref outputs "out") "/bin/nyxt"))
                    (glib-networking (assoc-ref inputs "glib-networking"))
                    (libs '("gsettings-desktop-schemas"))
                    (path (string-join
                           (map (lambda (lib)
                                  (string-append (assoc-ref inputs lib) "/lib"))
                                libs)
                           ":"))
                    (gi-path (getenv "GI_TYPELIB_PATH"))
                    (xdg-path (string-join
                               (map (lambda (lib)
                                      (string-append (assoc-ref inputs lib) "/share"))
                                    libs)
                               ":")))
               (wrap-program bin
                 `("GIO_EXTRA_MODULES" prefix
                   (,(string-append glib-networking "/lib/gio/modules")))
                 `("GI_TYPELIB_PATH" prefix (,gi-path))
                 `("LD_LIBRARY_PATH" ":" prefix (,path))
                 `("XDG_DATA_DIRS" ":" prefix (,xdg-path)))
               #t))))))
    (native-inputs (list cl-lisp-unit2 sbcl))
    (inputs (list sbcl-alexandria
                  sbcl-bordeaux-threads
                  sbcl-calispel
                  sbcl-cl-base64
                  sbcl-cl-colors2
                  sbcl-cl-containers
                  sbcl-cl-gopher
                  sbcl-cl-html-diff
                  sbcl-cl-json
                  sbcl-cl-ppcre
                  sbcl-cl-prevalence
                  sbcl-cl-qrencode
                  sbcl-cl-str
                  sbcl-cl-tld
                  sbcl-closer-mop
                  sbcl-clss
                  sbcl-cluffer
                  sbcl-custom-hash-table
                  sbcl-dexador
                  sbcl-dissect
                  sbcl-enchant
                  sbcl-flexi-streams
                  sbcl-fset
                  sbcl-history-tree
                  sbcl-iolib
                  sbcl-lass
                  sbcl-local-time
                  sbcl-log4cl
                  sbcl-lparallel
                  sbcl-mk-string-metrics
                  sbcl-montezuma
                  sbcl-moptilities
                  sbcl-named-readtables
                  sbcl-nasdf
                  sbcl-nclasses
                  sbcl-ndebug
                  sbcl-nfiles
                  sbcl-nhooks
                  sbcl-njson
                  sbcl-nkeymaps
                  sbcl-nsymbols
                  sbcl-parenscript
                  sbcl-phos
                  sbcl-plump
                  sbcl-prompter
                  sbcl-py-configparser
                  sbcl-quri
                  sbcl-serapeum
                  sbcl-slime-swank
                  sbcl-slynk
                  sbcl-spinneret
                  sbcl-trivia
                  sbcl-trivial-clipboard
                  sbcl-trivial-custom-debugger
                  sbcl-trivial-features
                  sbcl-trivial-garbage
                  sbcl-trivial-package-local-nicknames
                  sbcl-trivial-types
                  sbcl-unix-opts
                  ;; WebKitGTK deps
                  sbcl-cl-cffi-gtk
                  sbcl-cl-webkit
                  glib-networking
                  gsettings-desktop-schemas
                  cl-gobject-introspection
                  gtk+                  ; For the main loop
                  webkitgtk             ; Required when we use its typelib
                  gobject-introspection
                  pkg-config))
    (synopsis "Extensible web-browser in Common Lisp")
    (home-page "https://nyxt.atlas.engineer")
    (description "Nyxt is a keyboard-oriented, extensible web-browser designed
for power users.  The application has familiar Emacs and VI key-bindings and
is fully configurable and extensible in Common Lisp.")
    (license license:bsd-3)))

(define-public sbcl-nasdf
  (let ((commit "c63a6ff12239f132844cc0703e79ea3b33dae630"))
    (package
      (name "sbcl-nasdf")
      (version "0.1.2")
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/atlas-engineer/ntemplate")
               (commit commit)))
         (file-name (git-file-name "cl-ntemplate" version))
         (sha256
          (base32
           "1b57jkyrvr3n0c66lih4m34fqzw3s5yqlk91v7hg2gchcn3v9glg"))))
      (build-system asdf-build-system/sbcl)
      (arguments
       `(#:phases
         (modify-phases %standard-phases
           (add-after 'unpack 'cd-sdl
             (lambda _
               (chdir "nasdf")
               #t)))))
      (home-page "https://github.com/atlas-engineer/ntemplate")
      (synopsis "ASDF helpers for system setup, testing and installation")
      (description
       "NASDF is an ASDF extension providing utilities to ease system setup, testing and installation.

@itemize
@item Simple way to fetch Git submodules and “do the right thing” for
setup. This may effectively supersede Quicklisp. A benefit of using Git
submodules over the default Quicklisp distribution is improved
reproducibility.
@item Test helpers, like distinction between offline and online tests, or
continuous integration options, and warning reports.
@item Installation helpers, for instance to install libraries, icons and
desktop files to the right directories.
@end itemize\n")
      (license license:bsd-3))))

@dariof4
Copy link
Contributor

dariof4 commented May 24, 2023

Unfortunately, I don't know much about Nix and its package definitions and, particularly, how it manages CL libraries. Still I may be able to provide some high-level tips, since I've spotted some issues with the definition @dariof4 wrote. @Ambrevar may have some clues too.

Find the Guix package definition below. Notice that libraries/nasdf is deleted from the Nyxt sources. nasdf can be found at https://github.com/atlas-engineer/ntemplate and you need to point to the latest commit (not the latest release). I'm also sharing the Guix package definition for nasdf below.

Nyxt will soon delete library/nasdf from its sources.

Thanks for the heads-up! I switched out the nasdf source from the nyxt repo to the ntemplate repo.
That branch is actually slightly out of date, in the end I was successfully able to get 3.0 to compile :-), but unfortunately it crashes on startup without opening any windows with this log:

ASDF could not load nasdf because Can't create directory /homeless-shelter.
While evaluating the form starting at line 10, column 0
  of #P"/nix/store/y7khybvbxy61jghhzqmqcjgbl7w90nkg-source/nyxt.asd":
;
; compilation unit aborted
;   caught 2 fatal ERROR conditions
Nyxt version 3.0.0
ASDF could not load nasdf because Can't create directory /homeless-shelter.
While evaluating the form starting at line 10, column 0
  of #P"/nix/store/y7khybvbxy61jghhzqmqcjgbl7w90nkg-source/nyxt.asd":
;
; compilation unit aborted
;   caught 2 fatal ERROR conditions
ASDF could not load nasdf because Can't create directory /homeless-shelter.
While evaluating the form starting at line 10, column 0
  of #P"/nix/store/y7khybvbxy61jghhzqmqcjgbl7w90nkg-source/nyxt.asd":
;
; compilation unit aborted
;   caught 2 fatal ERROR conditions
<INFO> [23:22:08] Source location: #P""
<INFO> [23:22:08] Listening to socket: #P"/run/user/1000/nyxt/nyxt.socket"

debugger invoked on a ASDF/PLAN:SYSTEM-OUT-OF-DATE in thread
#<THREAD tid=170346 "Nyxt finalize-window" RUNNING {1008510003}>:
  system nyxt is out of date

The current thread is not at the foreground,
SB-THREAD:RELEASE-FOREGROUND has to be called in #<SB-THREAD:THREAD tid=170331 "main thread" RUNNING {1008510553}>
for this thread to enter the debugger.

But, it works fine if I run it with --failsafe or with --profile nofile, I wonder if the SYSTEM-OUT-OF-DATE error is what's causing it, it seems like it tries to recomplie nyxt, but fails (maybe <INFO> [23:22:08] Source location: #P"" is related?).
Heres the log running with --profile nofile for reference:

Log when running with --profile nofile
ASDF could not load nasdf because Can't create directory /homeless-shelter.
While evaluating the form starting at line 10, column 0
  of #P"/nix/store/y7khybvbxy61jghhzqmqcjgbl7w90nkg-source/nyxt.asd":
;
; compilation unit aborted
;   caught 2 fatal ERROR conditions
Nyxt version 3.0.0
ASDF could not load nasdf because Can't create directory /homeless-shelter.
While evaluating the form starting at line 10, column 0
  of #P"/nix/store/y7khybvbxy61jghhzqmqcjgbl7w90nkg-source/nyxt.asd":
;
; compilation unit aborted
;   caught 2 fatal ERROR conditions
ASDF could not load nasdf because Can't create directory /homeless-shelter.
While evaluating the form starting at line 10, column 0
  of #P"/nix/store/y7khybvbxy61jghhzqmqcjgbl7w90nkg-source/nyxt.asd":
;
; compilation unit aborted
;   caught 2 fatal ERROR conditions
<INFO> [00:03:56] Source location: #P""
<INFO> [00:03:56] Profile: "nofile"
<INFO> [00:03:56] Listening to socket: #P"/run/user/1000/nyxt/nyxt.socket"
Could not determine the accessibility bus address

** (process:2): WARNING **: 00:03:56.765: Failed to connect to bus: The given address is empty

** (process:2): WARNING **: 00:03:56.786: Failed to connect to bus: The given address is empty

** (WebKitWebProcess:2): WARNING **: 00:03:56.818: Can't connect to a11y bus: Error sending credentials: Error sending message: Broken pipe

** (WebKitWebProcess:2): WARNING **: 00:03:56.864: Can't connect to a11y bus: Error receiving data: Connection reset by peer

** (process:2): WARNING **: 00:03:56.896: Failed to connect to bus: The given address is empty

** (WebKitWebProcess:2): WARNING **: 00:03:56.980: Can't connect to a11y bus: Error receiving data: Connection reset by peer

** (process:2): WARNING **: 00:03:57.146: Failed to connect to bus: The given address is empty

** (WebKitWebProcess:2): WARNING **: 00:03:57.230: Can't connect to a11y bus: Error receiving data: Connection reset by peer
I wonder if using sb-ext:save-lisp-and-die instead of asdf:make is the reason, though I can't get asdf:make to work with nix :-( Also, forgive if this is a dumb question, but what's the difference between nyxt/gtk-application and nyxt/gi-gtk-application 😅 ? I see that in the makefile it's gi-gtk-application while the 2.2.4 nyxt nix package used gtk-application.
I updated my branch (https://github.com/dariof4/nixpkgs/tree/nyxt-3) with the changes I made, forgive me if it's a bit messy, I plan on cleaning it up after getting nyxt fully working.

@aadcg
Copy link

aadcg commented May 25, 2023

what's the difference between nyxt/gtk-application and nyxt/gi-gtk-application

GI stands for GObject Introspection. They're similar, but gi-gtk-application should be used.

I wonder if using sb-ext:save-lisp-and-die instead of asdf:make is the reason, though I can't get asdf:make to work with nix

Could you explain why it doesn't work with asdf:make?

it seems like it tries to recomplie nyxt, but fails

It does seem like it. But I don't understand why this is being done. The package definition should be able to generate the Nyxt binary, and then invoking nyxt should just work. It seems that, in the way you're packaging Nyxt, calling nyxt triggers re-compiling CL systems. It may be because it sees that the modification date of /nix/store/y7khybvbxy61jghhzqmqcjgbl7w90nkg-source/nyxt.asd is newer than the modification date of other source library files it depends on.

I'm wildly trying to shoot in the dark, sorry! Probably I'm not making much sense.

@dariof4
Copy link
Contributor

dariof4 commented May 25, 2023

what's the difference between nyxt/gtk-application and nyxt/gi-gtk-application

GI stands for GObject Introspection. They're similar, but gi-gtk-application should be used.

Okay! I'll package gi-gtk-application then.

I wonder if using sb-ext:save-lisp-and-die instead of asdf:make is the reason, though I can't get asdf:make to work with nix

Could you explain why it doesn't work with asdf:make?

it seems like it tries to recomplie nyxt, but fails

It does seem like it. But I don't understand why this is being done. The package definition should be able to generate the Nyxt binary, and then invoking nyxt should just work. It seems that, in the way you're packaging Nyxt, calling nyxt triggers re-compiling CL systems. It may be because it sees that the modification date of /nix/store/y7khybvbxy61jghhzqmqcjgbl7w90nkg-source/nyxt.asd is newer than the modification date of other source library files it depends on.

Welp, this got me to take another look at it, and that was the problem after all! for some reason it works with asdf:make but not with sb-ext:save-lisp-and-die, thankfully I was able to get asdf:make working! The way I understand it is that asdf:make compiles the file into the source directory where the .asd file is located, which is in the nix store (which is immutable), so the build would fail, but there existed a function to compile lisp programs that write to the source dir (build-with-compile-into-pwd) that I didn't think about till today, using it makes asdf:make work correctly, and using asf:make makes nyxt work perfectly! 🎉

Though it is a bit of an hack, since build-with-compile-into-pwd builds the derivation twice, so it build nyxt once and compiles correctly, then it tries to build it again and fails due to not being able to write the compiled file, but then it uses the copied compiled file from the first build to corretly install nyxt.
There might be a better way to go about using asdf:make, but I haven't found any so far.

I'm wildly trying to shoot in the dark, sorry! Probably I'm not making much sense.

Thanks for helping, it got me to take another look at the problem and find a solution :-)
I'll start working on the pr soon (the branch is updated and should be functional if anybody wants to try using it now: https://github.com/dariof4/nixpkgs/tree/nyxt-3).

@aadcg
Copy link

aadcg commented May 25, 2023

@dariof4 the merit is all yours! 🥳

The Nyxt team sincerely appreciates your work :)

@aadcg
Copy link

aadcg commented May 29, 2023

Nyxt has released version 3.1.0. See https://github.com/atlas-engineer/nyxt/releases.

It seems that @dariof4 has noticed the release. Once again, thank you!

@dariof4 dariof4 mentioned this issue May 31, 2023
12 tasks
dariof4 added a commit to dariof4/nixpkgs that referenced this issue Jun 10, 2023
Package :nyxt/gi-gtk-application instead of :nyxt/gtk-application.
ref: NixOS#217888 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9.needs: package (update) This needs a package to be updated
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants