Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asdf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Hugo Ishimaru
asdf
Commits
3d0d07c3
Commit
3d0d07c3
authored
Oct 27, 2016
by
Francois-Rene Rideau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly treat DEFINE-OP dependencies
parent
a3b85c8b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
13 deletions
+23
-13
action.lisp
action.lisp
+6
-1
find-system.lisp
find-system.lisp
+11
-9
system.lisp
system.lisp
+6
-3
No files found.
action.lisp
View file @
3d0d07c3
...
...
@@ -17,7 +17,7 @@
#:action-status
#:action-stamp
#:action-done-p
#:action-operation
#:action-component
#:make-action
#:component-operation-time
#:mark-operation-done
#:compute-action-stamp
#:perform
#:perform-with-restarts
#:retry
#:accept
#:perform
#:perform-with-restarts
#:retry
#:accept
#:*action*
#:action-path
#:find-action
#:stamp
#:done-p
#:operation-definition-warning
#:operation-definition-error
;; condition
#:action-valid-p
...
...
@@ -426,6 +426,11 @@ in some previous image, or T if it needs to be done.")
(
:documentation
"PERFORM an action, consuming its input-files and building its output-files"
))
(
define-convenience-action-methods
perform
(
operation
component
))
(
defvar
*action*
nil
"Action being performed"
)
(
defmethod
perform
:around
((
o
operation
)
(
c
component
))
(
let
((
*action*
(
cons
o
c
)))
(
call-next-method
)))
(
defmethod
perform
:before
((
o
operation
)
(
c
component
))
(
ensure-all-directories-exist
(
output-files
o
c
)))
(
defmethod
perform
:after
((
o
operation
)
(
c
component
))
...
...
find-system.lisp
View file @
3d0d07c3
...
...
@@ -51,24 +51,26 @@
(
and
(
typep
operation
'load-op
)
(
typep
component
'system
)
(
equal
"asdf"
(
coerce-name
component
))))
(
let*
((
action
(
first
(
visiting-action-list
*asdf-session*
)))
(
parent-operation
(
car
action
))
(
parent-component
(
cdr
action
)))
(
when
(
and
parent-operation
parent-component
)
(
when
*action*
(
let
((
parent-operation
(
car
*action*
))
(
parent-component
(
cdr
*action*
)))
(
unless
(
and
(
typep
parent-operation
'define-op
)
(
typep
parent-component
'system
))
(
error
"Invalid recursive use of (OPERATE ~S ~S) while visiting ~S ~
- please use proper dependencies instead."
operation
component
action
))
(
push
action
(
definition-dependencies
parent-component
))))))
operation
component
*action*
))
(
let
((
action
(
cons
operation
component
)))
(
unless
(
gethash
action
(
definition-dependency-set
parent-component
))
(
push
(
cons
operation
component
)
(
definition-dependency-list
parent-component
))
(
setf
(
gethash
action
(
definition-dependency-set
parent-component
))
t
)))))))
(
defmethod
component-depends-on
((
o
define-op
)
(
s
system
))
`
(
;;NB: 1- ,@(system-defsystem-depends-on s)) ; Should be already included in the below.
;; 2- We don't call-next-method to avoid other methods
,@
(
loop*
:for
(
o
.
c
)
:in
(
definition-dependenc
ies
s
)
:collect
(
list
o
c
))))
,@
(
loop*
:for
(
o
.
c
)
:in
(
definition-dependenc
y-list
s
)
:collect
(
list
o
c
))))
(
defmethod
component-depends-on
((
o
operation
)
(
s
system
))
`
(
,@
(
when
(
and
(
not
(
typep
o
'define-op
))
(
or
(
system-source-file
s
)
(
definition-dependenc
ies
s
)))
(
or
(
system-source-file
s
)
(
definition-dependenc
y-list
s
)))
`
((
define-op
,
(
primary-system-name
s
))))
,@
(
call-next-method
)))
...
...
@@ -104,7 +106,7 @@
:name
(
coerce-name
s
)
:pathname
pathname
:condition
condition
))))
(
asdf-message
(
compatfmt
"~&~@<; ~@;Loading system definition~@[ for ~A~] from ~A~@:>~%"
)
(
coerce-name
s
)
pathname
)
;; dependencies will depend on what's loaded via definition-dependenc
ies
;; dependencies will depend on what's loaded via definition-dependenc
y-list
(
unset-asdf-cache-entry
`
(
component-depends-on
,
o
,
s
))
(
load*
pathname
:external-format
(
encoding-external-format
(
detect-encoding
pathname
))))))
...
...
system.lisp
View file @
3d0d07c3
...
...
@@ -9,7 +9,7 @@
#:system-source-file
#:system-source-directory
#:system-relative-pathname
#:system-description
#:system-long-description
#:system-author
#:system-maintainer
#:system-licence
#:system-license
#:definition-dependenc
ies
#:system-defsystem-depends-on
#:definition-dependenc
y-list
#:definition-dependency-set
#:system-defsystem-depends-on
#:system-depends-on
#:system-weakly-depends-on
#:component-build-pathname
#:build-pathname
#:component-entry-point
#:entry-point
...
...
@@ -89,8 +89,11 @@ a SYSTEM is redefined and its class is modified."))
;; This slot contains the *declared* defsystem-depends-on dependencies
(
defsystem-depends-on
:reader
system-defsystem-depends-on
:initarg
:defsystem-depends-on
:initform
nil
)
;; This slot contains the *inferred* dependencies of define-op
(
definition-dependencies
:initform
nil
:accessor
definition-dependencies
)
;; These slots contains the *inferred* dependencies of define-op, as list and as set
(
definition-dependency-list
:initform
nil
:accessor
definition-dependency-list
)
(
definition-dependency-set
:initform
(
list-to-hash-set
nil
)
:accessor
definition-dependency-set
)
;; these two are specially set in parse-component-form, so have no :INITARGs.
(
depends-on
:reader
system-depends-on
:initform
nil
)
(
weakly-depends-on
:reader
system-weakly-depends-on
:initform
nil
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment