crossbind 2.0.0-beta.52 → 2.0.0-beta.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/actions/buildLib.js +8 -1
- package/src/utils/sourceFingerprint.js +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# crossbind
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.53
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The rebuild the source stamp triggers now clears the previous upstream release's configure
|
|
8
|
+
output and staged install tree first. Without that, an install step fails where it cannot
|
|
9
|
+
overwrite a file it did not create, which is what stopped the beta.52 publish partway.
|
|
10
|
+
|
|
3
11
|
## 2.0.0-beta.52
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/package.json
CHANGED
package/src/actions/buildLib.js
CHANGED
|
@@ -6,7 +6,7 @@ import { getBuildTargets, getFilteredTargetSpec } from './target.js';
|
|
|
6
6
|
import state from '../state/index.js';
|
|
7
7
|
import logger from '../utils/logger.js';
|
|
8
8
|
import findFiles from '../utils/findFiles.js';
|
|
9
|
-
import { getSourceFingerprint, isSourceFingerprintStale, writeSourceFingerprint } from '../utils/sourceFingerprint.js';
|
|
9
|
+
import { getSourceFingerprint, isSourceFingerprintStale, staleTargetDirectories, writeSourceFingerprint } from '../utils/sourceFingerprint.js';
|
|
10
10
|
|
|
11
11
|
export default function buildLib(targetParams, options = {}) {
|
|
12
12
|
let isChanged = false;
|
|
@@ -24,6 +24,13 @@ export default function buildLib(targetParams, options = {}) {
|
|
|
24
24
|
const sourceFingerprint = getSourceFingerprint(state.config);
|
|
25
25
|
const sourceChanged = isSourceFingerprintStale(libdir, sourceFingerprint);
|
|
26
26
|
if (isCargo || sourceChanged || !fs.existsSync(`${libdir}/lib`)) {
|
|
27
|
+
if (sourceChanged) {
|
|
28
|
+
for (const stale of staleTargetDirectories({
|
|
29
|
+
buildPath: state.config.paths.build,
|
|
30
|
+
outputPath: state.config.paths.output,
|
|
31
|
+
targetPath: target.path,
|
|
32
|
+
})) fs.rmSync(stale, { recursive: true, force: true });
|
|
33
|
+
}
|
|
27
34
|
// createLib caches on existence too, so re-entering is not enough: a stale stamp means
|
|
28
35
|
// the lib on disk came from a different upstream release and has to be rebuilt.
|
|
29
36
|
createLib(target, 'Source', { buildSource: true, force: sourceChanged });
|
|
@@ -25,3 +25,16 @@ export function writeSourceFingerprint(libdir, fingerprint) {
|
|
|
25
25
|
fs.mkdirSync(libdir, { recursive: true });
|
|
26
26
|
fs.writeFileSync(`${libdir}/${SOURCE_FINGERPRINT_FILE}`, fingerprint);
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
// A changed upstream release leaves the previous configure output and install tree behind. Reusing
|
|
30
|
+
// them makes `make install` fail where it cannot chmod a file it did not create, and would leave
|
|
31
|
+
// files of the old version in the output next to the new ones.
|
|
32
|
+
export function staleTargetDirectories({ buildPath, outputPath, targetPath }) {
|
|
33
|
+
return [
|
|
34
|
+
`${buildPath}/Source-Release/${targetPath}`,
|
|
35
|
+
`${buildPath}/Source-Release/prebuilt/${targetPath}`,
|
|
36
|
+
`${buildPath}/Source-Debug/${targetPath}`,
|
|
37
|
+
`${buildPath}/Source-Debug/prebuilt/${targetPath}`,
|
|
38
|
+
`${outputPath}/prebuilt/${targetPath}`,
|
|
39
|
+
];
|
|
40
|
+
}
|