Ddwchucklib does not work on a mac computer

Hi, I had some time today and tried to get to know quark ddwchucklib. I can’t get \loadAllCl.eval;and \makeController.eval to respond. I have the ddw quarks installed and up to date. I’m on a Mac M1 machine, has anyone had the same problem?
When I evaluate \loadAllCl.eval; the postwindow it returns:

executeFile failed:  /Users/sdcarr/Library/Application Support/SuperCollider/downloaded-quarks/ddwChucklib-livecode/nanoktl-objects.scd
ERROR: Message 'clone' not understood.
RECEIVER:
   nil
ARGS:
Instance of Function {    (0x128c879f8, gc=74, fmt=00, flg=00, set=02)
  instance variables [2]
    def : instance of FunctionDef in closed FunctionDef
    context : Frame (0x150142db8) of Function
}
   nil
PATH: /Users/sdcarr/Library/Application Support/SuperCollider/downloaded-quarks/ddwChucklib-livecode/nanoktl-objects.scd

PROTECTED CALL STACK:
	Meta_MethodError:new	0x1206f8ec0
		arg this = DoesNotUnderstandError
		arg what = nil
		arg receiver = nil
	Meta_DoesNotUnderstandError:new	0x1206fb200
		arg this = DoesNotUnderstandError
		arg receiver = nil
		arg selector = clone
		arg args = [ a Function, nil ]
	Object:doesNotUnderstand	0x1280ca200
		arg this = nil
		arg selector = clone
		arg args = nil
	a FunctionDef	0x130c01168
		sourceCode = "<an open Function>"
	Function:prTry	0x120a58940
		arg this = a Function
		var result = nil
		var thread = a Thread
		var next = a Function
		var wasInProtectedFunc = true
	Function:protect	0x120a4fe40
		arg this = a Function
		arg handler = a Function
		var result = nil
	a FunctionDef	0x1205ab280
		sourceCode = "<an open Function>"
	Function:prTry	0x120a58940
		arg this = a Function
		var result = nil
		var thread = a Thread
		var next = a Function
		var wasInProtectedFunc = true
	Function:protect	0x120a4fe40
		arg this = a Function
		arg handler = a Function
		var result = nil
	Interpreter:executeFile	0x1205aac00
		arg this = an Interpreter
		arg pathName = /Users/sdcarr/Library/Application Support/SuperCollider/downloaded-quarks/
ddwChucklib-livecode/nanoktl-objects.scd
		arg args = nil
		var result = [  ]
		var saveExecutingPath = nil
	a FunctionDef	0x121a3f300
		sourceCode = "<an open Function>"
	Function:prTry	0x120a58940
		arg this = a Function
		var result = nil
		var thread = a Thread
		var next = nil
		var wasInProtectedFunc = false
	
CALL STACK:
	DoesNotUnderstandError:reportError
		arg this = <instance of DoesNotUnderstandError>
	Nil:handleError
		arg this = nil
		arg error = <instance of DoesNotUnderstandError>
	Thread:handleError
		arg this = <instance of Thread>
		arg error = <instance of DoesNotUnderstandError>
	Object:throw
		arg this = <instance of DoesNotUnderstandError>
	String:loadPath
		arg this = "/Users/sdcarr/Library/Applic..."
		arg warnIfNotFound = true
		var obj = nil
		var path = "/Users/sdcarr/Library/Applic..."
	ArrayedCollection:do
		arg this = [*3]
		arg function = <instance of Function>
		var i = 2
	ArrayedCollection:do
		arg this = [*3]
		arg function = <instance of Function>
		var i = 1
	Interpreter:interpretPrintCmdLine
		arg this = <instance of Interpreter>
		var res = nil
		var func = <instance of Function>
		var code = "\loadAllCl.eval;"
		var doc = nil
		var ideClass = <instance of Meta_ScIDE>
	Process:interpretPrintCmdLine
		arg this = <instance of Main>
^^ ERROR: Message 'clone' not understood.
RECEIVER: nil

I have searched the forum and the related posts are quite old. I would be grateful for any help.
Regards

Hi, thanks for reporting.

One test – start from scratch (recompile the class library first), then:

(Quarks.at("ddwChucklib-livecode").localPath +/+ "mobile-objects.scd").load;
// should answer -> PR('controlList')

PR.exists(\mix16Touch);
// should answer -> true

The reason for this test is: nanoktl-objects.scd has only one clone call: PR(\mix16Touch).clone { ... }. The nil error can be occurring only if PR(\mix16Touch) doesn’t exist. That object is defined in mobile-objects.scd.

There are two safeties here: 1/ the \loadClExtras function loads mobile-objects first, then nanoktl-objects. 2/ even if for some reason mobile-objects hadn’t been loaded, nanoktl-objects will load it if needed.

I can’t reproduce this problem locally, and I checked for any differences between my local copy and the github repository – in these files, I don’t have any local changes.

So my guess at this time is that mobile-objects.scd must have been modified in your system.

hjh

Hi, the test gives me back:

-> /Users/sdcarr/Library/Application Support/SuperCollider/downloaded-quarks/ddwChucklib-livecode/mobile-objects.scd
-> false

Can you do cmd-I on loadPath and copy/paste what you have for String:loadPath? I guess something wrong here.

hjh

loadPath {}
	enpath {}
	loadDocument {}
	didLoadFromPath {}
}

+ SequenceableCollection {
	loadPath { arg warnIfNotFound=true;
		^this.collect { arg obj;
			obj.loadPath(warnIfNotFound)
		}
	}
	enpath {
		^this.collect({ arg obj;
			obj.enpath
		})
	}
	loadDocument {
		^this.collect({ arg obj;
			obj.loadDocument
		})
	}
}

+ String {
	loadPath { arg warnIfNotFound=true;
		var obj, path;
		path = this.standardizePath;
		if(File.exists(path), {
			{
				obj = thisProcess.interpreter.executeFile(path);
				obj.didLoadFromPath(this);
			}.try({ arg err;
				// could be compile or execute error
				("executeFile failed: " + this).postln;
				err.throw;
			});
		}, {
			if(warnIfNotFound, {
				warn("String:loadPath file not found " + this + path);
				^nil
			});
		});
		if(obj.isNil and: warnIfNotFound, {
			warn("String:loadPath found nil, empty contents or parse error in " + path);
		});
		^obj
	}
	loadDocument { arg warnIfNotFound=true;
		var path, obj;
		path = PathName.standardizeDocumentPath(this);
		if(File.exists(path), {
			obj = thisProcess.interpreter.executeFile(path);
			obj.didLoadFromPath(path);
			^obj
		}, {
			if(warnIfNotFound, {
				warn("String:loadDocument file not found " + this + path);
			});
			^ObjectNotFound.new(path)
		});
	}
	enpath {
		^PathName.abrevDocumentPath(this)
	}

	guiDocument {
		var doc;
		doc = this.loadDocument;
		doc.gui;
		^doc
	}
}

+ AbstractPlayer {

	enpath {
		//document enpath abrev it
		^if(path.notNil, {
			^PathName.abrevDocumentPath(path)
		}, {
			this
		})
	}
	loadDocument {
		^this
	}
	didLoadFromPath { arg argpath;
		path = argpath;
		//dirty = false;
	}
	// old style
	*load { arg obj, warnIfNotFound=true;
		^obj.loadDocument(warnIfNotFound);
	}
	*enpath { arg obj;
		^obj.enpath // document enpath
	}
	load { arg obj, warnIfNotFound=true;
		^obj.loadDocument(warnIfNotFound);
	}

}


+ Dictionary {

	enpath {
		^this.collect({ arg obj;
			obj.enpath
		})
	}
}



/*

	converts any signed integer (such as an identityHash) into a base 62
	string for unique file name usage.
	so this essentially compresses a large integer into a smaller string representation.
	its not intended to be reversible, but it could be if need be.
*/

+ Integer {

	asFileSafeChar {
		^(#[ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "_", "*", "#", "-", "+", "~", "$" ]).at(this)
	}
	/*
		extension methods crash if called recursively.
		james is working on a fix.

	asFileSafeString {
		var output, msd, lsd;
		if(this < 62, {
			if(this.isNegative, {
				^("-" ++ this.neg.asFileSafeString)
			}, {
				^this.asFileSafeChar
			})
		}, {
			msd = floor(this / 62.0);
			lsd = this - (msd * 62.0);
			if(msd >= 62, {
				^msd.asFileSafeString ++ lsd.asInteger.asFileSafeChar
			}, {
				^msd.asInteger.asFileSafeChar ++ lsd.asInteger.asFileSafeChar
			})
		})
	}
	*/
	asFileSafeString {
		var output = "", val, msd, lsd;
		val = this.abs;
		while ({ val != 0 }, {
			msd = floor(val / 69).asInteger;
			lsd = val - (msd * 69);
			output = lsd.asFileSafeChar ++ output;
			val = msd;
		});
		if (this < 0, { ^"-" ++ output });
		^output
	}

}

+ Object {

	asFileSafeString {
		^this.asCompileString.hash.asFileSafeString
	}

}

+ String {
	asFileSafeString { // this is more for protecting against / etc.
		^this.collect({ arg c;
			if(c.isFileSafe, { c }, { $# })
		})
	}
}

loadPath looks like it should.

At this point, I’m not sure how to proceed.

If I do Quarks.at("ddwChucklib-livecode").localPath +/+ "mobile-objects.scd").load; then I get an object that’s been defined.

When you do it, nothing is executed and it just returns the path.

And my test asked you to use the core load method. (The ddwChucklib-livecode loader uses loadPath.) So you have something in your system that is breaking the core load definition.

Also strange is that some paths are being loaded (nanoktl-objects) but others are not. Never seen this before. I would assume that .load-ing a file (or loadPath-ing it) would either always load it, or always do nothing.

I guess the other suggestion might be: rename your sclang-conf.yaml to something else and reboot the interpreter. This should start over with zero quarks. Then Quarks.install("ddwLivecodeInstruments") – this should pull in all the dependencies (which are already downloaded. (After testing, you can rename the backup back to sclang-conf.yaml.) The config file can be found in Platform.userConfigDir.openOS.)

If the LC system works after that, then you have a conflicting extension (which is out of my control).

If it doesn’t work, then I have no idea – I could only apologize that valid code isn’t working on your machine.

hjh

[quote=“jamshark70, post:2, topic:9568”]
.
[/cita]

Te envío una captura de pantalla del contenido de las carpetas y archivos en AplicationSupport/SuporCollider en caso de que haya algo extraño. El archivo s.ymal tiene exactamente el mismo código que sclang_conf.yaml

Right. I was writing that message on my phone and not on the computer, so no, I didn’t bother to check every character.

I’ll come back to this thread later in the week. My mood is not very good at the moment. This is not your fault – other things going on – but I find I just don’t have the mental bandwidth to handhold a troubleshooting process where I don’t have visibility into the system that’s malfunctioning. Again, this is not your fault – don’t worry – I just need a bit of time off.

hjh

Hello, first of all I would like to thank you for the effort you make to help the community, it is very important for me because I have been with SC for a while now and I am in that phase of wanting to learn and it has become obsessive.
Regarding the problem, don’t worry, I’m not in a hurry. I saw your video explaining how Quark works and I was interested in learning about it.
I wish you get through this difficult time and wish you the best.
Best regards

Excuse me one last thing. I installed Quark dwwLivecodeInstruments on another mac at work, and I have exactly the same problem. It’s a Catalina osx.
Regards

OK. So. Here’s the key test result in this thread:

(Quarks.at("ddwChucklib-livecode").localPath +/+ "mobile-objects.scd").load;

// my result
-> PR('controlList')

// your result
-> /Users/sdcarr/Library/Application Support/SuperCollider/downloaded-quarks/ddwChucklib-livecode/mobile-objects.scd

… and also that, when I check for the existence of an object created within that file, I find that it exists, and you find that it doesn’t.

This means that when I request this specific file to be .load-ed, it is compiled and executed. When you request the same thing, the file is not compiled, not executed, and it returns only the String receiver of .load.

One possible cause I had considered is that maybe the chucklib-livecode preprocessor was interfering. But, if you recompile the class library before doing this test (as I requested), then that couldn’t be the problem. (Maybe you skipped the recompile…? But even in that case, if I load the preprocessor and then run that test, I still get the correct result. So I don’t think the preprocessor is the problem.)

So the situation is: on your machines, .load executes some files, but fails to execute other files.

That’s weird.

I can think of only a couple of possible explanations.

One – maybe you have an extension that overrides load (or compileFile or executeFile or another key method). I think this is unlikely – but, if that’s the case, it would be relatively easy to fix. You could look for this by checking MethodOverride.printAll.

Or, two – maybe there is something about the code in this file that causes stack corruption in the interpreter, causing premature exit and the wrong value to be returned. This should be unlikely, but… load is clearly returning the wrong stack item (there’s no code path in load / executeFile that returns the receiver, but the receiver is being returned :confused: ), and stack corruption is a viable explanation. In that case, I don’t know why it would affect Mac only (unless it’s an M1/M2 compiler bug). I also hesitate to start restructuring files in my quark just because of what might be some bad-mojo weirdo dev chain issues (the fact that it crops up in my quark doesn’t necessarily mean it’s my problem to solve).

So my suggestion at this time, @twistin, is to look very carefully for any extensions that might be breaking core methods. In that case, you could fix it on your own by un-overriding those methods.

And if those really don’t exist, then we’d have to figure out how to make a consistent reproducer to file a bug report. Probably nothing else that could be done, then (sorry).

hjh

Thank you very much, I sincerely appreciate your interest in trying to solve the problem. I don’t have time now, but I will try it with a Windows machine later.
Best regards

BTW: I asked other users to try in Mac and found that mobile-objects.scd refers to a class that I thought I had published, but I didn’t.

I just pushed it, so if you update quarks (specifically ddwCommon), then that problem should be fixed.

An undefined class in a .scd file should cause a “Class not defined” error to be printed. For some reason, on your two computers, it didn’t – it just returned the string path. (Or, maybe it did but that was never reported in this thread.) This was misleading for the troubleshooting process.

So another question is: Are you 100% sure that it did not say “Class not defined”?

hjh