Alpine appears to not be ignoring the request to build without fontconfig (#1416)

* Fix the checks for dependencies

#1341

* lines

* gnArgs wasn't being added to the build

* echo

* asdfdf

* asdf

* Try >-

* Nope

* Test

* sadfas

* asdf

* got it i think
This commit is contained in:
Matthew Leibowitz 2020-07-19 12:18:30 +02:00 коммит произвёл GitHub
Родитель 1530f48e8f
Коммит 00a535e743
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 27 добавлений и 16 удалений

Просмотреть файл

@ -17,7 +17,7 @@ var BUILD_ARCH = Argument("arch", Argument("buildarch", EnvironmentVariable("BUI
.ToLower().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); .ToLower().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
var BUILD_VARIANT = Argument("variant", EnvironmentVariable("BUILD_VARIANT")); var BUILD_VARIANT = Argument("variant", EnvironmentVariable("BUILD_VARIANT"));
var ADDITIONAL_GN_ARGS = Argument("gnArgs", EnvironmentVariable("ADDITIONAL_GN_ARGS")); var ADDITIONAL_GN_ARGS = Argument("gnArgs", Argument("gnargs", EnvironmentVariable("ADDITIONAL_GN_ARGS")));
DirectoryPath PROFILE_PATH = EnvironmentVariable("USERPROFILE") ?? EnvironmentVariable("HOME"); DirectoryPath PROFILE_PATH = EnvironmentVariable("USERPROFILE") ?? EnvironmentVariable("HOME");
@ -58,7 +58,8 @@ void RunProcess(FilePath process, string args, out IEnumerable<string> stdout)
RedirectStandardOutput = true, RedirectStandardOutput = true,
Arguments = args, Arguments = args,
}; };
var result = StartProcess(process, settings, out stdout); var result = StartProcess(process, settings, out var stdoutActual);
stdout = stdoutActual.ToArray();
if (result != 0) { if (result != 0) {
throw new Exception($"Process '{process}' failed with error: {result}"); throw new Exception($"Process '{process}' failed with error: {result}");
} }

Просмотреть файл

@ -9,7 +9,7 @@ bool SUPPORT_GPU = SUPPORT_GPU_VAR == "1" || SUPPORT_GPU_VAR == "true";
string SUPPORT_VULKAN_VAR = Argument("supportVulkan", EnvironmentVariable("SUPPORT_VULKAN") ?? "true"); string SUPPORT_VULKAN_VAR = Argument("supportVulkan", EnvironmentVariable("SUPPORT_VULKAN") ?? "true");
bool SUPPORT_VULKAN = SUPPORT_VULKAN_VAR == "1" || SUPPORT_VULKAN_VAR.ToLower() == "true"; bool SUPPORT_VULKAN = SUPPORT_VULKAN_VAR == "1" || SUPPORT_VULKAN_VAR.ToLower() == "true";
var VERIFY_EXCLUDED = Argument("verifyExcluded", "") var VERIFY_EXCLUDED = Argument("verifyExcluded", Argument("verifyexcluded", ""))
.ToLower().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries); .ToLower().Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
string CC = Argument("cc", EnvironmentVariable("CC")); string CC = Argument("cc", EnvironmentVariable("CC"));
@ -29,6 +29,26 @@ if (!string.IsNullOrEmpty(CXX))
if (!string.IsNullOrEmpty(AR)) if (!string.IsNullOrEmpty(AR))
COMPILERS += $"ar='{AR}' "; COMPILERS += $"ar='{AR}' ";
void CheckDeps(FilePath so)
{
if (VERIFY_EXCLUDED == null || VERIFY_EXCLUDED.Length == 0)
return;
Information($"Making sure that there are no dependencies on: {string.Join(", ", VERIFY_EXCLUDED)}");
RunProcess("readelf", $"-d {so}", out var stdout);
Information(String.Join(Environment.NewLine + " ", stdout));
var needed = stdout
.Where(l => l.Contains("(NEEDED)"))
.ToList();
foreach (var exclude in VERIFY_EXCLUDED) {
if (needed.Any(o => o.Contains(exclude.Trim(), StringComparison.OrdinalIgnoreCase)))
throw new Exception($"{so} contained a dependency on {exclude}.");
}
}
Task("libSkiaSharp") Task("libSkiaSharp")
.IsDependentOn("git-sync-deps") .IsDependentOn("git-sync-deps")
.WithCriteria(IsRunningOnLinux()) .WithCriteria(IsRunningOnLinux())
@ -69,12 +89,7 @@ Task("libSkiaSharp")
CopyFileToDirectory(so, outDir); CopyFileToDirectory(so, outDir);
CopyFile(so, outDir.CombineWithFilePath("libSkiaSharp.so")); CopyFile(so, outDir.CombineWithFilePath("libSkiaSharp.so"));
foreach (var exclude in VERIFY_EXCLUDED) { CheckDeps(so);
RunProcess("readelf", $"-d {so}", out var stdout);
if (stdout.Any(o => o.Contains($"[{exclude}.")))
throw new Exception($"libSkiaSharp.so contained a dependency on {exclude}.");
}
} }
}); });
@ -107,12 +122,7 @@ Task("libHarfBuzzSharp")
CopyFileToDirectory(so, outDir); CopyFileToDirectory(so, outDir);
CopyFile(so, outDir.CombineWithFilePath("libHarfBuzzSharp.so")); CopyFile(so, outDir.CombineWithFilePath("libHarfBuzzSharp.so"));
foreach (var exclude in VERIFY_EXCLUDED) { CheckDeps(so);
RunProcess("readelf", $"-d {so}", out var stdout);
if (stdout.Any(o => o.Contains($"[{exclude}.")))
throw new Exception($"libHarfBuzzSharp.so contained a dependency on {exclude}.");
}
} }
}); });

Просмотреть файл

@ -24,4 +24,4 @@ jobs:
docker: ${{ item.docker }} docker: ${{ item.docker }}
dockerArgs: ${{ item.dockerArgs }} dockerArgs: ${{ item.dockerArgs }}
target: ${{ coalesce(item.target, 'externals-linux') }} target: ${{ coalesce(item.target, 'externals-linux') }}
additionalArgs: --buildarch=${{ item.arch }} --variant=${{ coalesce(item.variant, 'linux') }}${{ build.name }} ${{ build.additionalArgs }} ${{ item.additionalArgs }} additionalArgs: --buildarch=${{ item.arch }} --variant=${{ coalesce(item.variant, 'linux') }}${{ build.name }} --gnArgs="\"${{ build.gnArgs }} ${{ item.gnArgs }}\"" ${{ build.additionalArgs }} ${{ item.additionalArgs }}