Skip to content

Commit 3912117

Browse files
authored
Merge pull request #2050 from tweag/cleanup-deprecated
Cleanup: remove deprecated options and targets
2 parents 7059b07 + 2a250dd commit 3912117

File tree

70 files changed

+164
-278
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+164
-278
lines changed

.github/workflows/workflow.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,41 @@ env:
1010
cache-version: 0
1111

1212
jobs:
13+
lint:
14+
name: Format & Lint
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}-lint
17+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Configure
22+
env:
23+
BUILDBUDDY_API_KEY: ${{ secrets.BUILDBUDDY_API_KEY }}
24+
run: |
25+
# Avoid failures of the form `deadline exceeded after 14999958197ns DEADLINE_EXCEEDED`.
26+
# See https://github.com/tweag/rules_haskell/issues/1498 and https://github.com/tweag/rules_haskell/pull/1692.
27+
[[ ${{ runner.os }} == Linux ]] && sudo sysctl -w net.ipv4.tcp_keepalive_time=60
28+
if [ -z "$BUILDBUDDY_API_KEY" ]; then
29+
cache_setting='--noremote_upload_local_results'
30+
else
31+
cache_setting="--remote_header=x-buildbuddy-api-key=$BUILDBUDDY_API_KEY"
32+
fi
33+
cat >.bazelrc.local <<EOF
34+
common --config=ci
35+
build $cache_setting
36+
EOF
37+
cat >~/.netrc <<EOF
38+
machine api.github.com
39+
password ${{ secrets.GITHUB_TOKEN }}
40+
EOF
41+
- run: |
42+
bazelisk test buildifier:buildifier_test
43+
1344
test-nixpkgs:
1445
name: Build & Test - Nixpkgs
46+
needs:
47+
- lint
1548
concurrency:
1649
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.module }}-${{ matrix.bzlmod }}-${{ matrix.ghc }}-nixpkgs
1750
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
@@ -115,6 +148,8 @@ jobs:
115148
116149
test-bindist:
117150
name: Build & Test - bindist
151+
needs:
152+
- lint
118153
concurrency:
119154
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.os }}-${{ matrix.module }}-${{ matrix.bzlmod }}-${{ matrix.ghc }}-bindist
120155
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/).
66

7+
## Unreleased
8+
9+
### Removed
10+
11+
* remove `compiler_flags` option which was deprecated since 0.14 from macros and rules
12+
* remove `<name>-repl` aliases for repl targets introduced in 0.7
13+
* remove deprecated nixpkgs platform aliases introduced in 0.13
14+
715
## [0.17] 2023-10-19
816

917
[0.17]: https://github.com/tweag/rules_haskell/compare/v0.16...v0.17

buildifier/BUILD.bazel

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ buildifier_exclude_patterns = [
44
"./vendor/**",
55
]
66

7+
_lint_warnings = [
8+
"load",
9+
"unused-variable",
10+
]
11+
712
# Run this to fix the errors in BUILD files.
813
buildifier(
914
name = "buildifier",
1015
exclude_patterns = buildifier_exclude_patterns,
16+
lint_mode = "fix",
17+
lint_warnings = _lint_warnings,
1118
verbose = True,
1219
)
1320

@@ -33,9 +40,12 @@ buildifier_test(
3340
"@examples//:all_files",
3441
"@tutorial//:all_files",
3542
],
43+
lint_mode = "warn",
44+
lint_warnings = _lint_warnings,
3645
mode = "diff",
3746
tags = [
3847
"dont_test_on_windows",
48+
"manual",
3949
],
4050
)
4151

docs/BUILD.bazel

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
12
load("@io_bazel_stardoc//stardoc:stardoc.bzl", "stardoc")
23
load("@rules_python//python:defs.bzl", "py_binary")
34
load("@rules_haskell//docs/pandoc:pandoc.bzl", "set_site_end_location")
@@ -34,6 +35,17 @@ libraries = [
3435
"c2hs",
3536
]
3637

38+
# moved here so that //haskell is not dependent upon rules_nixpkgs_*
39+
bzl_library(
40+
name = "haskell_nix",
41+
srcs = ["//haskell:nixpkgs.bzl"],
42+
deps = [
43+
"//haskell",
44+
"@rules_nixpkgs_core//:nixpkgs",
45+
"@rules_nixpkgs_posix//:posix",
46+
],
47+
)
48+
3749
[
3850
(
3951
# Extract API documentation metadata to generate navigation and index.
@@ -47,7 +59,10 @@ libraries = [
4759
provider_template = ":templates/metadata/provider.vm",
4860
rule_template = ":templates/metadata/rule.vm",
4961
tags = ["dont_test_on_windows"],
50-
deps = ["//haskell"],
62+
deps = [
63+
":haskell_nix",
64+
"//haskell",
65+
],
5166
),
5267
# Generate markdown API documentation.
5368
stardoc(
@@ -60,7 +75,10 @@ libraries = [
6075
provider_template = ":templates/markdown/provider.vm",
6176
rule_template = ":templates/markdown/rule.vm",
6277
tags = ["dont_test_on_windows"],
63-
deps = ["//haskell"],
78+
deps = [
79+
":haskell_nix",
80+
"//haskell",
81+
],
6482
),
6583
# Convert markdown to html.
6684
genrule(

docs/haskell.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ a single ``BUILD.bazel`` as follows::
239239
haskell_binary(
240240
name = "demorgan",
241241
srcs = ["Main.hs"],
242-
compiler_flags = ["-threaded"],
242+
ghcopts = ["-threaded"],
243243
deps = [":base", ":booleans"],
244244
)
245245

@@ -317,7 +317,7 @@ And at the ``main/BUILD.bazel`` file::
317317
haskell_binary(
318318
name = "demorgan",
319319
srcs = ["Main.hs"],
320-
compiler_flags = ["-threaded"],
320+
ghcopts = ["-threaded"],
321321
deps = [":base", "//lib:booleans"],
322322
)
323323

examples/WORKSPACE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ local_repository(
1010
path = "arm",
1111
)
1212

13-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
1413
load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies")
1514

1615
rules_haskell_dependencies()

extensions/rules_haskell_dependencies.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
77
load("@rules_haskell//tools:os_info.bzl", "os_info")
88
load("@rules_haskell_ghc_version//:ghc_version.bzl", "GHC_VERSION")
99

10-
def repositories(*, bzlmod):
10+
def repositories(*, bzlmod): # @unused
1111
rules_haskell_dependencies_bzlmod()
1212

1313
# Some helpers for platform-dependent configuration

haskell/BUILD.bazel

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ bzl_library(
100100
"@bazel_skylib//lib:shell",
101101
"@bazel_skylib//lib:versions",
102102
"@bazel_skylib//rules:expand_template",
103-
"@rules_nixpkgs_core//:nixpkgs",
104-
"@rules_nixpkgs_posix//:posix",
105103
"@rules_sh//sh:posix",
106104
],
107105
)

haskell/asterius/defs.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ asterius_toolchain = rule(
4747
# select the asterius platform.
4848
# We also set the asterius_targets_browser back to it's default value
4949
# as it in not needed anymore.
50-
def _asterius_transition_impl(settings, attr):
50+
def _asterius_transition_impl(_settings, _attr):
5151
return {
5252
"//command_line_option:platforms": "@rules_haskell//haskell/asterius:asterius_platform",
5353
"@rules_haskell_asterius_build_setting//:asterius_targets_browser": False,
@@ -64,7 +64,7 @@ _asterius_transition = transition(
6464

6565
# ahc_dist targets used by asterius_webpack rules must be configured for the browser.
6666
# We use the following transition for this purpose.
67-
def _set_ahc_dist_browser_target_impl(settings, attr):
67+
def _set_ahc_dist_browser_target_impl(_settings, _attr):
6868
return {"@rules_haskell_asterius_build_setting//:asterius_targets_browser": True}
6969

7070
_set_ahc_dist_browser_target = transition(

haskell/asterius/repositories.bzl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ load(
33
"//haskell:private/workspace_utils.bzl",
44
"define_rule",
55
"execute_or_fail_loudly",
6-
"find_python",
76
"resolve_labels",
87
)
9-
load("//haskell:private/validate_attrs.bzl", "check_deprecated_attribute_usage")
108
load(
119
"//haskell:private/pkgdb_to_bzl.bzl",
1210
"pkgdb_to_bzl",
@@ -279,7 +277,7 @@ def rules_haskell_asterius_toolchains(
279277
version = AHC_DEFAULT_VERSION,
280278
ghcopts = [],
281279
cabalopts = [],
282-
repl_ghci_args = [],
280+
repl_ghci_args = [], # @unused
283281
locale = None,
284282
register = True):
285283
"""

0 commit comments

Comments
 (0)