feat: add offline Qt6 naming prerequisites and boundary gates
Some checks failed
real-verification / chrome (push) Has been cancelled
real-verification / freecad-oracle (push) Has been cancelled
real-verification / wasm (push) Has been cancelled

This commit is contained in:
2026-08-12 08:17:44 -04:00
parent ca6fe46030
commit 58c0807219
22 changed files with 392 additions and 9 deletions

View File

@@ -0,0 +1,34 @@
#include <emscripten/bind.h>
#include <App/IndexedName.h>
#include <App/MappedName.h>
#include <stdexcept>
#include <string>
namespace
{
std::string freecadPrivateNamingSourceProbe()
{
const Data::IndexedName indexed("Edge12");
if (!indexed || indexed.getIndex() != 12 || std::string(indexed.getType()) != "Edge") {
throw std::runtime_error("FreeCAD IndexedName source probe failed");
}
Data::MappedName name(indexed);
name += ";:M;CUT;:H2a:7,E";
long tag = 0;
int length = 0;
char type = 0;
const int position = name.findTagInElementName(&tag, &length, nullptr, &type);
if (position < 0 || tag != 0x2a || type != 'E') {
throw std::runtime_error("FreeCAD MappedName source probe failed");
}
return name.toString();
}
} // namespace
EMSCRIPTEN_BINDINGS(freecad_private_naming_source_probe)
{
emscripten::function("freecadPrivateNamingSourceProbe", &freecadPrivateNamingSourceProbe);
}

View File

@@ -0,0 +1,27 @@
#pragma once
#define APP_STRING_ID_H
#include <QByteArray>
namespace App
{
class StringIDRef
{
public:
void toBytes(QByteArray& bytes) const
{
bytes.clear();
}
bool operator<(const StringIDRef&) const
{
return false;
}
bool operator==(const StringIDRef&) const
{
return true;
}
};
} // namespace App

View File

@@ -0,0 +1,3 @@
#pragma once
#define FC_LOG_LEVEL_INIT(...)

View File

@@ -0,0 +1,3 @@
#pragma once
#define HAVE_Q_DISABLE_COPY_MOVE

View File

@@ -0,0 +1,16 @@
import createProbe from './dist/freecad-private-naming-source-probe.js'
const probe = await createProbe()
const result = probe.freecadPrivateNamingSourceProbe()
if (result !== 'Edge12;:M;CUT;:H2a:7,E') throw new Error(`Unexpected FreeCAD private naming source probe result: ${result}`)
for (const forbidden of ['freecadNamingAbiVersion', 'freecadNamingCapabilitiesJson', 'freecadNamingEvidenceJson']) {
if (typeof probe[forbidden] === 'function') throw new Error(`Source prerequisite probe must not export production ABI callback ${forbidden}.`)
}
console.log(JSON.stringify({
status: 'source-prerequisite-pass',
freecadVersion: '1.1.1',
sourceCommit: '0108fd4b4850cc46e625b60e53cea7a7bbe69f8d',
linkedSources: ['App/IndexedName.cpp', 'App/MappedName.cpp'],
result,
productionWorkerLinked: false,
}, null, 2))