Is there any way to have ASDF compile several files with with-compilation-unit wrapped around the compilation?
On 12/13/11 Dec 13 -9:28 AM, Mark H. David wrote:
Is there any way to have ASDF compile several files with with-compilation-unit wrapped around the compilation?
asdf-devel mailing list asdf-devel@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
That's the default mode of operation:
(defmethod perform-plan ((steps list) &key) (let ((*package* *package*) (*readtable* *readtable*)) (with-compilation-unit () (loop :for (op . component) :in steps :do (perform-with-restarts op component)))))
Cheers, r
Thanks, would like to do this with an easy serial defsystem. Can I get the files on the same line to be a compilation unit in this example?
(asdf:defsystem :example :version "0.0.1" :serial t :components ((:file "packages") (:file "a") (:file "b") (:file "c") ; <- as compilation unit? (:file "d")))
On 12/13/2011 11:04 AM, Robert Goldman wrote:
On 12/13/11 Dec 13 -9:28 AM, Mark H. David wrote:
Is there any way to have ASDF compile several files with with-compilation-unit wrapped around the compilation?
asdf-devel mailing list asdf-devel@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
That's the default mode of operation:
(defmethod perform-plan ((steps list)&key) (let ((*package* *package*) (*readtable* *readtable*)) (with-compilation-unit () (loop :for (op . component) :in steps :do (perform-with-restarts op component)))))
Cheers, r
asdf-devel mailing list asdf-devel@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
On 12/13/11 Dec 13 -10:23 AM, Mark H. David wrote:
Thanks, would like to do this with an easy serial defsystem. Can I get the files on the same line to be a compilation unit in this example?
(asdf:defsystem :example :version "0.0.1" :serial t :components ((:file "packages") (:file "a") (:file "b") (:file "c") ; <- as compilation unit? (:file "d")))
On 12/13/2011 11:04 AM, Robert Goldman wrote:
On 12/13/11 Dec 13 -9:28 AM, Mark H. David wrote:
Is there any way to have ASDF compile several files with with-compilation-unit wrapped around the compilation?
I guess my response wasn't clear enough. The /entire/ system compilation will be in the scope of WITH-COMPILATION-UNIT. If that isn't happening as you expect, please explain what is going wrong.
Cheers, r
Well, I basically want the serial thing, but occasionally I want a group of things compiled using with-compilation-unit wrapped around them.
In the example, I'd want the basic build to go something like
(load (compile-file "packages.lisp")) ; assume compile-file returns the fasl's pathname (load (compile-file "a.lisp") (with-compilation-unit () (load (compile-file "b.lisp")) (load (compile-file "c.lisp"))) (load (compile-file "d.lisp"))
Thanks.
On 12/13/2011 11:28 AM, Robert Goldman wrote:
On 12/13/11 Dec 13 -10:23 AM, Mark H. David wrote:
Thanks, would like to do this with an easy serial defsystem. Can I get the files on the same line to be a compilation unit in this example?
(asdf:defsystem :example :version "0.0.1" :serial t :components ((:file "packages") (:file "a") (:file "b") (:file "c") ;<- as compilation unit? (:file "d")))
On 12/13/2011 11:04 AM, Robert Goldman wrote:
On 12/13/11 Dec 13 -9:28 AM, Mark H. David wrote:
Is there any way to have ASDF compile several files with with-compilation-unit wrapped around the compilation?
I guess my response wasn't clear enough. The /entire/ system compilation will be in the scope of WITH-COMPILATION-UNIT. If that isn't happening as you expect, please explain what is going wrong.
Cheers, r
asdf-devel mailing list asdf-devel@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/asdf-devel
On 12/13/11 Dec 13 -10:36 AM, Mark H. David wrote:
Well, I basically want the serial thing, but occasionally I want a group of things compiled using with-compilation-unit wrapped around them.
In the example, I'd want the basic build to go something like
(load (compile-file "packages.lisp")) ; assume compile-file returns the fasl's pathname (load (compile-file "a.lisp") (with-compilation-unit () (load (compile-file "b.lisp")) (load (compile-file "c.lisp"))) (load (compile-file "d.lisp"))
That is not the plan that ASDF is going to perform.
Suggestion: if you want to know exactly what ASDF is going to do, try
(ASDF:OOS 'ASDF:LOAD-OP "my-system-name" :force t)
This will return the plan as its second return value, so you can see the plan.
ALL OF THE ACTIONS IN THE PLAN WILL BE DONE IN THE SCOPE OF A *SINGLE* WITH-COMPILATION-UNIT.
Cheers
Dear Mark,
On Tue, Dec 13, 2011 at 11:36, Mark H. David mhd@expressivedatabase.com wrote:
Well, I basically want the serial thing, but occasionally I want a group of things compiled using with-compilation-unit wrapped around them.
In the example, I'd want the basic build to go something like
(load (compile-file "packages.lisp")) ; assume compile-file returns the fasl's pathname (load (compile-file "a.lisp") (with-compilation-unit () (load (compile-file "b.lisp")) (load (compile-file "c.lisp"))) (load (compile-file "d.lisp"))
Unhappily, ASDF won't do that for you. What it WILL only do:
(with-compilation-unit () (load (compile-file "packages.lisp")) (load (compile-file "a.lisp") (load (compile-file "b.lisp")) (load (compile-file "c.lisp"))) (load (compile-file "d.lisp"))
I don't know what effect you expect from your compilation unit, but if you require things to actually be compiled, they might not even be: ASDF will gladly skip compilations that have already happened.
If for some reason I don't understand, you really want to do it your way, ASDF will let you redefine do-traverse and perform, or you can have a single file doing its own (eval-when (compile load execute) ...) and use yourself the building blocks provided by asdf: safe-file-write-date *compile-op-compile-file-function* compile-file* compile-file-pathname* you may even call asdf:operation-done-p and asdf:perform with made-up operation and component objects. Or if you don't need output-file redirection, you can avoid using ASDF altogether.
Still I'm curious why you want a with-compilation-unit for...
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org The most preposterous notion that H. sapiens has ever dreamed up is that the Lord God of Creation, Shaper and Ruler of all the Universes, wants the saccharine adoration of His creatures, can be swayed by their prayers, and becomes petulant if He does not receive this flattery. Yet this absurd fantasy, without a shred of evidence to bolster it, pays all the expenses of the oldest, largest, and least productive industry in all history. — Robert Heinlein, "Time Enough For Love"
Hi.
I'd like the compilation of all the files in the unit to happen when any of the files in the unit need compilation.
Then, when they're all compiled, I'd like with-compilation-unit wrapped around their compilation.
I guess I want the option to do ':override true', or have that be the default, around this compilation unit, since it's apparently in a compilation around the entire system.
(Well, I didn't know until now that the whole set of files in a serial build are in one compilation unit. So you get no warnings for any forward references between files?)
The effect would be that warnings for things like variable or functions not defined would be deferred until the end of compiling the unit.
Example:
I'd like the following individual compilation units:
package.lisp, a.lisp, b.lisp and c.lisp, d.lisp
Then, assume
a.lisp defines f1, which calls f2. b.lisp defines f2, which calls f3. c.lisp defines f3.
So, in this case, I'd expect a warning when a.lisp is compiled that f1 calls undefined function f2. But when b.lisp is compiled, I'd expect no warning for f2 calling f3, since it's defined in the same compilation unit (in c.lisp).
(Well, I didn't know until now that the whole set of files in a serial build are in one compilation unit. So you get no warnings for any forward references between any files? I guess I'd like a way to defeat that, too.)
On 12/13/2011 11:54 AM, Faré wrote:
Dear Mark,
On Tue, Dec 13, 2011 at 11:36, Mark H. Davidmhd@expressivedatabase.com wrote:
Well, I basically want the serial thing, but occasionally I want a group of things compiled using with-compilation-unit wrapped around them.
In the example, I'd want the basic build to go something like
(load (compile-file "packages.lisp")) ; assume compile-file returns the fasl's pathname (load (compile-file "a.lisp") (with-compilation-unit () (load (compile-file "b.lisp")) (load (compile-file "c.lisp"))) (load (compile-file "d.lisp"))
Unhappily, ASDF won't do that for you. What it WILL only do:
(with-compilation-unit () (load (compile-file "packages.lisp")) (load (compile-file "a.lisp") (load (compile-file "b.lisp")) (load (compile-file "c.lisp"))) (load (compile-file "d.lisp"))
I don't know what effect you expect from your compilation unit, but if you require things to actually be compiled, they might not even be: ASDF will gladly skip compilations that have already happened.
If for some reason I don't understand, you really want to do it your way, ASDF will let you redefine do-traverse and perform, or you can have a single file doing its own (eval-when (compile load execute) ...) and use yourself the building blocks provided by asdf: safe-file-write-date *compile-op-compile-file-function* compile-file* compile-file-pathname* you may even call asdf:operation-done-p and asdf:perform with made-up operation and component objects. Or if you don't need output-file redirection, you can avoid using ASDF altogether.
Still I'm curious why you want a with-compilation-unit for...
—♯ƒ • François-René ÐVB Rideau •Reflection&Cybernethics• http://fare.tunes.org The most preposterous notion that H. sapiens has ever dreamed up is that the Lord God of Creation, Shaper and Ruler of all the Universes, wants the saccharine adoration of His creatures, can be swayed by their prayers, and becomes petulant if He does not receive this flattery. Yet this absurd fantasy, without a shred of evidence to bolster it, pays all the expenses of the oldest, largest, and least productive industry in all history. — Robert Heinlein, "Time Enough For Love"