bazel: allow using locally-installed node on freebsd#82762
bazel: allow using locally-installed node on freebsd#82762craig[bot] merged 1 commit intocockroachdb:masterfrom
node on freebsd#82762Conversation
|
@knz Can you try this patch out (work through the new |
66694ec to
822c4dc
Compare
|
thanks for the heads up! here what I get now: So maybe it's able to pick up |
|
(as mentioned in issue #74208 we want all 3 of |
822c4dc to
91d90f5
Compare
|
I made a small change, let me know if the build works with the latest version.
This is not how this is implemented -- the globally installed |
knz
left a comment
There was a problem hiding this comment.
there's progress now!
ERROR: An error occurred during the fetch of repository 'npm_db_console':
Traceback (most recent call last):
File "/data/home/kena/.cache/bazel/_bazel_kena/9b9f53b7334495d6a871cbb472c466bb/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 971, column 32, in _yarn_
install_impl
_apply_post_install_patches(repository_ctx)
File "/data/home/kena/.cache/bazel/_bazel_kena/9b9f53b7334495d6a871cbb472c466bb/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 377, column 19, in _apply
_post_install_patches
_apply_patches(repository_ctx, working_directory, repository_ctx.attr.post_install_patches, marker_file)
File "/data/home/kena/.cache/bazel/_bazel_kena/9b9f53b7334495d6a871cbb472c466bb/external/build_bazel_rules_nodejs/internal/npm_install/npm_install.bzl", line 435, column 21, in _apply
_patches
fail("Error applying patch %s in %s:\n%s%s" % (str(patch_file), working_directory, st.stderr, st.stdout))
Error in fail: Error applying patch //pkg/ui:patches/aria-query/remove-filenames-with-spaces.db-console.patch in /data/home/kena/src/go/src/github.com/cockroachdb/cockroach:
File to patch:
No file found--skip this patch? [y]
1 out of 1 hunks ignored--saving rejects to Oops.rej
...
No file found--skip this patch? [y]
1 out of 1 hunks ignored--saving rejects to Oops.rej
File to patch:
No file found--skip this patch? [y]
1 out of 1 hunks ignored--saving rejects to Oops.rej
ERROR: Analysis of target '//pkg/cmd/cockroach:cockroach' failed; build aborted:
FWIW, I symlinked patch as instructed and patch --version returns 2.7.6.
Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @rickystewart)
|
FYI, by the time this |
|
FYI, I've re-run After it stopped complaining about |
|
@knz That error looks odd to me, can you run with the Bazel flag |
|
I get the following |
91d90f5 to
7b78286
Compare
|
I think I know what that is, try the latest version please? |
|
NVM I had to discard the analysis cache. Here you are: https://gist.github.com/knz/fa9f9e648fb79577aba54995f0c5365e |
knz
left a comment
There was a problem hiding this comment.
With the latest change, there's progress!
Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @rickystewart)
|
okay but there's something not clean yet: If I run I have to run then at the 3rd time it's able to make progress and finish the build. |
|
@knz Not sure what's going on with that, I'll pull Sean into the discussion in Slack. |
|
I'm going to apply Sean's suggestion:
|
|
I did this:
as a result I observe once: but then if I run (For certainty, I have run |
|
I have another idea. lemme try this too |
7b78286 to
d6ee310
Compare
knz
left a comment
There was a problem hiding this comment.
I have used the following command in the script instead:
find $moduleDir/node_modules/aria-query -name '* *' -delete || true
This improves the situation, but not yet 100%. I then get the follwoing error (still, only once - the 2nd time there's no error and the command succeeds)
ERROR: /data/home/kena/.cache/bazel/_bazel_kena/9b9f53b7334495d6a871cbb472c466bb/external/npm_cluster_ui/BUILD.bazel:9789:10: Copying directory external/npm_cluster_ui/_/pkg/ui/workspaces/cluster-ui/node_modules/enquire.js failed: missing input file 'external/npm_cluster_ui/_/pkg/ui/workspaces/cluster-ui/node_modules/enquire.js', owner: '@npm_cluster_ui//:_/pkg/ui/workspaces/cluster-ui/node_modules/enquire.js'
ERROR: /data/home/kena/.cache/bazel/_bazel_kena/9b9f53b7334495d6a871cbb472c466bb/external/npm_cluster_ui/BUILD.bazel:9789:10: Copying directory external/npm_cluster_ui/_/pkg/ui/workspaces/cluster-ui/node_modules/enquire.js failed: 1 input file(s) do not exist
ERROR: /data/home/kena/.cache/bazel/_bazel_kena/9b9f53b7334495d6a871cbb472c466bb/external/npm_cluster_ui/BUILD.bazel:16765:10: Copying directory external/npm_cluster_ui/_/pkg/ui/workspaces/cluster-ui/node_modules/omit.js failed: missing input file 'external/npm_cluster_ui/_/pkg/ui/workspaces/cluster-ui/node_modules/omit.js', owner: '@npm_cluster_ui//:_/pkg/ui/workspaces/cluster-ui/node_modules/omit.js'
Target //pkg/cmd/cockroach:cockroach failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /data/home/kena/.cache/bazel/_bazel_kena/9b9f53b7334495d6a871cbb472c466bb/external/npm_cluster_ui/BUILD.bazel:9789:10 Copying directory external/npm_cluster_ui/_/pkg/ui/workspaces/cluster-ui/node_modules/enquire.js failed: 1 input file(s) do not exist
INFO: Elapsed time: 59.211s, Critical Path: 0.07s
INFO: 110 processes: 30 internal, 80 local.
FAILED: Build did NOT complete successfully
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @rickystewart)
knz
left a comment
There was a problem hiding this comment.
based on the convo with @sjbarag the remaining issue is not related to this fix. So the PR as is is very much acceptable as a solution to the original issue. Thanks!
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @rickystewart)
* Pull in a patch to [rules_nodejs](cockroachdb/rules_nodejs@59a92cc) to support FreeBSD. * Add a new `toolchain` pointing to the locally-installed `node` which is compatible with FreeBSD. Closes cockroachdb#74208. Release note: None
|
I'll gladly be using this piece of functionality today, so going ahead and merging this. Thanks again bors r+ |
|
Build succeeded: |
It is possible to use `rules_nodejs` on operating systems besides Windows, Linux, and macOS, but they need to be handled in `os_name()` or else you get a `Unsupported operating system freebsd` error message. This change allows you to add a FreeBSD toolchain to your project by declaring a `nodejs_freebsd_amd64` repo with a `bin/node` executable. cockroachdb/cockroach#82762 is an example of this.
It is possible to use `rules_nodejs` on operating systems besides Windows, Linux, and macOS, but they need to be handled in `os_name()` or else you get a `Unsupported operating system freebsd` error message. This change allows you to add a FreeBSD toolchain to your project by declaring a `nodejs_freebsd_amd64` repo with a `bin/node` executable. cockroachdb/cockroach#82762 is an example of this.


toolchainpointing to the locally-installednodewhichis compatible with FreeBSD.
Closes #74208.
Release note: None