question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"No proc named" for existing proc

See original GitHub issue

Trying to compile /vg/station, the following error occurs:

Error at code\names.dm:1:31: No proc named "file2list"

The relevant code in names.dm:

var/list/ai_names = file2list("config/names/ai.txt")

file2list is defined as:

/proc/file2list(filename, seperator="\n")
	return splittext(return_file_text(filename),seperator)

Maybe it has something to do with there being a number in the proc name, because it also occurs for the proc: file2listExceptComments defined as:

/proc/file2listExceptComments(filename, seperator="\n", comment_prefix="#", trim_all=TRUE)
	. = list()
	var/prefixlen=length(comment_prefix)
	for(var/line in file2list(filename,seperator))
		var/trim_line=trim(line)
		// Drop empty lines.
		if(trim_line == "")
			continue
		// Drop comments.
		if(copytext(trim_line,1,1+prefixlen)==comment_prefix)
			continue
		. += (trim_all ? trim_line : line)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
wixoaGitcommented, Jun 19, 2022

Taking a deeper look at this, this is actually relatively easy to fix. The only thing that tries to resolve a var’s proc call before it can be defined is this line, which could be replaced with a method that gets the proc’s name without ever resolving the proc itself.

There’s also an issue where:

40 var/wires = WIRE_RECEIVE | WIRE_PULSE
41 
42 var/const/WIRE_RECEIVE = 1			//Allows Pulsed(0) to call Activate()
43 var/const/WIRE_PULSE = 2				//Allows Pulse(0) to act on the holder

errors Error at code\modules\assembly\assembly.dm:40:39: Unknown identifier "WIRE_PULSE" Is this caused by the same or a similar thing? It seems like maybe BYOND defines all consts before evaluating the value of non-const vars.

It’s caused by a similar issue, though more difficult to fix. The OD compiler is trying to resolve the var’s value immediately instead of waiting until every const is defined.

The solution for this is to postpone setting these variables’ values until after this ProcessBlockInner() call. What makes this complicated is knowing when the var depends on a const that doesn’t exist yet, and postponing it until after it is. Because of code snippets like this, it could even end up taking multiple iterations:

/var/const/A = B
/var/const/B = C
/var/const/C = D
/var/const/D = 1
0reactions
Hinaichigocommented, Mar 9, 2023

This no longer occurs and seems like it was fixed by #872.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create proc entry in existing dir not possible?
In proc_mkdir call you use combination of relative path in name and NULL in parent . You could use the same approach in...
Read more >
Directory in /proc that isn't process dir but start with number?
Quick question. Is it possible to create directory in /proc that starts with number but isn't process directory (where name is PID)? I...
Read more >
1.14. /proc
/proc. /proc is very special in that it is also a virtual filesystem. It's sometimes referred to as a process information pseudo-file system....
Read more >
Built-In Commands - proc manual page
The proc command creates a new Tcl procedure named name, replacing any existing command or procedure there may have been by that name....
Read more >
There is no /proc/self/ns/mnt in my linux · Issue #326
Maybe I am running an older kernel, but I even on newer Centos versions it seems there is no namespace folder in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found