From a8166065d4a0e77d63879bb38e7ac70706cb04f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81=C4=99picki?= Date: Thu, 21 Mar 2024 17:13:03 +0100 Subject: [PATCH 1/6] use single quotes around 'maybe' atom for compatibility with OTP 27 --- src/mochiweb_multipart.erl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/mochiweb_multipart.erl b/src/mochiweb_multipart.erl index 906b7230..f57018b7 100644 --- a/src/mochiweb_multipart.erl +++ b/src/mochiweb_multipart.erl @@ -275,7 +275,7 @@ feed_mp(body, C1 = Callback({body, Data}), feed_mp(headers, State#mp{callback = C1(body_end), buffer = Rest}); - {maybe, Start} -> + {'maybe', Start} -> <> = Buffer, feed_mp(body, read_more(State#mp{callback = Callback({body, Data}), @@ -328,7 +328,7 @@ find_boundary(Prefix, Data) -> {end_boundary, Skip, size(Prefix) + 4}; _ when size(Data) < PrefixSkip + 4 -> %% Underflow - {maybe, Skip}; + {'maybe', Skip}; _ -> %% False positive not_found @@ -336,7 +336,7 @@ find_boundary(Prefix, Data) -> {partial, Skip, Length} when Skip + Length =:= size(Data) -> %% Underflow - {maybe, Skip}; + {'maybe', Skip}; _ -> not_found end. @@ -695,8 +695,8 @@ find_boundary_test() -> {end_boundary, 1, 9} = find_boundary(B, <<"!\r\n--X--\r\nRest">>), not_found = find_boundary(B, <<"--X\r\nRest">>), - {maybe, 0} = find_boundary(B, <<"\r\n--X\r">>), - {maybe, 1} = find_boundary(B, <<"!\r\n--X\r">>), + {'maybe', 0} = find_boundary(B, <<"\r\n--X\r">>), + {'maybe', 1} = find_boundary(B, <<"!\r\n--X\r">>), P = <<"\r\n-----------------------------160374543510" "82272548568224146">>, B0 = <<55, 212, 131, 77, 206, 23, 216, 198, 35, 87, 252, @@ -705,7 +705,7 @@ find_boundary_test() -> 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 49, 54, 48, 51, 55, 52, 53, 52, 51, 53, 49>>, - {maybe, 30} = find_boundary(P, B0), + {'maybe', 30} = find_boundary(P, B0), not_found = find_boundary(B, <<"\r\n--XJOPKE">>), ok. From 66a5ef8ea818d98f704dcc255b31194a4b63f6e2 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Thu, 21 Mar 2024 09:27:57 -0700 Subject: [PATCH 2/6] Update CHANGES and ci matrix --- .github/workflows/ci.yml | 19 ++++++++++--------- CHANGES.md | 4 +++- src/mochiweb.app.src | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 366bd8dc..4789c0bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,15 +15,16 @@ jobs: os: - ubuntu-latest otp: - - "26.0.2.0" - - "25.3.2.3" - - "24.3.4.13" - - "23.3.4.18" - - "22.3.4.26" - - "21.3.8.24" - - "20.3.8.26" - - "19.3.6.13" - - "18.3.4.11" + - "27" + - "26" + - "25" + - "24" + - "23" + - "22" + - "21" + - "20" + - "19" + - "18" steps: - uses: actions/checkout@v3 - run: make test diff --git a/CHANGES.md b/CHANGES.md index c53c74f2..b9e22ca4 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,7 @@ -Version 3.2.2 released XXXX-XX-XX +Version 3.2.2 released 2024-03-21 +* Use single quotes around 'maybe' atom for compatibility with OTP 27 + https://github.com/mochi/mochiweb/pull/262 * Update Erlang CI images https://github.com/mochi/mochiweb/pull/261 diff --git a/src/mochiweb.app.src b/src/mochiweb.app.src index 6e7c915c..630759d4 100644 --- a/src/mochiweb.app.src +++ b/src/mochiweb.app.src @@ -1,7 +1,7 @@ %% This is generated from src/mochiweb.app.src {application, mochiweb, [{description, "MochiMedia Web Server"}, - {vsn, "3.2.1"}, + {vsn, "3.2.2"}, {modules, []}, {registered, []}, {env, []}, From 4b03d120556a0be60b6a1da6f0ee2c1c531b5c26 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Thu, 21 Mar 2024 10:02:54 -0700 Subject: [PATCH 3/6] Update mochiweb_util tests to avoid OTP 27 warnings --- src/mochiweb_util.erl | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mochiweb_util.erl b/src/mochiweb_util.erl index 53409451..f5421b6c 100644 --- a/src/mochiweb_util.erl +++ b/src/mochiweb_util.erl @@ -877,32 +877,32 @@ safe_relative_path_test() -> parse_qvalues_test() -> [] = parse_qvalues(""), - [{"identity", 0.0}] = parse_qvalues("identity;q=0"), - [{"identity", 0.0}] = parse_qvalues("identity ;q=0"), - [{"identity", 0.0}] = parse_qvalues(" identity; q =0 "), - [{"identity", 0.0}] = parse_qvalues("identity ; q = 0"), - [{"identity", 0.0}] = parse_qvalues("identity ; q= 0.0"), - [{"gzip", 1.0}, {"deflate", 1.0}, {"identity", 0.0}] = parse_qvalues( + [{"identity", +0.0}] = parse_qvalues("identity;q=0"), + [{"identity", +0.0}] = parse_qvalues("identity ;q=0"), + [{"identity", +0.0}] = parse_qvalues(" identity; q =0 "), + [{"identity", +0.0}] = parse_qvalues("identity ; q = 0"), + [{"identity", +0.0}] = parse_qvalues("identity ; q= 0.0"), + [{"gzip", 1.0}, {"deflate", 1.0}, {"identity", +0.0}] = parse_qvalues( "gzip,deflate,identity;q=0.0" ), - [{"deflate", 1.0}, {"gzip", 1.0}, {"identity", 0.0}] = parse_qvalues( + [{"deflate", 1.0}, {"gzip", 1.0}, {"identity", +0.0}] = parse_qvalues( "deflate,gzip,identity;q=0.0" ), - [{"gzip", 1.0}, {"deflate", 1.0}, {"gzip", 1.0}, {"identity", 0.0}] = + [{"gzip", 1.0}, {"deflate", 1.0}, {"gzip", 1.0}, {"identity", +0.0}] = parse_qvalues("gzip,deflate,gzip,identity;q=0"), - [{"gzip", 1.0}, {"deflate", 1.0}, {"identity", 0.0}] = parse_qvalues( + [{"gzip", 1.0}, {"deflate", 1.0}, {"identity", +0.0}] = parse_qvalues( "gzip, deflate , identity; q=0.0" ), - [{"gzip", 1.0}, {"deflate", 1.0}, {"identity", 0.0}] = parse_qvalues( + [{"gzip", 1.0}, {"deflate", 1.0}, {"identity", +0.0}] = parse_qvalues( "gzip; q=1, deflate;q=1.0, identity;q=0.0" ), - [{"gzip", 0.5}, {"deflate", 1.0}, {"identity", 0.0}] = parse_qvalues( + [{"gzip", 0.5}, {"deflate", 1.0}, {"identity", +0.0}] = parse_qvalues( "gzip; q=0.5, deflate;q=1.0, identity;q=0" ), - [{"gzip", 0.5}, {"deflate", 1.0}, {"identity", 0.0}] = parse_qvalues( + [{"gzip", 0.5}, {"deflate", 1.0}, {"identity", +0.0}] = parse_qvalues( "gzip; q=0.5, deflate , identity;q=0.0" ), - [{"gzip", 0.5}, {"deflate", 0.8}, {"identity", 0.0}] = parse_qvalues( + [{"gzip", 0.5}, {"deflate", 0.8}, {"identity", +0.0}] = parse_qvalues( "gzip; q=0.5, deflate;q=0.8, identity;q=0.0" ), [{"gzip", 0.5}, {"deflate", 1.0}, {"identity", 1.0}] = parse_qvalues( From be68a43c2475d8442a65b32b9ed46d15585e39a8 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Thu, 21 Mar 2024 10:10:55 -0700 Subject: [PATCH 4/6] Fix mochijson2 test that was map-order dependent --- src/mochijson2.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mochijson2.erl b/src/mochijson2.erl index 57933e5b..4a524379 100644 --- a/src/mochijson2.erl +++ b/src/mochijson2.erl @@ -966,8 +966,9 @@ decode_map_test() -> ?assertEqual(M, decode(Json, [{format, map}])). encode_map_test() -> - M = <<"{\"a\":1,\"b\":{\"c\":2}}">>, - ?assertEqual(M, iolist_to_binary(encode(#{a => 1, b => #{ c => 2}}))). + ?assertEqual(<<"{\"a\":1}">>, iolist_to_binary(encode(#{a => 1}))), + M = #{<<"a">> => 1, <<"b">> => #{<<"c">> => 2}}, + ?assertEqual(M, decode(iolist_to_binary(encode(#{a => 1, b => #{ c => 2}})), [{format, map}])). encode_empty_map_test() -> ?assertEqual(<<"{}">>, encode(#{})). From bc6ac7f0af524cbd3516774939924e17006ad3e3 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Thu, 21 Mar 2024 10:16:47 -0700 Subject: [PATCH 5/6] checkout v4 --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4789c0bf..8dde0ad2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - "19" - "18" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - run: make test - run: make edoc - run: REBAR=rebar make test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f155eed1..eee4b583 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Publish to Hex.pm uses: erlangpack/github-action@v3 From 004080bf15883c58d8ce548cc40057c8aba22f2a Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Thu, 21 Mar 2024 12:23:45 -0700 Subject: [PATCH 6/6] checkout@v3 for otp 18 & 19 --- .github/workflows/ci.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dde0ad2..78dd83c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,10 +23,27 @@ jobs: - "22" - "21" - "20" + steps: + - uses: actions/checkout@v4 + - run: make test + - run: make edoc + - run: REBAR=rebar make test + test-eol: + name: test ${{matrix.otp}} on ${{matrix.os}} + runs-on: ${{matrix.os}} + container: + image: erlang:${{matrix.otp}} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + otp: - "19" - "18" steps: - - uses: actions/checkout@v4 + # The old containers can't run checkout@v4 + - uses: actions/checkout@v3 - run: make test - run: make edoc - run: REBAR=rebar make test