-
-
Notifications
You must be signed in to change notification settings - Fork 238
Open
Description
Flow:
Lines 1012 to 1032 in cea2f15
| override int execute(Dub dub, string[] free_args, string[] app_args) | |
| { | |
| enforceUsage( | |
| !(m_importPaths && m_stringImportPaths), | |
| "--import-paths and --string-import-paths may not be used together." | |
| ); | |
| enforceUsage( | |
| !(m_data && (m_importPaths || m_stringImportPaths)), | |
| "--data may not be used together with --import-paths or --string-import-paths." | |
| ); | |
| // disable all log output to stdout and use "writeln" to output the JSON description | |
| auto ll = getLogLevel(); | |
| setLogLevel(max(ll, LogLevel.warn)); | |
| scope (exit) setLogLevel(ll); | |
| string package_name; | |
| enforceUsage(free_args.length <= 1, "Expected one or zero arguments."); | |
| if (free_args.length >= 1) package_name = free_args[0]; | |
| setupPackage(dub, package_name); |
Lines 618 to 622 in cea2f15
| protected void setupPackage(Dub dub, string package_name, string default_build_type = "debug") | |
| { | |
| if (!m_compilerName.length) m_compilerName = dub.defaultCompiler; | |
| m_compiler = getCompiler(m_compilerName); | |
| m_buildPlatform = m_compiler.determinePlatform(m_buildSettings, m_compilerName, m_arch); |
dub/source/dub/compilers/dmd.d
Lines 56 to 68 in cea2f15
| BuildPlatform determinePlatform(ref BuildSettings settings, string compiler_binary, string arch_override) | |
| { | |
| string[] arch_flags; | |
| switch (arch_override) { | |
| default: throw new Exception("Unsupported architecture: "~arch_override); | |
| case "": break; | |
| case "x86": arch_flags = ["-m32"]; break; | |
| case "x86_64": arch_flags = ["-m64"]; break; | |
| case "x86_mscoff": arch_flags = ["-m32mscoff"]; break; | |
| } | |
| settings.addDFlags(arch_flags); | |
| return probePlatform(compiler_binary, arch_flags ~ ["-quiet", "-c", "-o-"], arch_override); |
dub/source/dub/compilers/compiler.d
Lines 119 to 124 in cea2f15
| protected final BuildPlatform probePlatform(string compiler_binary, string[] args, string arch_override) | |
| { | |
| import std.string : format; | |
| import dub.compilers.utils : generatePlatformProbeFile, readPlatformProbe; | |
| auto fil = generatePlatformProbeFile(); |
dub/source/dub/compilers/utils.d
Lines 245 to 252 in cea2f15
| NativePath generatePlatformProbeFile() | |
| { | |
| import dub.internal.vibecompat.core.file; | |
| import dub.internal.vibecompat.data.json; | |
| import dub.internal.utils; | |
| auto path = getTempFile("dub_platform_probe", ".d"); | |
Probably it could be something simple as the timestamp of the compiler binary.
How about ~/.dub/compilers/<dmd|ldc|gdc>_timestamp?
Related PRs:
- Avoid creation of a temporary probe file for newer compilers #1316 (avoids the creation of this temporary file)
- Implement -probe for showing supported features dmd#7521 (implements
-probedirectly in the compiler)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels