Skip to content

Commit dee4b8b

Browse files
authored
chore: use opam to simplify makefile (#361)
Let's install check-jsonschema via depexts! See semgrep/semgrep-proprietary#3273 for more context - [X] I ran `make setup && make` to update the generated code after editing a `.atd` file (TODO: have a CI check) - [X] I made sure we're still backward compatible with old versions of the CLI. For example, the Semgrep backend need to still be able to *consume* data generated by Semgrep 1.50.0. See https://atd.readthedocs.io/en/latest/atdgen-tutorial.html#smooth-protocol-upgrades Note that the types related to the semgrep-core JSON output or the semgrep-core RPC do not need to be backward compatible!
1 parent e4e6f32 commit dee4b8b

File tree

3 files changed

+33
-25
lines changed

3 files changed

+33
-25
lines changed

Makefile

+2-10
Original file line numberDiff line numberDiff line change
@@ -72,24 +72,16 @@ clean:
7272
# This takes a while but ensures we use the correct versions of the atd tools.
7373
.PHONY: setup
7474
setup:
75+
opam update -y
76+
opam install -y --deps-only ./semgrep-interfaces.opam
7577
# Please install check-jsonschema (Python tool) if this fails:
7678
check-jsonschema --version
77-
opam update -y
78-
opam install -y --deps-only ./dev.opam
79-
80-
.PHONY: setup-ALPINE
81-
setup-ALPINE: setup-PYTHON
82-
83-
.PHONY: setup-MACOS
84-
setup-MACOS:
85-
brew install check-jsonschema
8679

8780
.PHONY: setup-PYTHON
8881
setup-PYTHON:
8982
pip install check-jsonschema
9083

9184
# The tests require semgrep-core, among other things.
92-
#
9385
.PHONY: test
9486
test:
9587
$(MAKE) -C tests

dev.opam

-15
This file was deleted.

semgrep-interfaces.opam

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# This is meant to be installed with 'opam install --deps-only . '
2+
#
3+
opam-version: "2.0"
4+
maintainer: "semgrep"
5+
authors: "r2c"
6+
homepage: "n/a"
7+
bug-reports: "n/a"
8+
synopsis: "Interfaces for Semgrep"
9+
dev-repo: "git+https://github.com/semgrep/semgrep-interfaces.git"
10+
license: "LGPL-2.1-only"
11+
12+
build: []
13+
install: []
14+
15+
depends: [
16+
"atd" {>= "2.6.0"}
17+
"atdpy" {>= "2.12.0"}
18+
"atdts" {>= "2.13.0"}
19+
"atdgen" {>= "2.10.0"}
20+
]
21+
22+
#TODO: we don't build on ubuntu or debian ever, and they are not packages there,
23+
# so let's just ignore it for now
24+
#["check-jsonschema"] {os-family = "debian"}
25+
#["check-jsonschema"] {os-family = "ubuntu"}
26+
depexts: [
27+
["check-jsonschema"] {os-distribution = "alpine"}
28+
["check-jsonschema"] {os = "macos" & os-distribution = "homebrew"}
29+
["check-jsonschema"] {os = "macos" & os-distribution = "macports"}
30+
["check-jsonschema"] {os = "win32" & os-distribution = "macports"}
31+
]

0 commit comments

Comments
 (0)