Skip to content

Commit

Permalink
Remove other references to BAZEL_USE_CPP_ONLY_TOOLCHAIN.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrindel committed Jan 8, 2024
1 parent cd1a621 commit 96dd564
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 29 deletions.
3 changes: 0 additions & 3 deletions .bcr/rules_haskell/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
environment:
BAZEL_USE_CPP_ONLY_TOOLCHAIN: '1'
shell_commands:
- |
if apt --version >/dev/null 2>/dev/null; then
Expand All @@ -22,7 +20,6 @@ tasks:
batch_commands:
# enforce certificate update
- 'powershell -Command "Invoke-WebRequest -Uri https://hackage.haskell.org/root.json -OutFile out.json"'
- set BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
build_flags:
- '--incompatible_enable_cc_toolchain_resolution'
build_targets:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/patch-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ jobs:
shell: bash
run: |
export PATH=$HOME/bazel:$PATH
[[ ${{ runner.os }} == macOS ]] && export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
export GHC_VERSION=${{ matrix.ghc-version }}
cd rules_haskell_tests
./tests/run-start-script.sh --use-bindists
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ If you are on NixOS, this is the only way to set up your project,
because the GHC toolchain provisioned through binary distributions
cannot be executed on NixOS.

If you are on macOS, you will have to set the environment variable
`BAZEL_USE_CPP_ONLY_TOOLCHAIN = 1`, so that Bazel picks the correct C compiler.

[bazel-cli-commands]: https://docs.bazel.build/versions/master/command-line-reference.html#commands
[nixpkgs]: https://nixos.org/nixpkgs/

Expand Down Expand Up @@ -227,14 +224,6 @@ en_US.utf8
POSIX
```

### MacOS: Error: DEVELOPER_DIR not set.

Make sure to set the following environment variable:
```
export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1
```
This ensures that Bazel picks the correct C compiler.

### Windows: Incorrect `cc_toolchain` used

If you're using Windows, bazel might use a different `cc_toolchain`
Expand Down
5 changes: 0 additions & 5 deletions rules_haskell_tests/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

with pkgs;
mkShell {
# XXX: hack for macosX, this flags disable bazel usage of xcode
# Note: this is set even for linux so any regression introduced by this flag
# will be catched earlier
# See: https://github.com/bazelbuild/bazel/issues/4231
BAZEL_USE_CPP_ONLY_TOOLCHAIN = 1;
TMPDIR = "/tmp";

GHC_VERSION = ghcVersion;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load(":haskell_bazel_integration_test.bzl", "haskell_bazel_integration_test")
load("@os_info//:os_info.bzl", "is_nix_shell", "is_windows")
load(
"@rules_bazel_integration_test//bazel_integration_test:defs.bzl",
"integration_test_utils",
Expand All @@ -9,7 +9,7 @@ load(
"SUPPORTED_NIXPKGS_BAZEL_PACKAGES",
)
load("//tests/integration_testing:dependencies.bzl", "nixpkgs_bazel_label")
load("@os_info//:os_info.bzl", "is_nix_shell", "is_windows")
load(":haskell_bazel_integration_test.bzl", "haskell_bazel_integration_test")

def rules_haskell_integration_test(
name,
Expand Down Expand Up @@ -43,7 +43,6 @@ def rules_haskell_integration_test(
"//tests:nix": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
additional_env_inherit = ["BAZEL_USE_CPP_ONLY_TOOLCHAIN"],
**kwargs
)
elif not is_windows:
Expand All @@ -58,6 +57,5 @@ def rules_haskell_integration_test(
"//tests:nix": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
additional_env_inherit = ["BAZEL_USE_CPP_ONLY_TOOLCHAIN"],
**kwargs
)
5 changes: 0 additions & 5 deletions shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ let
writeScriptBin "security" ''exec /usr/bin/security "$@"'';
in
mkShell {
# XXX: hack for macosX, this flags disable bazel usage of xcode
# Note: this is set even for linux so any regression introduced by this flag
# will be catched earlier
# See: https://github.com/bazelbuild/bazel/issues/4231
BAZEL_USE_CPP_ONLY_TOOLCHAIN = 1;
TMPDIR = "/tmp";

GHC_VERSION = ghcVersion;
Expand Down

0 comments on commit 96dd564

Please sign in to comment.