You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
lukasholzer opened this issue
Aug 12, 2020
· 2 comments
Assignees
Labels
bazelAll issues realted to bazel build systembugA broken behaviour that was working previouslyhas-prP1Urgent issue that should be resolved before the next release
Currently, starting the Bazel server performing an npm install which triggers the postinstall.js script there is an incompatibility for windows so it won't run on windows. This results that currently running any Bazel target on Windows is not possible.
diff --git a/postinstall.js b/postinstall.js
index 26810f5c..132bf5e3 100644
--- a/postinstall.js+++ b/postinstall.js@@ -2,6 +2,7 @@
// migration script for the phase where we support building with bazel
// and without.
const { exec } = require('child_process');
+const { execFile } = require('child_process');
const { resolve } = require('path');
const { sync } = require('glob');
const { writeFileSync, readFileSync } = require('fs');
@@ -20,10 +21,18 @@ async function main() {
// Generate Angular ngfactory.js, ngsummary.js files for the dependencies,
// that are needed for ViewEngine
- await execCommand(`${NGC_BINARY} -p view-engine-tsconfig.json`);+ console.log("DOPS da bin ich");+ await execCommand(`dir view-engine-tsconfig.json`);+ await execCommand(`dir ${NGC_BINARY}`);++ await execFileCommand(NGC_BINARY,["-p","view-engine-tsconfig.json"])+ //await execCommand(`${NGC_BINARY} -p view-engine-tsconfig.json`);
// Generate Ivy entry points
- await execCommand(- `${NGCC_BINARY} --properties es2015 browser module main --first-only --create-ivy-entry-points`,+ //await execCommand(+ // `${NGCC_BINARY} --properties es2015 browser module main --first-only --create-ivy-entry-points`,+ // );+ await execFileCommand(+ NGCC_BINARY,["--properties","es2015","browser","module","main","--first-only","--create-ivy-entry-points"],
);
// link the ivy entry points
updateNgccMainFields();
@@ -33,6 +42,25 @@ async function main() {
}
}
+/**+ * Executes a file and return it as a Promise.+ * @param cmd {string}+ * @return {Promise<string>}+ */+function execFileCommand(_cmd, _args) {+ return new Promise((resolve, reject) => {+ console.log("DOPS " + _cmd + " " + _args);+ execFile(_cmd,_args, {shell: true}, (error, stdout, stderr) => {+ if (error) {+ return reject(error);+ }+ const output = stdout ? stdout : stderr;+ console.log(output);+ resolve(output);+ });+ });+}+
/**
* Executes a shell command and return it as a Promise.
* @param cmd {string}
@@ -40,7 +68,7 @@ async function main() {
*/
function execCommand(cmd) {
return new Promise((resolve, reject) => {
- exec(cmd, (error, stdout, stderr) => {+ exec(cmd, {shell: true}, (error, stdout, stderr) => {
if (error) {
return reject(error);
}
The text was updated successfully, but these errors were encountered:
lukasholzer
added
bug
A broken behaviour that was working previously
P1
Urgent issue that should be resolved before the next release
labels
Aug 12, 2020
Could track down the problem on two smaller problems.
Bazels npm_install rule does not work with using third party npm dependencies inside the postinstall script. (a switch to yarn would work – but this would be a lot of work)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
bazelAll issues realted to bazel build systembugA broken behaviour that was working previouslyhas-prP1Urgent issue that should be resolved before the next release
Bug Report
Currently, starting the Bazel server performing an
npm install
which triggers the postinstall.js script there is an incompatibility for windows so it won't run on windows. This results that currently running any Bazel target on Windows is not possible.The first investigation was done by @andreas-doppelhofer:
The text was updated successfully, but these errors were encountered: