artanis
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can /tmp/cache/route.cache and other tmp dirs be moved outside proje


From: Mortimer Cladwell
Subject: Re: Can /tmp/cache/route.cache and other tmp dirs be moved outside project directory?
Date: Tue, 30 Nov 2021 16:26:00 -0500

Hi Nala,

Concerning Artanis writing/deleting in the app directory (not allowed in the store with Guix) I decided to try and modify current-toplevel to "/tmp/myapp" for instances where I suspect writing/deleting is occurring.  Where I suspect no deleting/writing is occurring, I introduce a new method "(original-current-toplevel)". In the code below, the number at the left margin is the line number in the artanis file.

First modify env.scm:

----env.scm----------------------------------------------------
42             %current-toplevel
43            current-toplevel
44            %original-current-toplevel
45            original-current-toplevel        

136 (define %original-current-toplevel (make-parameter #f))
137 (define (original-current-toplevel)
138  (or (%original-current-toplevel)
139      (find-ENTRY-path identity #t)))
140
141(define (current-toplevel) "/tmp/myapp")
--------------------------------------------------------------------

Then modify the files below changing "(current-toplevel)" to "(original-current-toplevel)"
These are statements that I want to work with the app directory, as normal i.e. locations where I suspect the app directory will not be modified.


----utils.scm-----------------------------------------

833  (let* ((toplevel (original-current-toplevel))
1309 (original-current-toplevel) file)))

----tpl/parser.scm-----------------------------------------

40 (format #f "~a/~a/~a" (original-current-toplevel) pub args))))
52 (mfile (format #f "~a/~a/manifest.json" (original-current-toplevel) path))

----commands/work.scm-----------------------------------------

77  (let ((entry (string-append (original-current-toplevel) "/" *artanis-entry*)))
126 (add-to-load-path (original-current-toplevel))

----mvc/controller.scm-----------------------------------------

45 (original-current-toplevel) 'name method)))
62 (define toplevel (original-current-toplevel))

----webapi/restful.scm-----------------------------------------

58 (load (format #f "~a/app/api/~a.scm" (original-current-toplevel) s)))


I have not tested this thoroughly, but all pages that were tested loaded as expected. These pages involved form entry, database query and loading, on-the-fly graphing. Note that this is working WITHOUT guix i.e. a GNU make install on Debian. I now need to guix package and test.

Any insights on why this might fail (in Guix) and potential problems with this approach?
Can you provide the minimal list of what needs to go into /tmp/myapp i.e. where in the code might modifications to the app directory be attempted?
Do you have plans in the future to make Artanis "guix compatible"?
Thanks
Mortimer

reply via email to

[Prev in Thread] Current Thread [Next in Thread]