Skip to content
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

fix use_stack documentation #2122

Merged
merged 1 commit into from
Feb 15, 2024
Merged

Conversation

prednaz
Copy link
Member

@prednaz prednaz commented Feb 14, 2024

closes #1759.

Here is a screenshot.
Screenshot 2024-02-14 at 22-43-13 Cabal packages

@prednaz prednaz requested a review from avdv as a code owner February 14, 2024 21:25
@prednaz
Copy link
Member Author

prednaz commented Feb 14, 2024

Notice that I can neither test nor lint my changes locally. Here are the error messages.

[nix-shell:~/tweag/rules_haskell/rules_haskell_tests]$ bazel test //...
INFO: Build option --test_env has changed, discarding analysis cache.
ERROR: /home/rednaz/tweag/rules_haskell/rules_haskell_tests/tests/asterius/binary-dynamic/BUILD.bazel:3:20: While resolving toolchains for target //tests/asterius/binary-dynamic:asterius_test: No matching toolchains found for types @rules_nodejs//nodejs:toolchain_type.
To debug, rerun with --toolchain_resolution_debug='@rules_nodejs//nodejs:toolchain_type'
If platforms or toolchains are a new concept for you, we'd encourage reading https://bazel.build/concepts/platforms-intro.
ERROR: Analysis of target '//tests/asterius/binary-dynamic:asterius_test' failed; build aborted: 
INFO: Elapsed time: 0.267s
INFO: 0 processes.
ERROR: Couldn't start the build. Unable to run tests
FAILED: Build did NOT complete successfully (0 packages loaded, 1557 targets configured)
    Fetching repository @stackage-zlib; starting
    Fetching repository @stackage-exe; Restarting.
    Fetching repository @stackage; Restarting.
    Fetching repository @zlib.dev; Building Nix derivation
    Fetching repository @ghcide-exe; Restarting.
    Fetching repository @ghcide; starting

[nix-shell:~/tweag/rules_haskell/rules_haskell_tests]$ bazel run //buildifier
INFO: Build option --test_env has changed, discarding analysis cache.
INFO: Analyzed target //buildifier:buildifier (0 packages loaded, 11297 targets configured).
INFO: Found 1 target...
ERROR: /home/rednaz/.cache/bazel/_bazel_rednaz/a79edf662739b246c457e3fdb994ba9a/external/go_sdk/BUILD.bazel:51:15: GoToolchainBinaryBuild external/go_sdk/builder [for tool] failed: (Exit 127): bash failed: error executing command (from target @go_sdk//:builder) /nix/store/ydr43fdjbac292zqgimjdksy0sv7dxwm-bash/bin/bash -c ... (remaining 1 argument skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
/nix/store/q1c2flcykgr4wwg5a6h450hxbk4ch589-bash-5.2-p15/bin/bash: line 1: external/go_sdk/bin/go: cannot execute: required file not found
Target //buildifier:buildifier failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.087s, Critical Path: 0.53s
INFO: 9 processes: 9 internal.
FAILED: Build did NOT complete successfully
ERROR: Build failed. Not running target

@prednaz prednaz force-pushed the philipp/use_stack-documentation branch from f2b8d9a to ef1ddd8 Compare February 14, 2024 21:41
Copy link
Member

@ylecornec ylecornec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me 👍

The error messages seem to happen because NixOS requires the --config linux-nixpkgs.
This will set specific flags as defined in the .bazelrc file and in particular, --host_platform=@rules_nixpkgs_core//platforms:host, which means NixOS compatible toolchains will then be selected.

To set this config automatically, you can add the line build --config linux-nixpkgs to a .bazelrc.local file.

(I'm letting you set the merge-queue label to merge the branch).

@prednaz prednaz added the merge-queue merge on green CI label Feb 15, 2024
@mergify mergify bot merged commit d63bfde into master Feb 15, 2024
51 checks passed
@mergify mergify bot deleted the philipp/use_stack-documentation branch February 15, 2024 11:41
@mergify mergify bot removed the merge-queue merge on green CI label Feb 15, 2024
@prednaz
Copy link
Member Author

prednaz commented Feb 15, 2024

@ylecornec I just checked again and I realized that the first part of bazel test //... && cd rules_haskell_tests && bazel test //... does succeed. It is just after cd rules_haskell_tests that bazel test //... does not run anymore.

@ylecornec
Copy link
Member

Ah indeed, I also have various symlinks to the root .bazelrc.local. This is needed since these folders are different bazel workspaces.

./tutorial/.bazelrc.local
./rules_haskell_nix/.bazelrc.local
./rules_haskell_tests/.bazelrc.local
./examples/.bazelrc.local

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

use_stack Stardoc markup is broken
2 participants