-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade rules-nodes to version 3.5.0 #9635
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7d5395c
Upgrade rules-nodes to version 3.4.2
cocreature 71c2eec
Patch Windows
cocreature 25bd1cb
.
cocreature 9998dc2
.
cocreature 5788e2a
.
cocreature 1a989cd
.
cocreature 4d51b64
.
cocreature 5b1931c
.
cocreature 7e3e266
.
cocreature ff3cdc3
.
cocreature File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
diff --git a/internal/npm_install/npm_install.bzl b/internal/npm_install/npm_install.bzl | ||
index 3c07b3a0..a7b77d9a 100644 | ||
--- a/internal/npm_install/npm_install.bzl | ||
+++ b/internal/npm_install/npm_install.bzl | ||
@@ -335,8 +335,9 @@ def _copy_file(repository_ctx, f): | ||
to_segments = to.split("/") | ||
if len(to_segments) > 1: | ||
dirname = "/".join(to_segments[:-1]) | ||
+ args = ["mkdir", "-p", dirname] if not is_windows_os(repository_ctx) else ["cmd", "/c", "if not exist {dir} mkdir {dir}".format(dir = dirname)] | ||
result = repository_ctx.execute( | ||
- ["mkdir", "-p", dirname], | ||
+ args, | ||
quiet = repository_ctx.attr.quiet, | ||
) | ||
if result.return_code: | ||
@@ -344,12 +345,13 @@ def _copy_file(repository_ctx, f): | ||
|
||
# copy the file; don't use the repository_ctx.template trick with empty substitution as this | ||
# does not copy over binary files properly | ||
+ cp_args = ["cp", "-f", repository_ctx.path(f), to] if not is_windows_os(repository_ctx) else ["cmd", "/c", "copy /y {} {}".format("\\".join(str(repository_ctx.path(f)).split("/")), "\\".join(to_segments))] | ||
result = repository_ctx.execute( | ||
- ["cp", "-f", repository_ctx.path(f), to], | ||
+ cp_args, | ||
quiet = repository_ctx.attr.quiet, | ||
) | ||
if result.return_code: | ||
- fail("cp -f %s %s failed: \nSTDOUT:\n%s\nSTDERR:\n%s" % (repository_ctx.path(f), to, result.stdout, result.stderr)) | ||
+ fail("cp -f {} {} failed: \nSTDOUT:\n{}\nSTDERR:\n{}, {}".format(repository_ctx.path(f), to, result.stdout, result.stderr, cp_args)) | ||
|
||
def _symlink_file(repository_ctx, f): | ||
repository_ctx.symlink(f, _workspace_root_path(repository_ctx, f)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,202 +40,7 @@ genrule( | |
], | ||
) + [ | ||
# we need to list all the transitive dependencies here because of https://github.com/bazelbuild/rules_nodejs/issues/1553 | ||
"@npm//acorn", | ||
"@npm//acorn-node", | ||
"@npm//acorn-walk", | ||
"@npm//ansi-regex", | ||
"@npm//ansi-styles", | ||
"@npm//anymatch", | ||
"@npm//assert", | ||
"@npm//async", | ||
"@npm//async-each", | ||
"@npm//balanced-match", | ||
"@npm//basic-auth", | ||
"@npm//batch", | ||
"@npm//binary-extensions", | ||
"@npm//body", | ||
"@npm//brace-expansion", | ||
"@npm//browserify", | ||
"@npm//browserify-cache-api", | ||
"@npm//browserify-incremental", | ||
"@npm//browserify-zlib", | ||
"@npm//browser-pack", | ||
"@npm//browser-resolve", | ||
"@npm//buffer", | ||
"@npm//buffer-from", | ||
"@npm//bytes", | ||
"@npm//cached-path-relative", | ||
"@npm//chalk", | ||
"@npm//chokidar", | ||
"@npm//coffeescript", | ||
"@npm//color-convert", | ||
"@npm//colors", | ||
"@npm//combine-source-map", | ||
"@npm//concat-map", | ||
"@npm//concat-stream", | ||
"@npm//connect", | ||
"@npm//connect-livereload", | ||
"@npm//console-browserify", | ||
"@npm//constants-browserify", | ||
"@npm//continuable-cache", | ||
"@npm//convert-source-map", | ||
"@npm//core-util-is", | ||
"@npm//cross-spawn", | ||
"@npm//crypto-browserify", | ||
"@npm//dargs", | ||
"@npm//dash-ast", | ||
"@npm//dateformat", | ||
"@npm//defined", | ||
"@npm//depd", | ||
"@npm//deps-sort", | ||
"@npm//destroy", | ||
"@npm//detective", | ||
"@npm//domain-browser", | ||
"@npm//duplexer", | ||
"@npm//duplexer2", | ||
"@npm//ee-first", | ||
"@npm//encodeurl", | ||
"@npm//error", | ||
"@npm//escape-html", | ||
"@npm//escape-string-regexp", | ||
"@npm//etag", | ||
"@npm//eventemitter2", | ||
"@npm//events", | ||
"@npm//exit", | ||
"@npm//fast-safe-stringify", | ||
"@npm//faye-websocket", | ||
"@npm//figures", | ||
"@npm//file-sync-cmp", | ||
"@npm//finalhandler", | ||
"@npm//findup-sync", | ||
"@npm//fresh", | ||
"@npm//fs.realpath", | ||
"@npm//function-bind", | ||
"@npm//gaze", | ||
"@npm//get-assigned-identifiers", | ||
"@npm//getobject", | ||
"@npm//glob", | ||
"@npm//glob-parent", | ||
"@npm//globule", | ||
"@npm//graceful-fs", | ||
"@npm//grunt", | ||
"@npm//grunt-banner", | ||
"@npm//grunt-browserify", | ||
"@npm//grunt-contrib-clean", | ||
"@npm//grunt-contrib-connect", | ||
"@npm//grunt-contrib-copy", | ||
"@npm//grunt-contrib-sass", | ||
"@npm//grunt-contrib-uglify", | ||
"@npm//grunt-contrib-watch", | ||
"@npm//grunt-exec", | ||
"@npm//grunt-legacy-log", | ||
"@npm//grunt-legacy-log-utils", | ||
"@npm//grunt-legacy-util", | ||
"@npm//grunt-open", | ||
"@npm//gzip-size", | ||
"@npm//has", | ||
"@npm//has-ansi", | ||
"@npm//has-flag", | ||
"@npm//hooker", | ||
"@npm//htmlescape", | ||
"@npm//http-errors", | ||
"@npm//http-parser-js", | ||
"@npm//https-browserify", | ||
"@npm//iconv-lite", | ||
"@npm//inflight", | ||
"@npm//inherits", | ||
"@npm//inline-source-map", | ||
"@npm//insert-module-globals", | ||
"@npm//is-binary-path", | ||
"@npm//is-number-like", | ||
"@npm//is-wsl", | ||
"@npm//jsonparse", | ||
"@npm//json-stable-stringify", | ||
"@npm//JSONStream", | ||
"@npm//js-yaml", | ||
"@npm//labeled-stream-splicer", | ||
"@npm//lodash", | ||
"@npm//lodash.isfinite", | ||
"@npm//lodash.memoize", | ||
"@npm//lru-cache", | ||
"@npm//matchdep", | ||
"@npm//maxmin", | ||
"@npm//mime-db", | ||
"@npm//mime-types", | ||
"@npm//minimatch", | ||
"@npm//mkdirp", | ||
"@npm//module-deps", | ||
"@npm//morgan", | ||
"@npm//node-http2", | ||
"@npm//nopt", | ||
"@npm//normalize-path", | ||
"@npm//number-is-nan", | ||
"@npm//object-assign", | ||
"@npm//once", | ||
"@npm//on-finished", | ||
"@npm//on-headers", | ||
"@npm//opn", | ||
"@npm//os-browserify", | ||
"@npm//parents", | ||
"@npm//parseurl", | ||
"@npm//path-browserify", | ||
"@npm//path-dirname", | ||
"@npm//path-is-absolute", | ||
"@npm//path-platform", | ||
"@npm//portscanner", | ||
"@npm//pretty-bytes", | ||
"@npm//process", | ||
"@npm//process-nextick-args", | ||
"@npm//punycode", | ||
"@npm//querystring-es3", | ||
"@npm//raw-body", | ||
"@npm//readable-stream", | ||
"@npm//readdirp", | ||
"@npm//read-only-stream", | ||
"@npm//remove-trailing-separator", | ||
"@npm//rimraf", | ||
"@npm//safe-buffer", | ||
"@npm//safe-json-parse", | ||
"@npm//safer-buffer", | ||
"@npm//send", | ||
"@npm//serve-index", | ||
"@npm//serve-static", | ||
"@npm//setprototypeof", | ||
"@npm//shasum", | ||
"@npm//shasum-object", | ||
"@npm//sprintf-js", | ||
"@npm//statuses", | ||
"@npm//stream-browserify", | ||
"@npm//stream-combiner2", | ||
"@npm//stream-http", | ||
"@npm//stream-splicer", | ||
"@npm//string_decoder", | ||
"@npm//string-template", | ||
"@npm//strip-ansi", | ||
"@npm//supports-color", | ||
"@npm//syntax-error", | ||
"@npm//through", | ||
"@npm//through2", | ||
"@npm//timers-browserify", | ||
"@npm//tiny-lr", | ||
"@npm//tty-browserify", | ||
"@npm//uglify-js", | ||
"@npm//umd", | ||
"@npm//undeclared-identifiers", | ||
"@npm//underscore.string", | ||
"@npm//unpipe", | ||
"@npm//upath", | ||
"@npm//uri-path", | ||
"@npm//url", | ||
"@npm//util", | ||
"@npm//util-deprecate", | ||
"@npm//utils-merge", | ||
"@npm//vm-browserify", | ||
"@npm//watchify", | ||
"@npm//websocket-driver", | ||
"@npm//websocket-extensions", | ||
"@npm//wrappy", | ||
"@npm//xtend", | ||
"@npm//:node_modules", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Visibility seems to have changed in such a way that only direct dependencies are visible. Listing everything in |
||
], | ||
outs = ["da_theme.tar.gz"], | ||
cmd = """ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aherrmann-da do you have a better idea for handling this?
ctx.file
doesn’t work since you either mess up executable bits or break binary files. Justcp
doesn’t work because it might not be in PATH and this is a repository rule so we cannot get it from the posix toolchain. Justcmd /c copy
does not work because it does not like forward slashes.So in the end I ended up with this but it seems terrible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, I don't really have a better idea. As you describe all these other methods have their respective limitations.
Perhaps
string.replace
is also a bit less noisy than the split/join, but, I have no strong preference there.