Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions build-scripts/build-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
*
* For pull requests and pushes to master, the compiler submodule is expected to be pointed at the tagged commit
* that matches the package major version.
*
* When the COMPILER_NIGHTLY env variable is set, the compiler submodule will be pointing to the latest master
* commit. This is for regular integration testing of the compiler with the various tests in this repo's packages.
* In this case the compiler will be built as a SNAPSHOT.
*/
import fs from 'node:fs';
import path from 'node:path';
Expand All @@ -43,16 +39,12 @@ const packageInfo = JSON.parse(fs.readFileSync(path.resolve(__dirname, '../packa
* The compiler version that will be built.
*
* For release builds, this is of the form: "vYYYYMMDD"
* For nightly builds, this is "1.0-SNAPSHOT"
*
* @type {string}
*/
const compilerVersion = process.env.COMPILER_NIGHTLY === 'true'
? 'SNAPSHOT-1.0'
: `v${semver.major(packageInfo.version)}`;
const compilerVersion = `v${semver.major(packageInfo.version)}`;

const compilerTargetName = compilerVersion === 'SNAPSHOT-1.0' || parseInt(compilerVersion.slice(1), 10) > 20221004 ?
'compiler_uberjar_deploy.jar' : 'compiler_unshaded_deploy.jar';
const compilerTargetName = 'compiler_uberjar_deploy.jar';
const compilerJavaBinaryPath = `./compiler/bazel-bin/${compilerTargetName}`;

async function main() {
Expand Down
51 changes: 0 additions & 51 deletions build-scripts/create-nightly-version.js

This file was deleted.

4 changes: 0 additions & 4 deletions build-scripts/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import runCommand from './run-command.js';

const __dirname = fileURLToPath(new URL('.', import.meta.url));
const packagesDirPath = path.resolve(__dirname, '../packages');
const isNightlyVersion = process.env.COMPILER_NIGHTLY === 'true';

async function isPackageVersionPublished(packageName, version) {
return fetch(`https://registry.npmjs.org/${encodeURI(packageName)}/${version}`)
Expand Down Expand Up @@ -64,9 +63,6 @@ async function publishPackagesIfNeeded(packageInfo) {
}
console.log('Publishing', pkgJson.name, pkgJson.version);
const publishArgs = ['-w', pkgJson.name, 'publish'];
if (isNightlyVersion) {
publishArgs.push('--tag', 'nightly');
}
await runCommand('npm', publishArgs);
}

Expand Down
106 changes: 51 additions & 55 deletions test/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,71 +34,67 @@ const compilerVersionMatch = /^Version: v(\d+)$/m;

process.on('unhandledRejection', (e) => { throw e; });

const isNightlyBuild = /^true|1$/i.test(process.env.COMPILER_NIGHTLY);
describe('compiler.jar', function () {
it('should not be a snapshot build', async () => {
const compiler = new Compiler({version: true});
const {stdout} = await new Promise((resolve) =>
compiler.run((exitCode, stdout, stderr) =>
resolve({
exitCode,
stdout,
stderr,
})
)
);
let versionInfo = (stdout || '').match(compilerVersionMatch);
expect(versionInfo).not.toBeNullish();
versionInfo = versionInfo || [];
expect(versionInfo.length).toBe(2);
expect(versionInfo[1].indexOf('SNAPSHOT')).toBeLessThan(0);
});

if (!isNightlyBuild) {
describe('compiler.jar', function () {
it('should not be a snapshot build', async () => {
const compiler = new Compiler({version: true});
const {stdout} = await new Promise((resolve) =>
it('version should be equal to the package major version', async () => {
const compiler = new Compiler({version: true});
const packageVer = new Semver(packageInfo.version);
const {stdout} = await new Promise((resolve) =>
compiler.run((exitCode, stdout, stderr) =>
resolve({
exitCode,
stdout,
stderr,
})
)
);
let versionInfo = (stdout || '').match(compilerVersionMatch);
expect(versionInfo).not.toBeNullish();
versionInfo = versionInfo || [];
expect(versionInfo.length).toBe(2);
expect(versionInfo[1].indexOf('SNAPSHOT')).toBeLessThan(0);
});
);
let versionInfo = (stdout || '').match(compilerVersionMatch);
expect(versionInfo).not.toBeNullish();
versionInfo = versionInfo || [];
expect(versionInfo.length).toBe(2);

it('version should be equal to the package major version', async () => {
const compiler = new Compiler({version: true});
const packageVer = new Semver(packageInfo.version);
const {stdout} = await new Promise((resolve) =>
compiler.run((exitCode, stdout, stderr) =>
resolve({
exitCode,
stdout,
stderr,
})
)
);
let versionInfo = (stdout || '').match(compilerVersionMatch);
expect(versionInfo).not.toBeNullish();
versionInfo = versionInfo || [];
expect(versionInfo.length).toBe(2);

let compilerVersion;
try {
console.log(versionInfo[1] + '.0.0');
compilerVersion = new Semver(versionInfo[1] + '.0.0');
} catch (e) {
fail('should be a semver parseable');
}
expect(compilerVersion.major).toBe(packageVer.major);
});
let compilerVersion;
try {
console.log(versionInfo[1] + '.0.0');
compilerVersion = new Semver(versionInfo[1] + '.0.0');
} catch (e) {
fail('should be a semver parseable');
}
expect(compilerVersion.major).toBe(packageVer.major);
});
});

describe('compiler submodule', () => {
it('should be synced to the tagged commit', () => {
const gitCmd = spawn('git', ['tag', '--points-at', 'HEAD'], {
cwd: './compiler'
});
expect(gitCmd.status).toBe(0);
console.log(gitCmd.stdout.toString());
const currentTag = gitCmd.stdout.toString().replace(/\s/g, '');
const packageVer = new Semver(packageInfo.version);
const mvnVersion = 'v' + packageVer.major;
let normalizedTag = currentTag;
if (normalizedTag) {
normalizedTag = currentTag.replace(/^([-a-z]+-)?(v\d{8})(.*)$/, '$2');
}
expect(normalizedTag).toBe(mvnVersion)
describe('compiler submodule', () => {
it('should be synced to the tagged commit', () => {
const gitCmd = spawn('git', ['tag', '--points-at', 'HEAD'], {
cwd: './compiler'
});
expect(gitCmd.status).toBe(0);
console.log(gitCmd.stdout.toString());
const currentTag = gitCmd.stdout.toString().replace(/\s/g, '');
const packageVer = new Semver(packageInfo.version);
const mvnVersion = 'v' + packageVer.major;
let normalizedTag = currentTag;
if (normalizedTag) {
normalizedTag = currentTag.replace(/^([-a-z]+-)?(v\d{8})(.*)$/, '$2');
}
expect(normalizedTag).toBe(mvnVersion)
});
}
});
Loading