clojure-clr-1.9.0-Release4.0 compile fails clojure.spec.alpha.dll not found

202 views
Skip to first unread message

Benno Falkner

unread,
Jul 11, 2018, 6:39:37 PM7/11/18
to clojure-clr
Hi,

I'm trying to use Clojure CLR the first time and whant to compile a Hello World app.

My folder structure is 

cljtest\build
cljtest\src\cljtest\core.clj

The source file contains: 

(ns cljtest.core (:gen-class :main true))
(defn -main []
(println "Hello World!"))
 

To build the program I run the following commands:

$env:CLOJURE_LOAD_PATH="$env:CLOJURE_CLR_PATH; $(pwd)\src; $(pwd)\build;"
$env:CLOJURE_COMPILE_PATH="$(pwd)\build"

clojure.compile cljtext.core

The process fail with clojure.spec.alpha.dll not found in local path. Perhaps it is not
searching at the other locations (I dont know).

In the clojure installation folder Clojure.Main is working. I need this for a windows
server and education but i am from a unix world.

Thnaks for your help

Benno

David Miller

unread,
Jul 17, 2018, 11:58:18 PM7/17/18
to benno....@gmail.com, cloju...@googlegroups.com
Several questions to help figure this out:

(1) you downloaded ClojureCLR from SourceForge?
(2) You are running under what OS?
 (I'm working on a problem with one combination of SourceForge download / OS, trying to see if this is a case.)


--
You received this message because you are subscribed to the Google Groups "clojure-clr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-clr...@googlegroups.com.
To post to this group, send email to cloju...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojure-clr.
For more options, visit https://groups.google.com/d/optout.

Benno Falkner

unread,
Jul 18, 2018, 2:38:56 AM7/18/18
to David Miller, clojure-clr

Hi David,

 

I’m running Windows 10 (with all updates). Yes, it’s the sourceforge Version. I simply followed the tutorial on the homepage.

 

The strange thing is, everything is doing fine in the installation folder of Clojure but in a project folder the loadpath Information is not used.

 

Thanks

Benno

 

Gesendet von Mail für Windows 10

dmiller2718

unread,
Jul 18, 2018, 9:02:25 AM7/18/18
to clojure-clr
this is a new problem with 1.9.
with the spec code being moved to other projects and imported (as per ClojureJVM), that code is now imported as embedded resources in two DLLs that are brought in via NuGet.  They are assembly-loaded during ClojureCLR initialization.

I might have erred by direct assembly-loading rather than going through the process that the 'load' function uses.  I'll issue a patch, but that will take a few days. (I'm on the road and in a development-environment deficit.)  the short workaround might be to copy clojure.spec.alpha.dll and clojure.core.specs.alpha to your project/working directory.  Let me know if that works.

To unsubscribe from this group and stop receiving emails from it, send an email to clojure-clr+unsubscribe@googlegroups.com.

Benno Falkner

unread,
Jul 22, 2018, 3:30:34 AM7/22/18
to dmiller2718, clojure-clr

Hi,

 

the Problem is solved but there is a new Problem involving Environment variables.

 

Compiling cljtest.core to X:\Documents\GitHub\CljTest\build;System.ArgumentException: Ungültiges Verzeichnis "X:\ Documents \GitHub\CljTest\build;".

   bei System.Reflection.Emit.AssemblyBuilder.SaveNoLock(String assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)

   bei System.Reflection.Emit.AssemblyBuilder.Save(String assemblyFileName, PortableExecutableKinds portableExecutableKind, ImageFileMachine imageFileMachine)

   bei clojure.lang.CljCompiler.Ast.GenContext.SaveAssembly() in d:\work\clojure-clr\Clojure\Clojure\CljCompiler\Ast\GenContext.cs:Zeile 213.

   bei clojure.lang.GenClass.GenerateClass(String className, Type superclass, ISeq interfaces, ISeq ctors, ISeq ctorTypes, ISeq methods, IPersistentMap exposesFields, IPersistentMap exposesMethods, String prefix, Boolean hasMain, String factoryName, String stateName, String initName, String postInitName, String implCname, String implNamespace, Boolean loadImplNamespace, IPersistentMap attributes) in d:\work\clojure-clr\Clojure\Clojure\CljCompiler\GenClass.cs:Zeile 144.

   bei clojure/core$generate_class__9057.invokeStatic(Object )

   bei clojure/core$gen_class__9063.invokeStatic(Object , Object , ISeq )

   bei clojure.lang.Compiler.MacroexpandSeq1(ISeq form) in d:\work\clojure-clr\Clojure\Clojure\CljCompiler\Compiler.cs:Zeile 1168.

   bei clojure.lang.Compiler.AnalyzeSeq(ParserContext pcon, ISeq form, String name) in d:\work\clojure-clr\Clojure\Clojure\CljCompiler\Compiler.cs:Zeile 2025., compiling: (cljtest/core.clj:1:2)

 

Now the compile path is not found.

 

 

 

 

Gesendet von Mail für Windows 10

 

To unsubscribe from this group and stop receiving emails from it, send an email to clojure-clr...@googlegroups.com.


To post to this group, send email to cloju...@googlegroups.com.
Visit this group at https://groups.google.com/group/clojure-clr.
For more options, visit https://groups.google.com/d/optout.

 

--

You received this message because you are subscribed to the Google Groups "clojure-clr" group.

To unsubscribe from this group and stop receiving emails from it, send an email to clojure-clr...@googlegroups.com.

mrwizard82d1

unread,
Jan 5, 2019, 2:26:51 AM1/5/19
to clojure-clr
I am having a similar issue.

I have downloaded the .zip file from SourceForge and unzipped it. When I run `Clojure.Main.exe` from another directory, I see the exception: 

Unhandled Exception: System.TypeInitializationException: The type initializer for 'Clojure.CljMain' threw an exception. ---> System.TypeInitializationException: The type initializer for 'clojure.lang.RT' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'file:///C:\Users\larry.jones\professional\projects\scratch-clj-clr\clojure.core.specs.alpha.dll' or one of its dependencies. The system cannot find the file specified.

The output from the fusion log viewer is: 

*** Assembly Binder Log Entry  (1/5/2019 @ 12:20:12 AM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  C:\Users\larry.jones\professional\software\languages\clojure-clr\clojure-clr-1.9.0\Release 4.0\Clojure.Main.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\Users\larry.jones\professional\projects\scratch-clojure-clr\clojure.spec.alpha.dll
LOG: Appbase = file:///C:/Users/larry.jones/professional/software/languages/clojure-clr/clojure-clr-1.9.0/Release 4.0/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = Clojure.Main.exe
Calling assembly : (Unknown).
===
LOG: This bind starts in LoadFrom load context.
WRN: Native image will not be probed in LoadFrom context. Native image will only be probed in default load context, like with Assembly.Load().
LOG: No application configuration file found.
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Attempting download of new URL file:///C:/Users/larry.jones/professional/projects/scratch-clojure-clr/clojure.spec.alpha.dll.
LOG: All probing URLs attempted and failed.

And the output trying to load this assembly from IronPython is similar:

larry.jones@JONES-E5570 ~/professional/software/languages/clojure-clr/clojure-clr-1.9.0/Release-4.0
λ ipy
IronPython 2.7.7 (2.7.7.0) on .NET 4.0.30319.42000 (64-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> import clr
>>> clr.AddReferenceToFile("clojure.spec.alpha.dll")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: System.IO.IOException: Could not add reference to assembly clojure.spec.alpha.dll
   at IronPython.Runtime.ClrModule.AddReferenceToFile(CodeContext context, String file)
   at IronPython.Runtime.ClrModule.AddReferenceToFile(CodeContext context, String[] files)
   at Microsoft.Scripting.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
   at Microsoft.Scripting.Interpreter.FuncCallInstruction`6.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run4[T0,T1,T2,T3,TRet](T0 arg0, T1 arg1, T2 arg2, T3 arg3)
   at IronPython.Compiler.Ast.CallExpression.Invoke1Instruction.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.Interpreter.Run(InterpretedFrame frame)
   at Microsoft.Scripting.Interpreter.LightLambda.Run2[T0,T1,TRet](T0 arg0, T1 arg1)
   at IronPython.Compiler.PythonScriptCode.RunWorker(CodeContext ctx)
   at IronPython.Hosting.PythonCommandLine.<>c__DisplayClass27_0.<RunOneInteraction>b__0()

I would appreciate any help. I suspect I can workaround the issue by copying the contents of `Release-4.0` 
into the directory I want to work on, but I think that a better solution must exist.

Thanks.

To unsubscribe from this group and stop receiving emails from it, send an email to clojure-clr...@googlegroups.com.

mrwizard82d1

unread,
Jan 5, 2019, 2:34:25 AM1/5/19
to clojure-clr
Two updates.

If I simply copy `clojure.spec.alpha.dll` into my "project" directory, I continue to encounter the error.

If I copy all the files from `Release-4.0` into my "project" directory, I can successfully run `Clojure.Main.exe`.

Thanks.

Devin Sackett

unread,
Jan 5, 2019, 11:53:51 AM1/5/19
to clojure-clr, mrwizard82d1
Download nuget packages: clojure.spec.alpha and clojure.core.spec.alpha. then copy the dlls into these directories:

{Project Folder}
{Project Folder}/build
{Project Folder}/clojure <- this could be what ever name you copied the clojure code into, looks like in your case its named "Release-4.0"

Hope this helps.

-Devin

mrwizard82d1

unread,
Jan 6, 2019, 7:29:34 PM1/6/19
to clojure-clr
Devin,

Thanks for the note.

I believe I actually already have these files in the "Release-4.0" directory. (I did not make this clear in my original post.) Here's the result of `ls`:

λ ls
clojure/                         clojure.main.clj.dll*                  clojure.test.generative.dll*
clojure.clr.io.clj.dll*          Clojure.Main.exe*                      clojure.test.junit.clj.dll*
clojure.clr.shell.clj.dll*       Clojure.Main.pdb                       clojure.test.tap.clj.dll*
Clojure.Compile.exe*             Clojure.pdb                            clojure.test_clojure.attributes.clj.dll*
Clojure.Compile.pdb              clojure.pprint.cl_format.clj.dll*      clojure.test_clojure.compilation.examples.clj.dll*
clojure.core.clj.dll*            clojure.pprint.clj.dll*                clojure.test_clojure.compilation.line_number_examples.clj.dll*
clojure.core.protocols.clj.dll*  clojure.pprint.column_writer.clj.dll*  clojure.test_clojure.compilation.load_ns.clj.dll*
clojure.core.reducers.clj.dll*   clojure.pprint.dispatch.clj.dll*       clojure.test_clojure.genclass.examples.clj.dll*
clojure.core.server.clj.dll*     clojure.pprint.pprint_base.clj.dll*    clojure.test_clojure.genclass.examples.ExampleClass.dll*
clojure.core.specs.alpha.dll*    clojure.pprint.pretty_writer.clj.dll*  clojure.test_clojure.protocols.examples.clj.dll*
clojure.core_clr.clj.dll*        clojure.pprint.print_table.clj.dll*    clojure.tools.namespace.dll*
clojure.core_deftype.clj.dll*    clojure.pprint.utilities.clj.dll*      clojure.uuid.clj.dll*
clojure.core_print.clj.dll*      clojure.reflect.clj.dll*               clojure.walk.clj.dll*
clojure.core_proxy.clj.dll*      clojure.reflect.clr.clj.dll*           clojure.zip.clj.dll*
clojure.data.clj.dll*            clojure.repl.clj.dll*                  Microsoft.Dynamic.dll*
clojure.data.generators.dll*     clojure.set.clj.dll*                   Microsoft.Dynamic.xml
Clojure.dll*                     clojure.spec.alpha.dll*                Microsoft.Scripting.AspNet.dll*
Clojure.dll.config               clojure.stacktrace.clj.dll*            Microsoft.Scripting.AspNet.xml
clojure.edn.clj.dll*             clojure.string.clj.dll*                Microsoft.Scripting.dll*
clojure.genclass.clj.dll*        clojure.template.clj.dll*              Microsoft.Scripting.Metadata.dll*
clojure.gvec.clj.dll*            clojure.test.check.dll*                Microsoft.Scripting.Metadata.xml
clojure.instant.clj.dll*         clojure.test.clj.dll*                  Microsoft.Scripting.xml

Devin Sackett

unread,
Jan 6, 2019, 10:31:42 PM1/6/19
to mrwizard82d1, clojure-clr

Running the tree command on my local folder I get:  Walking the Clojure CLR it needs the Clojure.core.specs.alpha.dll & clojure.specs.alpha.dll in the running directory.  Let me know if this works for you.

 

tree:

│   clojure.core.specs.alpha.dll

│   clojure.spec.alpha.dll

│   env.bat

│   env.sh

│   README.md

───build

│       Clojure.Compile.exe

│       Clojure.Compile.pdb

│       clojure.core.specs.alpha.dll

│       Clojure.dll

│       Clojure.Main.exe

│       Clojure.Main.exe.config

│       Clojure.Main.pdb

│       Clojure.pdb

│       Clojure.Source.dll

│       Clojure.Source.pdb

│       clojure.spec.alpha.dll

│       Microsoft.Dynamic.dll

│       Microsoft.Scripting.dll

│       Microsoft.Scripting.Metadata.dll

───Clojure.1.9.0

│   │   Clojure.Compile.exe

│   │   Clojure.Compile.pdb

│   │   clojure.core.specs.alpha.dll

│   │   Clojure.dll

│   │   Clojure.Main.exe

│   │   Clojure.Main.exe.config

│   │   Clojure.Main.pdb

│   │   Clojure.pdb

│   │   Clojure.Source.dll

│   │   Clojure.Source.pdb

│   │   clojure.spec.alpha.dll

│   │   Microsoft.Dynamic.dll

│   │   Microsoft.Dynamic.xml

│   │   Microsoft.Scripting.dll

│   │   Microsoft.Scripting.Metadata.dll

│   │

│   └───clojure

│       │   ants.clj

│       │   core.clj

│       │   core_clr.clj

│       │   core_deftype.clj

│       │   core_print.clj

│       │   core_proxy.clj

│       │   data.clj

│       │   dm-test.clj

│       │   edn.clj

│       │   genclass.clj

│       │   gvec.clj

│       │   instant.clj

│       │   main.clj

│       │   pprint.clj

│       │   reflect.clj

│       │   repl.clj

│       │   set.clj

│       │   stacktrace.clj

│       │   string.clj

│       │   template.clj

│       │   test.clj

│       │   uuid.clj

│       │   walk.clj

│       │   zip.clj

│       │

│       ───clr

│       │       io.clj

│       │       shell.clj

│       │

│       ───core

│       │       protocols.clj

│       │       reducers.clj

│       │       server.clj

│       │

│       ───pprint

│       │       cl_format.clj

│       │       column_writer.clj

│       │       dispatch.clj

│       │       pprint_base.clj

│       │       pretty_writer.clj

│       │       print_table.clj

│       │       utilities.clj

│       │

│       ───reflect

│       │       clr.clj

│       │

│       ───samples

│       │   │   ants.clj

│       │   │   await-test.clj

│       │   │   celsius.clj

│       │   │   counter.clj

│       │   │

│       │   ───attributes

│       │   │       testattribute.clj

│       │   │

│       │   ───deftype

│       │   │       testdeftype.clj

│       │   │       testprotocol.clj

│       │   │

│       │   ───genclass

│       │   │       testgenclass.clj

│       │   │       testgenclass2.clj

│       │   │       testgenclass3.clj

│       │   │       testmvc.clj

│       │   │

│       │   ───interop

│       │   │       testinterop.clj

│       │   │

│       │   ───proxy

│       │   │       testproxy.clj

│       │   │

│       │   └───stm

│       │           teststm.clj

│       │

│       └───test

│               junit.clj

│               tap.clj

───src

───tests

 

--Devin

dmiller2718

unread,
Jan 8, 2019, 12:31:36 PM1/8/19
to clojure-clr
I've run into this recently myself trying to update, well, those libraries themselves.

Putting those two DLLs into the running directory solved it for me.

I need to fix this in 1.10, which I'm working on.   It may be as simple as making sure to probe the directory the executable is in.

I'd love to have some feedback on this.

-David


P.S.  And apologies for the crappy QA on this.  

To unsubscribe from this group and stop receiving emails from it, send an email to clojure-clr+unsubscribe@googlegroups.com.

Devin Sackett

unread,
Jan 10, 2019, 1:33:05 AM1/10/19
to clojure-clr, dmiller2718
I wonder if you can use the Environment variable, CLOJURE_LOAD_PATH, to find the two dlls?

—Devin

Kashyap CK

unread,
Feb 2, 2019, 11:05:17 AM2/2/19
to clojure-clr
I still see this issue...is there a workaround for this?

dmiller2718

unread,
Feb 3, 2019, 5:26:16 PM2/3/19
to clojure-clr
CLOJURE_LOAD_PATH should do it.
I'll run some more experiments this week.
I plan to have a real fix in 1.10, coming very soon.
You can track this issue here:  https://dev.clojure.org/jira/browse/CLJCLR-102

C K Kashyap

unread,
Feb 3, 2019, 8:27:19 PM2/3/19
to dmiller2718, clojure-clr
Thanks David,
Regards,
Kashyap

You received this message because you are subscribed to a topic in the Google Groups "clojure-clr" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojure-clr/_igHpVPOstc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojure-clr...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages