Bug 1497914 - Add a platform-specific piece into the symbol hash from generated files. r=mccr8

--HG--
extra : rebase_source : ca626a5357fb29a220f6c4e1cc3ee600b651eeec
This commit is contained in:
Kartikaya Gupta 2018-10-11 10:01:31 -04:00
Родитель 0f211616dc
Коммит 5f7bc9a6a0
2 изменённых файлов: 13 добавлений и 0 удалений

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

@ -96,6 +96,7 @@ struct FileInfo {
// We use the escape character to indicate the objdir nature.
// Note that output also has the `/' already placed
Interesting = true;
Generated = true;
Realname.replace(0, Objdir.length(), GENERATED);
return;
}
@ -105,6 +106,7 @@ struct FileInfo {
// Srcdir or anything outside Srcdir.
Interesting = (Rname.length() > Srcdir.length()) &&
(Rname.compare(0, Srcdir.length(), Srcdir) == 0);
Generated = false;
if (Interesting) {
// Remove the trailing `/' as well.
Realname.erase(0, Srcdir.length() + 1);
@ -113,6 +115,7 @@ struct FileInfo {
std::string Realname;
std::vector<std::string> Output;
bool Interesting;
bool Generated;
};
class IndexConsumer;
@ -330,6 +333,14 @@ private:
if (Filename.length() == 0 && Backup.length() != 0) {
return Backup;
}
if (F->Generated) {
// Since generated files may be different on different platforms,
// we need to include a platform-specific thing in the hash. Otherwise
// we can end up with hash collisions where different symbols from
// different platforms map to the same thing.
char* Platform = getenv("MOZSEARCH_PLATFORM");
Filename = std::string(Platform ? Platform : "") + std::string("@") + Filename;
}
return hash(Filename + std::string("@") + locationToString(Loc));
}

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

@ -36,6 +36,7 @@ jobs:
env:
PERFHERDER_EXTRA_OPTIONS: searchfox
RUSTC_BOOTSTRAP: "1"
MOZSEARCH_PLATFORM: "linux"
run:
using: mozharness
actions: [build]
@ -64,6 +65,7 @@ jobs:
TOOLTOOL_MANIFEST: "browser/config/tooltool-manifests/macosx64/cross-releng.manifest"
PERFHERDER_EXTRA_OPTIONS: searchfox
RUSTC_BOOTSTRAP: "1"
MOZSEARCH_PLATFORM: "macosx"
run:
using: mozharness
actions: [get-secrets build]