Page 1 of 1

Embed run-time fully works now

PostPosted: Wed Dec 24, 2008 4:14 am
by Charles
Cobra has an option to embed its run-time library in the resulting program so that there is no external Cobra.Lang.dll needed. However, there has been a bug for some time, described in ticket:3, in which the "Cobra.Lang" namespaces would collide from the embedded and non-embedded (or 2 DLLs with embedded). Now fixed.

To try this feature, say:

cobra -ert:yes MyProg.cobra

You'll notice that the .exe gets bigger:

>cobra hello
Hello, world.

>dir hello.exe
12/24/2008 03:09 AM 4,096 hello.exe


>cobra -ert:yes hello
Hello, world.

>dir hello.exe
12/24/2008 03:10 AM 135,168 hello.exe


>cobra -ert:yes -turbo hello
Hello, world.

>dir hello.exe
12/24/2008 03:12 AM 90,112 hello.exe


Try it out and let me know if you have any problems.

Re: Embed run-time fully works now

PostPosted: Wed Dec 24, 2008 6:15 am
by gauthier
it seems the install-from-workspace script performs
Code: Select all
run: cobra.exe -ert:no hello


which give
Code: Select all
c:\home\dev\src\dotnet\projects\cobralanguage\Source\hello.cobra(3): error: The name "CobraCore" does not exist in the current context
c:\home\dev\src\dotnet\projects\cobralanguage\Source\hello.cobra(4): error: The name "CobraImp" does not exist in the current context
c:\home\dev\src\dotnet\projects\cobralanguage\Source\hello.cobra(4): error: The name "CobraCore" does not exist in the current context
c:\home\dev\src\dotnet\projects\cobralanguage\Source\hello.cobra(1): error: The name "CobraImp" does not exist in the current context
Compilation failed - 4 errors, 0 warnings
Not running due to errors above.

** ERROR: Exit code from running Source Cobra: 1


manual instructions work as expected

Re: Embed run-time fully works now

PostPosted: Wed Dec 24, 2008 10:48 am
by Charles
"cobra -bsl" for building the standard library is somehow the culprit. After this command:

copy Cobra.Lang-previous.dll Cobra.Lang.dll

I was able to run "cobra -ert:no hello" again.

Will fix.

Re: Embed run-time fully works now

PostPosted: Wed Dec 24, 2008 11:08 am
by Charles
Fixed.

"cobra -bsl" was mangling the Cobra.Lang namespace name which caused all manner of havoc. Easy fix.