www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10386] New: Package import feature breaks with static libraries

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10386

           Summary: Package import feature breaks with static libraries
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: link-failure
          Severity: blocker
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



17:06:36 PDT ---
Created an attachment (id=1227)
testcase

See the attached test-case and run build.bat to reproduce.

Note that using a regular module import in the client code works, but using the
package import triggers linker errors.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 16 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10386




17:06:58 PDT ---
The linker error:

 Error 42: Symbol Undefined _D3foo3bar3fooFiZv
-- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 16 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10386




17:07:41 PDT ---
Using latest git-head version of DMD.

I've only verified this on Windows, but the test-case is simple enough for
people to test it on Posix.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 16 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10386


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



17:51:38 PDT ---
For tiny files like that, it's a lot more user-friendly to just put the text of
them in a comment. Otherwise, only a small fraction of people will look at it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 17 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10386




17:55:39 PDT ---

 For tiny files like that, it's a lot more user-friendly to just put the text of
 them in a comment. Otherwise, only a small fraction of people will look at it.
The reason I zipped it is because it has a directory structure, which is always painful to recreate manually. Here's the zip contents anyway: ./test.d: ----- module test; // import lib.foo.bar; // ok import lib.foo; // linker failure void main() { foo(1); } ----- ./lib/foo/bar.d ----- module lib.foo.bar; void foo(int x) { assert(x == 1); } ----- ./lib/foo/package.d ----- module lib.foo; public import lib.foo.bar; ----- On Windows compile with: $ dmd -lib lib\foo\bar.d lib\foo\package.d -offoo.lib $ dmd test.d foo.lib On Posix it's probably: $ dmd -lib lib/foo/bar.d lib/foo/package.d -oflibfoo.a $ dmd test.d -L-lfoo -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 17 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10386


Martin Nowak <code dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code dawg.eu




 The linker error:
 
 Error 42: Symbol Undefined _D3foo3bar3fooFiZv
Looks like the mangling is wrong. It should be _D3lib3foo3bar3fooFiZv right? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 18 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10386




06:23:12 PDT ---


 The linker error:
 
 Error 42: Symbol Undefined _D3foo3bar3fooFiZv
Looks like the mangling is wrong. It should be _D3lib3foo3bar3fooFiZv right?
Yeah I think so. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 18 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10386


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/2229

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 19 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10386




Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/4ddfbcb9aee814cddc82939ecd37928059f3e670
fix Issue 10386 - Package import feature breaks with static libraries

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 20 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10386


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 20 2013