Git Product home page Git Product logo

Comments (14)

jmercouris avatar jmercouris commented on September 26, 2024 2

I'm sorry, not yet, I've been working on application all day today.

from nyxt.

dariof4 avatar dariof4 commented on September 26, 2024 2

I just noticed this issue, and with a bit of debugging I found the culprit:
https://github.com/atlas-engineer/nyxt/blob/93316dead52172483ba688a48de046f25d25ce83/source/configuration.lisp#L146C38-L146C38
(:tree ,(files:expand *source-directory*)) ; Probably useless since systems are immutable.

This line appends *source-directory* to nyxt-source-registry, nyxt-source-registry is then added to asdf:*default-source-registries* which is used to initialize the source-registries.
Because the nix sets the asdf registry to a temporary directory to build Nyxt (as a way to circumvent the fact that if one uses asdf:operate with the same operation as build-operation. in Nyxt's case program-op, asdf ignores output translations, thus putting the compiled file in the nix store), *source-directory* becomes #P"" and asdf:initialize-source-registry fails with an error about #P"" not being an absolute pathname, removing *source-directory* from nyxt-source-registry fixes the issue.

This can be fixed by removing the line that adds *source-directory* to nyxt-source-registry, although I'm not sure if anything else breaks with *source-directory* being #P"".
For NixOS I think this could also be fixed by not setting asdf to a temporary directory, by patching nyxt to remove :build-operation program-op from nyxt/gi-gtk-application and then building it with asdf:operate :program-op.

What @hgluka is experiencing might stem from the same cause, the way Nyxt is being built setting *source-directory* to #P"", this could be tested by checking what's the value of *source-directory* and by trying if removing the offending line fixes the issue.

I'll have a fix for this PR'd to nixpkgs soon, although since it seems like it also affects flatpack, it might need a more general fix? Since I'm not experienced with flatpack/how the flatpack is built, I'm not sure if it's possible to get it to set *source-directory* to something else that doesn't break asdf:initialize-source-registries.

from nyxt.

Ambrevar avatar Ambrevar commented on September 26, 2024 2

I've fixed nyxt-source-registry on empty pathnames: 61407d1.

@dariof4 Guix builds in a temp dir, but does not suffer from this issue. I presume that Nix is missing the .asd or some other source files in the build, because Nyxt tries really hard to find the source. See

(defmethod files:resolve ((profile nyxt-profile) (directory nyxt-source-directory))
  "Try hard to find Nyxt source on disk.
Return #p\"\" if not found."
  (let ((asd-path (ignore-errors (asdf:system-source-directory :nyxt))))
    (if (uiop:directory-exists-p asd-path)
        asd-path
        (or
         ;; XDG / FHS:
         (find-if (lambda (d)
                    (uiop:file-exists-p (uiop:merge-pathnames* "nyxt.asd" d)))
                  (uiop:xdg-data-dirs "nyxt"))
         ;; Location relative to the binary:
         (let ((relative-dir (uiop:merge-pathnames*
                              "share/nyxt/"
                              (files:parent
                               (files:parent
                                (uiop:ensure-pathname
                                 (first (uiop:raw-command-line-arguments)) :truenamize t))))))
           (when (uiop:file-exists-p (uiop:merge-pathnames* "nyxt.asd" relative-dir))
             relative-dir))
         ;; Not found:
         #p""))))

So it looks up the source starting from the dir of the nyxt executable.

from nyxt.

aadcg avatar aadcg commented on September 26, 2024 1

@dariof4 thanks for the thoroughly investigation!

I think @Ambrevar is in a better position to advice which possible changes are required on Nyxt's side. Thanks.

from nyxt.

aadcg avatar aadcg commented on September 26, 2024 1

@dariof4 I think that that, as far as Nyxt is concerned, we're done here. Feel free to open an issue if you find issues updating the Nyxt package definition for Nix. Thanks!

from nyxt.

aadcg avatar aadcg commented on September 26, 2024

@Anomalocaridid I can't reproduce it. My intuition tells me that there's an error in your config file and you're assuming it's coming from the extension. Try to comment all logic except that related to the extension and it should work.

from nyxt.

Anomalocaridid avatar Anomalocaridid commented on September 26, 2024

@aadcg I have already commented out everything but the snippet I included in the issue. After seeing your response, I even deleted the comments just to make sure. I also manually cloned the extension and put a copy of the config.lisp with only the relevant snippet in the Nyxt config directory just to make sure it wasn't caused by using nix to manage everything. I also deleted everything in .local/share/nyxt (except for the extensions folder, which only had nx-fruit) for good measure.

Could I be missing some sort of dependency or setting that Nyxt takes for granted? Here are my dotfiles for NixOS: https://github.com/Anomalocaridid/dotfiles. Note that I am still working on fixing my Nyxt config to account for breaking changes introduced in the 3 series and I am aware that the Nyxt config in my dotfiles repo is currently broken.

from nyxt.

aadcg avatar aadcg commented on September 26, 2024

@Anomalocaridid I followed these steps:

  1. Delete ~/.cache/nyxt/, ~/.config/nyxt/, ~/.local/share/nyxt/.
  2. Ensure that nix is up-to-date by running nix-channel --update.
  3. Write file ~/.config/nyxt/config.lisp with the content below:
(define-nyxt-user-system-and-load nyxt-user/nx-fruit-proxy
  :description "This proxy system saves us if nx-fruit fails to load. Otherwise
  it will break all the config loading."
  :depends-on ("nx-fruit"))
  1. Create directory ~/.local/share/nyxt/extensions/.
  2. Clone nx-fruit at the directory mentioned in the previous step.
  3. Start nyxt.
  4. Issue command fruit-of-the-day => Have a wonderful Melon Wednesday!

What happens when you follow these steps?

from nyxt.

jmercouris avatar jmercouris commented on September 26, 2024

Have a wonderful Melon Wednesday too!

from nyxt.

Anomalocaridid avatar Anomalocaridid commented on September 26, 2024

@aadcg I get the same error that I did before and fruit-of-the-day is not available as a command.

2. Ensure that nix is up-to-date by running nix-channel --update.

Also, regarding this step, since I use a flake-based setup, I had to use nix flake update instead. Could that somehow be related to why I experience this issue but you do not?

from nyxt.

aadcg avatar aadcg commented on September 26, 2024

Could that somehow be related to why I experience this issue but you do not?

It's hard to say, as you can imagine. I'm not on NixOS, and I can only help you with regards to Nyxt.

@jmercouris what happens when you follow the steps in #3075 (comment)? If it works for him (he's on NixOS), I'll close this issue.

from nyxt.

aadcg avatar aadcg commented on September 26, 2024

@Anomalocaridid any new piece of information?

@jmercouris did you try it out?

Thanks.

from nyxt.

Anomalocaridid avatar Anomalocaridid commented on September 26, 2024

@aadcg Nyxt was recently updated to 3.4.0 in nixpkgs, so I updated again today and tried your steps again, but it looks like there's no change. I still get the same error, with the fruit-of-the-day command being unavailable. Unfortunately, that is all the new info I have. I currently have no clue what else to try.

from nyxt.

hgluka avatar hgluka commented on September 26, 2024

Interestingly enough, I managed to reproduce this issue with Flatpak on PopOS. I also have Nyxt installed with the Guix package manager and I can't reproduce the issue there.

The steps to reproduce are similar to @aadcg's:

  1. Delete ~/.cache/nyxt/, ~/.config/nyxt/, ~/.local/share/nyxt/.
  2. Install Nyxt version 3.5.0 with Flatpak.
  3. Write file ~/.config/nyxt/config.lisp with the content below:
(define-nyxt-user-system-and-load nyxt-user/nx-fruit-proxy
  :description "This proxy system saves us if nx-fruit fails to load. Otherwise
  it will break all the config loading."
  :depends-on ("nx-fruit"))
  1. Create directory ~/.local/share/nyxt/extensions/.
  2. Clone nx-fruit at the directory mentioned in the previous step.
  3. Start Nyxt with flatpak run engineer.atlas.Nyxt.

These are the warnings I get:

<WARN> [09:12:31] Warning: Invalid pathname #P"": Expected an absolute pathname
<WARN> [09:12:31] Warning: Error on separate thread: The value
  #P&quot;&quot;
is not of type
  SYMBOL

And fruit-of-the-day is not available as a command.

When I try to show-system-information, I get this warning and it fails:

WARN - Warning: Error while processing the "nyxt:" URL: Subprocess #&lt;UIOP/LAUNCH-PROGRAM::PROCESS-INFO {100EC3DAC3}&gt;
 with command (&quot;wl-copy&quot;)
 exited with error code 1

This also doesn't happen when running the non-Flatpak version of Nyxt.

Here is the output of flatpak engineer.atlas.Nyxt --system-information:

Nyxt version: 3.5.0
Renderer: GI-GTK
Operating system kernel: Linux 6.2.6-76060206-generic
Lisp implementation: SBCL 2.3.2 (Dynamic space size: 4294967296)
Features: (:NYXT-GI-GTK :NYXT-GTK :NYXT-GI-GTK :NYXT-GTK :NYXT-3.5 :NYXT-3 :NYXT-3.5.0
 :SLYNK :PLUMP-UTF-32 :PARENSCRIPT :NSYMBOLS :FSET-EXT-STRINGS :FLATPAK
 :GLOBAL-VARS :DECLARE-TYPES :SBCL+SAFE-STANDARD-READTABLE :NAMED-READTABLES
 :SWANK :CL-FAD :LPARALLEL :21BIT-CHARS :CUSTOM-HASH-TABLE-NATIVE
 :CL-PPCRE-UNICODE :CL-UNICODE :CL-JSON-DOUBLE-FLOAT-IS-SUBSUMED
 :CL-JSON-SINGLE-FLOAT-IS-SUBSUMED :CHUNGA :FLEXI-STREAMS :CL-PPCRE :WEBKIT2
 :WEBKIT-2.40.4 :WEBKIT-2.40 :WEBKIT-2 :WEBKIT2-CORS-ALLOWLIST
 :WEBKIT2-PASTE-PLAINTEXT :WEBKIT2-TRACKING :WEBKIT2-MUTE :WEBKIT2-EMOJI
 :WEBKIT2-MEDIA :WEBKIT2-SANDBOXING :GTK-3-22 :GTK-3-20 :GTK-3-18 :GTK-3-16
 :GTK-3-14 :GTK-3-12 :GTK-3-10 :GTK-3-8 :GTK-3-6 :GTK-3-4 :GTK :GDK-3-22
 :GDK-3-20 :GDK-3-18 :GDK-3-16 :GDK-3-14 :GDK-3-12 :GDK-3-10 :GDK-3-8 :GDK-3-6
 :GDK-3-4 :CAIRO-1-10 :CAIRO-1-12 :GDK-PIXBUF :CLOSER-MOP :GLIB-2-30 :GLIB-2-32
 :GLIB-2-34 :GLIB-2-36 :GLIB-2-38 :GLIB-2-40 :GLIB-2-42 :GLIB-2-44 :GLIB-2-46
 :GLIB-2-48 :GLIB-2-50 :GLIB-2-52 :GLIB-2-54 :GLIB-2-56 :GLIB-2-58 :GLIB
 :BORDEAUX-THREADS :LPARALLEL.WITH-CLTL2 :LPARALLEL.WITH-CAS
 :LPARALLEL.WITH-STEALING-SCHEDULER :SPLIT-SEQUENCE
 CFFI-FEATURES:FLAT-NAMESPACE CFFI-FEATURES:X86-64 CFFI-FEATURES:UNIX :CFFI
 CFFI-SYS::FLAT-NAMESPACE ALEXANDRIA::SEQUENCE-EMPTYP :FAST-IO-SV :FAST-IO
 :CL-JSON-CLOS :CL-JSON :SBCL-USES-SB-ROTATE-BYTE CHIPZ-SYSTEM:GRAY-STREAMS
 :THREAD-SUPPORT :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-UNIX
 :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :ARENA-ALLOCATOR :X86-64 :GENCGC :64-BIT
 :ANSI-CL :COMMON-LISP :ELF :IEEE-FLOATING-POINT :LINUX :LITTLE-ENDIAN
 :PACKAGE-LOCAL-NICKNAMES :SB-LDB :SB-PACKAGE-LOCKS :SB-THREAD :SB-UNICODE
 :SBCL :UNIX)

ASDF version: 3.3.1
ASDF registries: (NYXT-SOURCE-REGISTRY ENVIRONMENT-SOURCE-REGISTRY)
Critical dependencies: (/run/build/nyxt/_build/cl-cffi-gtk/gtk/cl-cffi-gtk.asd
 /run/build/nyxt/_build/cl-gobject-introspection/cl-gobject-introspection.asd
 /run/build/nyxt/_build/cl-webkit/webkit2/cl-webkit2.asd)

from nyxt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.