diff --git a/.yarn/releases/yarn-1.22.15.cjs b/.yarn/releases/yarn-1.22.15.cjs index e520b2dc986..9d72e21141b 100755 --- a/.yarn/releases/yarn-1.22.15.cjs +++ b/.yarn/releases/yarn-1.22.15.cjs @@ -1,4 +1,7 @@ #!/usr/bin/env node +if (process.env.CXXFLAGS === undefined) { + process.env.CXXFLAGS = '-std=c++14'; +} module.exports = /******/ (function(modules) { // webpackBootstrap /******/ // The module cache @@ -147519,4 +147522,4 @@ module.exports = require("dns"); module.exports = require("domain"); /***/ }) -/******/ ]); \ No newline at end of file +/******/ ]); diff --git a/MAINTAINERS.md b/MAINTAINERS.md index 5d71fd8196f..a27bc954161 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -30,7 +30,8 @@ Once tests pass, you can publish to NPM with the following: ```sh # Publish to NPM. NOTE: You may have to repeat this several times if there are failures. -yarn lerna publish from-package +# Specify the --dist-tag if you're publishing a new beta release. +yarn lerna publish from-package # --dist-tag=beta ``` Merge the release PR into master. DO NOT REBASE OR SQUASH OR YOU WILL LOSE diff --git a/docs/env.md b/docs/env.md index 621b39bb49e..6f4f4350218 100644 --- a/docs/env.md +++ b/docs/env.md @@ -34,6 +34,17 @@ declarations. Lifetime: until all sources (including dapps) conform to using `Far` declarations for all remote objects +## CXXFLAGS + +Affects: yarn, agoric install + +Purpose: add compilation flags to Node.js C++ addons + +Description: defaults to `-std=c++14` if not set (empty string doesn't default) + +Lifetime: probably forever (until all supported Node versions work with +`CXXFLAGS=''`) + ## DEBUG Affects: agoric (CLI), ag-chain-cosmos, ag-solo diff --git a/packages/agoric-cli/src/install.js b/packages/agoric-cli/src/install.js index aa25ead7872..610540f87aa 100644 --- a/packages/agoric-cli/src/install.js +++ b/packages/agoric-cli/src/install.js @@ -10,9 +10,16 @@ export default async function installMain(progname, rawArgs, powers, opts) { const { anylogger, fs, spawn } = powers; const log = anylogger('agoric:install'); + const forceSdkVersion = rawArgs[1]; + // Notify the preinstall guard that we are running. process.env.AGORIC_INSTALL = 'true'; + // Node 16 requires this to be set for C++ addons to compile. + if (process.env.CXXFLAGS === undefined) { + process.env.CXXFLAGS = '-std=c++14'; + } + const pspawn = makePspawn({ log, spawn, chalk }); const rimraf = file => pspawn('rm', ['-rf', file]); @@ -33,13 +40,15 @@ export default async function installMain(progname, rawArgs, powers, opts) { } let subdirs; + let sdkWorktree; const dappPackageJSON = await fs .readFile(`package.json`, 'utf-8') .then(data => JSON.parse(data)) .catch(err => log('error reading', `package.json`, err)); if (dappPackageJSON.useWorkspaces) { - subdirs = await workspaceDirectories(); - subdirs.unshift('.'); + const workdirs = await workspaceDirectories(); + sdkWorktree = workdirs.find(subd => subd === 'agoric-sdk'); + subdirs = ['.', ...workdirs.filter(subd => subd !== 'agoric-sdk')]; } else { const existingSubdirs = await Promise.all( ['.', '_agstate/agoric-servers', 'contract', 'api', 'ui'] @@ -91,6 +100,12 @@ export default async function installMain(progname, rawArgs, powers, opts) { }), ); + // Link the SDK. + if (sdkWorktree) { + await fs.unlink(sdkWorktree).catch(_ => {}); + await fs.symlink(sdkRoot, sdkWorktree); + } + await Promise.all( subdirs.map(async subdir => { const nm = `${subdir}/node_modules`; @@ -106,7 +121,12 @@ export default async function installMain(progname, rawArgs, powers, opts) { ), ); - // Mark all the SDK package dependencies as wildcards. + if (forceSdkVersion === undefined) { + // No need to change package.json. + return; + } + + // Modify all the SDK package versions. const pjson = `${subdir}/package.json`; const packageJSON = await fs .readFile(pjson, 'utf-8') @@ -120,7 +140,7 @@ export default async function installMain(progname, rawArgs, powers, opts) { if (deps) { for (const pkg of Object.keys(deps)) { if (versions.has(pkg)) { - deps[pkg] = `*`; + deps[pkg] = forceSdkVersion; } } } @@ -151,6 +171,10 @@ export default async function installMain(progname, rawArgs, powers, opts) { return 1; } + if (sdkWorktree) { + return 0; + } + if (opts.sdk) { await Promise.all( dirPackages.map(async ([dir, pjName]) => { diff --git a/packages/agoric-cli/src/main.js b/packages/agoric-cli/src/main.js index 2b7b975a940..df92019ff58 100644 --- a/packages/agoric-cli/src/main.js +++ b/packages/agoric-cli/src/main.js @@ -156,12 +156,12 @@ const main = async (progname, rawArgs, powers) => { }); program - .command('install') + .command('install [force-sdk-version]') .description('install Dapp dependencies') - .action(async cmd => { + .action(async (forceSdkVersion, cmd) => { await isNotBasedir(); const opts = { ...program.opts(), ...cmd.opts() }; - return subMain(installMain, ['install'], opts); + return subMain(installMain, ['install', forceSdkVersion], opts); }); program diff --git a/packages/dapp-svelte-wallet/api/package.json b/packages/dapp-svelte-wallet/api/package.json index 6f1ac879148..af60ea9e0c3 100644 --- a/packages/dapp-svelte-wallet/api/package.json +++ b/packages/dapp-svelte-wallet/api/package.json @@ -57,5 +57,8 @@ "test/**/test-*.js" ], "timeout": "2m" + }, + "publishConfig": { + "access": "public" } }