Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building a C# project yields a "attempt to index a nil value (field 'cs2005')"? #427

Open
eddieparker opened this issue Apr 16, 2019 · 3 comments
Labels

Comments

@eddieparker
Copy link

eddieparker commented Apr 16, 2019

This could be a misconfiguration on my part, but the lua callstack isn't giving me much to go on.

I've built a project as follows:

project "enginesharp"
	language "C#"
	kind "StaticLib"
	objdir (path.join(SOLUTION_DIR, "_build/obj/" .. project()['name']))
	location "src/enginesharp"

	files { "**.*" }

The master genie file looks like this in case it matters:

SOLUTION_DIR = path.getabsolute("./")
TARGET_DIR=path.join(SOLUTION_DIR, "_build/bin")

function fix_path_slashes(path)
	return path:gsub("/", "\\")
end

solution "tinkerengine"
	configurations {
		"Debug",
		"Release",
	}

	platforms {
		"x64",
		"x32",
	}

	language "C++"
	targetdir(TARGET_DIR)

-- Too slow for iterating, so I'm disabling this for now
-- No real good place to put this, so put this at the root
--all_genie_files = os.matchfiles(path.join(SOLUTION_DIR, "**_genie.lua"))
--
---- Rebuild sln from genie if out of date.
--custombuildtask {
--	{
--		path.join(SOLUTION_DIR, "genie.lua"), -- input
--		path.join(SOLUTION_DIR, "file_that_dont_exist.sln"), -- output
--		all_genie_files, -- dependencies
--		{ -- command:
--			"@echo Building visual studio solutions.",
--			(path.join(SOLUTION_DIR, "genie.bat") .. " vs2017")
--		}
--	},
--}

-- 3rdparty scripts
for index, match in pairs(os.matchfiles("3rdparty/genie_scripts/*.lua")) do
	dofile(match)
end

-- Our genie files
for index, match in pairs(os.matchfiles("src/**.lua")) do
	dofile(match)
end

Anyhow, running genie with vs2017 as the action, either release or built from github yields:

Building configurations...
Running action 'vs2017'...
[string "premake.vstudio.vc2017 = {}..."]:21: attempt to index a nil value (field 'cs2005')
stack traceback:
        [string "premake.vstudio.vc2017 = {}..."]:21: in field 'onproject'
        [string "premake.action = { }..."]:23: in field 'call'
        [string "_WORKING_DIR        = os.getcwd()..."]:74: in function '_premake_main'

It's not clear what I'm doing wrong here, or what's misconfigured on my system. I can build C# apps that I build with VS2017 normally; so I'm not sure what's going on with genie.

@bkaradzic
Copy link
Owner

C# code path in GENie wasn't maintained well. I'm going to look at it.

@bkaradzic bkaradzic added the bug label Apr 16, 2019
@Mvivant
Copy link

Mvivant commented Nov 4, 2019

Hi, I have same issue to make a C# project.
Did you fix it ?

1 similar comment
@ScienceGeekxx
Copy link

Hi, I have same issue to make a C# project.
Did you fix it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants
@bkaradzic @eddieparker @ScienceGeekxx @Mvivant and others