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

C#: Fix MSVC dotnet dev_mode regression #83114

Merged

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Oct 10, 2023

A regression by #82729 brings back the erroneous behavior found in #79351. This is fixed by reimplementing the #else check in the ios export_plugin script

@Repiteo Repiteo requested a review from a team as a code owner October 10, 2023 16:56
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change looks wrong, the export template checks are relevant for both Mono and non-Mono exports.

Probably should be something like:

#if defined(MODULE_MONO_ENABLED) && !defined(MACOS_ENABLED)
	// TODO: Remove this restriction when we don't rely on macOS tools to package up the native libraries anymore.
	r_error += TTR("Exporting to iOS when using C#/.NET is experimental and requires macOS.") + "\n";
	return false;
#else

#if defined(MODULE_MONO_ENABLED)
	// iOS export is still a work in progress, keep a message as a warning.
	r_error += TTR("Exporting to iOS when using C#/.NET is experimental.") + "\n";
#endif

	String err;
	bool valid = false;
	// Look for export templates (first official, and if defined custom templates).
	bool dvalid = exists_export_template("ios.zip", &err);
	bool rvalid = dvalid; // Both in the same ZIP.
	if (p_preset->get("custom_template/debug") != "") {
		dvalid = FileAccess::exists(p_preset->get("custom_template/debug"));
		if (!dvalid) {
			err += TTR("Custom debug template not found.") + "\n";
		}
	}
	if (p_preset->get("custom_template/release") != "") {
		rvalid = FileAccess::exists(p_preset->get("custom_template/release"));
		if (!rvalid) {
			err += TTR("Custom release template not found.") + "\n";
		}
	}
	valid = dvalid || rvalid;
	r_missing_templates = !valid;
	if (!err.is_empty()) {
		r_error += err;
	}

	return valid;
#endif

@Repiteo Repiteo force-pushed the fix-dotnet-dev-build-regression branch from fc1368a to 0d7d4c2 Compare October 10, 2023 17:24
@Repiteo
Copy link
Contributor Author

Repiteo commented Oct 10, 2023

Oop, I must've assumed the macos check returned early too. Got a fixed version up now

@akien-mga akien-mga added this to the 4.2 milestone Oct 10, 2023
@akien-mga akien-mga merged commit 918f046 into godotengine:master Oct 10, 2023
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@Repiteo Repiteo deleted the fix-dotnet-dev-build-regression branch October 10, 2023 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants