Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#10 defsystem: filetypes wrong for non-lisp components

closed
defsystem (13)
5
2004-02-01
2000-06-27
Anonymous
No

When operating on components defined with :language :c,
defsystem still assumes they have file extension ".lisp".
This causes them not to be found.

* (trace mk::COMPONENT-FULL-PATHNAME-I)
* (defsystem foo :components ((:file "foo.c" :language :c)))
#<DEFSYSTEM: foo>
* (compile-system 'foo)
0: (COMPONENT-FULL-PATHNAME-I #<FILE: foo.c> :SOURCE NIL)
0: COMPONENT-FULL-PATHNAME-I returned "foo.lisp"
0: (COMPONENT-FULL-PATHNAME-I #<FILE: foo.c> :BINARY NIL)
0: COMPONENT-FULL-PATHNAME-I returned "foo.x86f"

; - Source file foo.lisp not found, not loading.

Error in function LOAD-FILE-OPERATION:
Source file "foo.lisp" do not exist.

Restarts:
0: [CONTINUE] Continue, ignoring missing files.
1: [ABORT ] Return to Top-Level.

Debug (type H for help)

(LOAD-FILE-OPERATION #<FILE: foo.c> :NEW-SOURCE-AND-DEPENDENTS)
Source: (CERROR "Continue, ignoring missing files."
"~&Source file ~S ~:[and binary file ~S ~;~]do not exist."
SOURCE-PNAME
(OR *LOAD-SOURCE-IF-NO-BINARY* *LOAD-SOURCE-INSTEAD-OF-BINARY*)
...)
0] bac
0: (LOAD-FILE-OPERATION #<FILE: foo.c> :NEW-SOURCE-AND-DEPENDENTS)
1: (COMPILE-AND-LOAD-OPERATION #<FILE: foo.c> :NEW-SOURCE-AND-DEPENDENTS)
2: (OPERATE-ON-COMPONENT #<FILE: foo.c> :COMPILE :NEW-SOURCE-AND-DEPENDENTS)
3: (OPERATE-ON-COMPONENT #<FILE: foo.c> :COMPILE :NEW-SOURCE-AND-DEPENDENTS)
4: (OPERATE-ON-COMPONENTS #<DEFSYSTEM: foo>
:COMPILE
:NEW-SOURCE-AND-DEPENDENTS
NIL)

Workaround: define the :source-extension and :binary-extension as well as the language explicitly

Sourceforge can't remember my password. Nor can I. I'm dan@telent.net

Discussion

  • Sam Steingold
    Sam Steingold
    2000-06-30

    • assigned_to: nobody --> marcoxa
    • labels: 100100 --> defsystem
     
  • The problem is caused by the propagation of :*-extension
    from the parent component in function 'create-component-pathnames'.

    Obviously, it can be fixed in several different ways... but I'm suggesting to change the lines

    (component-extension parent :source))))

    into

    (component-extension parent :source :local t))))

    this will prevent the inheritance unless the extension was explicitely asserted for the parent component. During the operations the 'component-extension' function is taking care of getting the proper extension using the component-language information.

    In diff words the changes are:

    --- /home/tessaris/packages/clocc/src/defsystem-3.x/defsystem.lisp Thu Feb 22 13:32:05 2001
    +++ /home/tessaris/lib/lisp/defsystem.lisp Fri Feb 23 11:44:42 2001
    @@ -2617,11 +2617,11 @@
    (setf (component-extension component :source)
    (or (component-extension component :source :local t) ; local default
    (when parent ; parent's default
    - (component-extension parent :source))))
    + (component-extension parent :source :local t))))
    (setf (component-extension component :binary)
    (or (component-extension component :binary :local t) ; local default
    (when parent ; parent's default
    - (component-extension parent :binary))))
    + (component-extension parent :binary :local t))))

    ;; Set up pathname defaults -- expand with parent
    ;; We must set up the source pathname before the binary pathname

     
    • status: open --> closed