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

Update mochiweb and meck #286

Merged
merged 3 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ jobs:
rebar3: "3.16.1"
- otp: "25.3.2.15"
rebar3: "3.22.1"
# - otp: "26.2.5.5"
# rebar3: "3.22.1"
# - otp: "27.1.2"
# rebar3: "3.22.1"
- otp: "26.2.5.5"
rebar3: "3.22.1"
- otp: "27.1.2"
rebar3: "3.22.1"
steps:
- name: Install Emacs
uses: purcell/setup-emacs@master
Expand Down
27 changes: 15 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ rel/releases:

deps/mochiweb/src:
$(GIT) clone "https://github.com/mochi/mochiweb" deps/mochiweb
cd deps/mochiweb && $(GIT) checkout --detach 835b107a4da4550080d032623ff6ae9a18d02c37
cd deps/mochiweb && $(GIT) checkout --detach 611254eb941e502227f221667389b98fd8e72d6f
deps/meck/src:
$(GIT) clone "https://github.com/eproxus/meck" deps/meck
cd deps/meck && $(GIT) checkout --detach cc47aab4b64a46a5409c1a93353d44a367b41454
cd deps/meck && $(GIT) checkout --detach 59d61d87b42408779e7863b6e8544325bcf90efd

deps/mochiweb: deps/mochiweb/src deps/mochiweb/ebin
deps/meck: deps/meck/src deps/meck/ebin
Expand Down Expand Up @@ -68,7 +68,8 @@ erlang.plt:
$(DIALYZER) --quiet --build_plt --output_plt $@ --apps \
erts kernel stdlib mnesia crypto sasl eunit \
syntax_tools compiler tools debugger dialyzer \
wx runtime_tools
wx runtime_tools ssl public_key asn1 inets xmerl \
parsetools
edts.plt: erlang.plt
$(DIALYZER) --add_to_plt --plt erlang.plt -r lib/ deps/ --output_plt $@

Expand All @@ -78,17 +79,17 @@ manual-tests: $(OTP_TESTS) byte-compilation-test

.PHONY: integration-tests
integration-tests: all test-projects
$(EMACS) -Q --batch \
-L $(ERLANG_EMACS_LIB) \
-l test_data/load-tests.el \
$(EMACS) --quick --batch \
--directory $(ERLANG_EMACS_LIB) \
--load test_data/load-tests.el \
--debug-init \
-f edts-test-run-suites-batch-and-exit
--funcall edts-test-run-suites-batch-and-exit

.PHONY: ert
ert: test-projects
$(EMACS) -Q --batch \
-L $(ERLANG_EMACS_LIB) \
-l test_data/load-tests.el \
$(EMACS) --quick --batch \
--directory $(ERLANG_EMACS_LIB) \
--load test_data/load-tests.el \
--debug-init \
--eval "(ert-run-tests-batch-and-exit '(not (tag edts-test-suite)))"

Expand All @@ -108,8 +109,10 @@ byte-compilation-test:
-u $(shell id -u) \
silex/emacs \
/bin/bash -c \
'emacs -Q --batch -L ${PWD} -l test_data/package-install-deps.el \
-f batch-byte-compile *.el elisp/edts/*.el lib/**/*.el'
'emacs --quick --batch \
--directory ${PWD} \
--load test_data/package-install-deps.el \
--funcall batch-byte-compile *.el elisp/edts/*.el lib/**/*.el'

.PHONY: $(OTP_TESTS)
$(OTP_TESTS):
Expand Down
20 changes: 17 additions & 3 deletions lib/edts_dialyzer/src/edts_dialyzer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,7 @@ create_plt(BasePlt0, OutPlt, Files) ->
BasePlt =
case BasePlt0 of
undefined ->
try dialyzer_plt:get_default_plt()
catch throw:{dialyzer_error, _} -> undefined
end;
try_get_default_plt();
_ when is_list(BasePlt0) -> BasePlt0
end,
VarOpts =
Expand All @@ -181,6 +179,22 @@ create_plt(BasePlt0, OutPlt, Files) ->

dialyzer:run(BaseOpts ++ VarOpts).

-ifndef(OTP_RELEASE). % OTP-19 and lesser
-def(OTP_RELEASE, 1).
-endif.

-if(?OTP_RELEASE >= 26).
try_get_default_plt() ->
try dialyzer_iplt:get_default_iplt_filename()
catch throw:{dialyzer_error, _} -> undefined
end.
-else.
try_get_default_plt() ->
try dialyzer_plt:get_default_plt()
catch throw:{dialyzer_error, _} -> undefined
end.
-endif.

get_included_files(Plt) ->
{ok, Info} = dialyzer:plt_info(Plt),
{files, Files} = lists:keyfind(files, 1, Info),
Expand Down
9 changes: 4 additions & 5 deletions test_data/manual/Dockerfile.otp26
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:20.04

SHELL ["/bin/bash", "-c"]

Expand All @@ -11,7 +11,7 @@ RUN apt-get -q update && \
rm -rf /var/lib/apt/lists/*

ENV ERLANG_VERSION=26.0.2 \
ERLANG_EMACS_LIB="/usr/lib/erlang/lib/tools-3.5.3/emacs"
ERLANG_EMACS_LIB="/usr/lib/erlang/lib/tools-3.6/emacs"

RUN . /etc/os-release && \
export FILE="esl-erlang_${ERLANG_VERSION}-1~ubuntu~${VERSION_CODENAME}_amd64.deb" && \
Expand All @@ -23,6 +23,5 @@ WORKDIR /edts

COPY . .

RUN make
# && \
# make test
RUN make && \
make test
20 changes: 20 additions & 0 deletions test_data/manual/Dockerfile.otp27
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM erlang:27.1.2

SHELL ["/bin/bash", "-c"]

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get -q update && \
apt-get -yq install \
wget \
emacs git && \
rm -rf /var/lib/apt/lists/*

ENV ERLANG_EMACS_LIB="/usr/local/lib/erlang/lib/tools-4.1/emacs"

WORKDIR /edts

COPY . .

RUN make && \
make test