Opened 13 years ago

Closed 13 years ago

#512 closed defect (fixed)

static-modules exports procedure-internal definitions

Reported by: sjamaan Owned by: Ivan Raikov
Priority: major Milestone:
Component: extensions Version: 4.6.x
Keywords: static-modules Cc:
Estimated difficulty:

Description (last modified by sjamaan)

When compiling static-modules, we get messages like this:

Warning: exported identifier of module `static-modules' has not been defined: Signature

It's probably caused by a problem with the expansion of {{define-datatype}}

Change History (11)

comment:1 Changed 13 years ago by sjamaan

Description: modified (diff)

comment:2 Changed 13 years ago by sjamaan

Component: expanderextensions
Keywords: static-modules added; expander removed
Milestone: 4.7.0
Owner: changed from sjamaan to Ivan Raikov
Status: newassigned
Summary: Definitions generated by "datatype" egg are invisible to exportstatic-modules exports procedure-internal definitions

Hm, come to think of it, it's probably a bug in static-modules. It does something similar to:

(module foo
  (my-datatype? Sym Sym+Str)

  (import chicken scheme)
  (use datatype)

  (define (some-procedure)
    (define-datatype my-datatype my-datatype?
      (Sym (id symbol?))
      (Sym+Str (id symbol?) (s string?)))))

I don't think this should work (defining stuff inside a procedure and then exporting it like it was defined in the module's toplevel, ie outside that procedure).

My hunch is that this worked before because of the bug that got fixed in #445.

I'm assigning this to Ivan and changing the ticket title to reflect that it's actually most likely a bug in static-modules and not in datatype or Chicken core.

comment:3 Changed 13 years ago by sjamaan

Ivan, please verify it's a bug in static-modules.
It can be reproduced by installing static-modules with experimental Chicken (I tested with 4.6.6)

I'm not 100% sure it's actually caused by the bugfix in #445, because I *think* that fix is supposed to be included with 4.6.5. I can't find it in the changelog at http://lists.nongnu.org/archive/html/chicken-users/2011-02/msg00033.html though... Felix?

comment:4 Changed 13 years ago by sjamaan

I just checked (I'm lazy and stupid; should've done that *before* posting the previous message) and Chicken 4.6.5 *does* include the patch for #445 (at least, it fails on the snippet in the ticket's description, whereas 4.6.5 just returns a "foo" record object)

static-modules fails when I try to install it, too! However, the latest Salmonella run didn't report failure. Now I'm totally confused. I'll ping Mario about this.

tl;dr: Ivan, you can just use the latest dev snapshot, you don't have to install "experimental" from git. Salmonella appears to be broken.

comment:5 Changed 13 years ago by Ivan Raikov

I am able to install static-modules and miniML using Chicken 4.6.5. However, as you have guessed static-modules has no business exporting the datatype constructors. I will remove the unnecessary exports,
but we should probably look into whether bug #465 is related to this before closing this one.

comment:6 Changed 13 years ago by sjamaan

Thank you for fixing this so quickly, Ivan.

You mention #465 but that is about Spiffy and OpenSSL. I assume you mean #445 (the one about internal declarations)?

comment:7 Changed 13 years ago by sjamaan

I just tested but there's one such bug left:

Warning: reference to possibly unbound identifier `modterm?' in:
Warning:    Mclosure_v

Error: module unresolved: static-modules

comment:8 in reply to:  4 Changed 13 years ago by Mario Domenech Goulart

Replying to sjamaan:

tl;dr: Ivan, you can just use the latest dev snapshot, you don't have to install "experimental" from git. Salmonella appears to be broken.

I've just applied some fixes to the salmonella chroot, as suggested by Peter (removed chicken from PATH and put the chicken used by salmonella as the first path in the PATH used by run-salmonella.scm.)

comment:9 in reply to:  7 ; Changed 13 years ago by Ivan Raikov

Ok, I have fixed that now. Of course I meant #445. I would like to install the latest development snapshot, but only up to 4.6.5 appear on the page, and I already have that installed.

Replying to sjamaan:

I just tested but there's one such bug left:

Warning: reference to possibly unbound identifier `modterm?' in:
Warning:    Mclosure_v

Error: module unresolved: static-modules

comment:10 in reply to:  9 Changed 13 years ago by sjamaan

Replying to iraikov:

Ok, I have fixed that now. Of course I meant #445. I would like to install the latest development snapshot, but only up to 4.6.5 appear on the page, and I already have that installed.

4.6.5 is the latest snapshot. To get anything newer you'd have to install straight from the git "experimental" branch.

comment:11 Changed 13 years ago by Ivan Raikov

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.