Skip to content

Commit 069d058

Browse files
committed
Merge remote-tracking branch 'la-vache/main' into L2/23-278
2 parents 1651488 + 184d7e5 commit 069d058

File tree

460 files changed

+458280
-285935
lines changed

Some content is hidden

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

460 files changed

+458280
-285935
lines changed

.github/workflows/build-jsp.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,15 @@ jobs:
5252
restore-keys: |
5353
${{ runner.os }}-maven-
5454
# TODO: move this DOWN after JSPs once it works
55-
- name: Generate Unicode data
56-
# TODO: hard coded version
57-
# TODO: symlink of security here?
55+
- name: Regenerate the property cache files
5856
run: >
59-
mkdir -pv $(pwd)/output/Generated/ &&
60-
mvn -s .github/workflows/mvn-settings.xml -B compile exec:java -DskipTests=true
61-
-Dexec.mainClass="org.unicode.text.UCD.Main" -Dexec.args="version ${CURRENT_UVERSION} build MakeUnicodeFiles"
62-
-am -pl unicodetools -DCLDR_DIR=${GITHUB_WORKSPACE}/cldr
63-
-DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=${CURRENT_UVERSION}
64-
-DUNICODETOOLS_GEN_DIR=$(pwd)/output/Generated
65-
env:
66-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67-
- name: Run unicodetools tests
68-
run: >
69-
mvn -s .github/workflows/mvn-settings.xml -B test -am -pl unicodetools
70-
-DCLDR_DIR=${GITHUB_WORKSPACE}/cldr -T 1C -Dparallel=classes -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=${CURRENT_UVERSION} -DUNICODETOOLS_GEN_DIR=$(pwd)/output/Generated
57+
mkdir -pv $(pwd)/Generated/ &&
58+
mvn -s .github/workflows/mvn-settings.xml compile exec:java -Dexec.mainClass="org.unicode.jsp.RebuildPropertyCache"
59+
-am -pl unicodetools
60+
-DCLDR_DIR=${GITHUB_WORKSPACE}/cldr
61+
-DUNICODETOOLS_REPO_DIR=$(pwd)
62+
-DUNICODETOOLS_GEN_DIR=$(pwd)/Generated &&
63+
tar -cpz -f UnicodeJsps/target/generated.tgz ./Generated
7164
env:
7265
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7366
- name: Package JSPs

.github/workflows/cli-build-instructions.yml

Lines changed: 101 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
# change anything, which makes little sense; but that is the job of the
8989
# other job.
9090
- name: Run invariant tests
91-
run: MAVEN_OPTS="-ea" mvn -s .github/workflows/mvn-settings.xml test -am -pl unicodetools -Dtest=TestTestUnicodeInvariants -DfailIfNoTests=false -DCLDR_DIR=$(cd ../cldr ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd Generated; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION
91+
run: MAVEN_OPTS="-ea" mvn -s .github/workflows/mvn-settings.xml test -am -pl unicodetools -Dtest=TestTestUnicodeInvariants#testUnicodeInvariants -DfailIfNoTests=false -DCLDR_DIR=$(cd ../cldr ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd Generated; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION
9292
env:
9393
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9494

@@ -170,7 +170,7 @@ jobs:
170170
- name: Run command - Build and Test
171171
run: |
172172
cd unicodetools/mine/src
173-
MAVEN_OPTS="-ea" mvn -s .github/workflows/mvn-settings.xml package -DCLDR_DIR=$(cd ../../../cldr/mine/src ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd ../Generated ; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION
173+
MAVEN_OPTS="-ea" mvn -s .github/workflows/mvn-settings.xml package -Dtest=!TestTestUnicodeInvariants#testSecurityInvariants -DCLDR_DIR=$(cd ../../../cldr/mine/src ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd ../Generated ; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION -DEMIT_GITHUB_ERRORS
174174
env:
175175
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
176176

@@ -275,6 +275,22 @@ jobs:
275275
with:
276276
repository: unicode-org/unicodetools
277277
path: unicodetools/mine/src
278+
- name: Checkout base UnicodeData.txt
279+
if: ${{ github.event_name == 'pull_request'}}
280+
uses: actions/checkout@v3
281+
with:
282+
ref: ${{ github.event.pull_request.base.sha }}
283+
path: base
284+
sparse-checkout: unicodetools/data/ucd/dev/UnicodeData.txt
285+
- name: Compare repertoire
286+
if: ${{ github.event_name == 'pull_request'}}
287+
run: |
288+
# Look for changes affecting the first two fields of UnicodeData.txt (code point and name).
289+
sed 's/^\([^;]*;[^;]*\);.*$/\1/' unicodetools/mine/src/unicodetools/data/ucd/dev/UnicodeData.txt > merged-repertoire.txt
290+
sed 's/^\([^;]*;[^;]*\);.*$/\1/' base/unicodetools/data/ucd/dev/UnicodeData.txt > base-repertoire.txt
291+
set +e
292+
diff base-repertoire.txt merged-repertoire.txt
293+
echo "REPERTOIRE_CHANGED=$?" >> "$GITHUB_ENV"
278294
- name: Get the CLDR_REF from pom.xml
279295
id: cldr_ref
280296
run: echo "CLDR_REF="$(mvn --file unicodetools/mine/src/pom.xml help:evaluate -Dexpression=cldr.version -q -DforceStdout | cut -d- -f3) >> $GITHUB_OUTPUT && cat ${GITHUB_OUTPUT}
@@ -316,9 +332,92 @@ jobs:
316332
- name: Run command - UCA - collation validity log
317333
run: |
318334
cd unicodetools/mine/src
335+
echo "REPERTOIRE_CHANGED=$REPERTOIRE_CHANGED"
336+
if [[ ${REPERTOIRE_CHANGED:-0} -ne 0 ]]
337+
then set +e
338+
fi
319339
# invoke main() in class ...UCA.Main
320340
mvn -s .github/workflows/mvn-settings.xml compile exec:java -Dexec.mainClass="org.unicode.text.UCA.Main" -Dexec.args="writeCollationValidityLog ICU" -am -pl unicodetools -DCLDR_DIR=$(cd ../../../cldr/mine/src ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd ../Generated ; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION
321341
# check for output file
322342
compgen -G "../Generated/UCA/*/CheckCollationValidity.html"
323343
env:
324344
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
345+
346+
# Out-of-source build.
347+
security:
348+
name: Check security data invariants
349+
runs-on: ubuntu-latest
350+
steps:
351+
- name: Checkout Unicode Tools
352+
uses: actions/checkout@v3
353+
with:
354+
repository: unicode-org/unicodetools
355+
path: unicodetools/mine/src
356+
- name: Checkout base UnicodeData.txt
357+
if: ${{ github.event_name == 'pull_request'}}
358+
uses: actions/checkout@v3
359+
with:
360+
ref: ${{ github.event.pull_request.base.sha }}
361+
path: base
362+
sparse-checkout: unicodetools/data/ucd/dev/UnicodeData.txt
363+
- name: Compare repertoire
364+
if: ${{ github.event_name == 'pull_request'}}
365+
run: |
366+
# Look for changes affecting the first two fields of UnicodeData.txt (code point and name).
367+
sed 's/^\([^;]*;[^;]*\);.*$/\1/' unicodetools/mine/src/unicodetools/data/ucd/dev/UnicodeData.txt > merged-repertoire.txt
368+
sed 's/^\([^;]*;[^;]*\);.*$/\1/' base/unicodetools/data/ucd/dev/UnicodeData.txt > base-repertoire.txt
369+
set +e
370+
diff base-repertoire.txt merged-repertoire.txt
371+
echo "REPERTOIRE_CHANGED=$?" >> "$GITHUB_ENV"
372+
- name: Get the CLDR_REF from pom.xml
373+
id: cldr_ref
374+
run: echo "CLDR_REF="$(mvn --file unicodetools/mine/src/pom.xml help:evaluate -Dexpression=cldr.version -q -DforceStdout | cut -d- -f3) >> $GITHUB_OUTPUT && cat ${GITHUB_OUTPUT}
375+
- name: Verify CLDR checkout ref
376+
run: echo CLDR_REF="${{ steps.cldr_ref.outputs.CLDR_REF }}" && [ "${{ steps.cldr_ref.outputs.CLDR_REF }}x" != "x" ] # fail if empty
377+
- name: Cache CLDR repository
378+
uses: actions/cache@v3
379+
with:
380+
path: cldr/mine/src
381+
key: cldr-${{ steps.cldr_ref.outputs.CLDR_REF }}
382+
restore-keys: |
383+
cldr
384+
- name: Check out CLDR
385+
uses: actions/checkout@v3
386+
with:
387+
repository: unicode-org/cldr
388+
path: cldr/mine/src
389+
ref: main
390+
fetch-depth: 0
391+
- name: Switch CLDR to CLDR_REF
392+
run: cd cldr/mine/src && git fetch && git checkout ${{ steps.cldr_ref.outputs.CLDR_REF }}
393+
- name: Set up JDK 11
394+
uses: actions/setup-java@v1
395+
with:
396+
java-version: 11
397+
- name: Cache local Maven repository
398+
uses: actions/cache@v2
399+
with:
400+
path: ~/.m2/repository
401+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
402+
restore-keys: |
403+
${{ runner.os }}-maven-
404+
- name: Set up out-of-source output dir
405+
run: |
406+
mkdir -p unicodetools/mine/Generated/BIN
407+
408+
- name: Run invariant tests
409+
run: |
410+
cd unicodetools/mine/src
411+
echo "REPERTOIRE_CHANGED=$REPERTOIRE_CHANGED"
412+
if [[ ${REPERTOIRE_CHANGED:-0} -ne 0 ]]
413+
then ERROR="::notice"
414+
else ERROR="::error"
415+
fi
416+
MAVEN_OPTS="-ea" mvn -s .github/workflows/mvn-settings.xml test -am -pl unicodetools -Dtest=TestTestUnicodeInvariants#testSecurityInvariants -DCLDR_DIR=$(cd ../../../cldr/mine/src ; pwd) -DUNICODETOOLS_GEN_DIR=$(cd ../Generated ; pwd) -DUNICODETOOLS_REPO_DIR=$(pwd) -DUVERSION=$CURRENT_UVERSION -DfailIfNoTests=false -DEMIT_GITHUB_ERRORS 2>&1 | sed "s/^::error/$ERROR/"
417+
STATUS=${PIPESTATUS[0]}
418+
if [[ ${REPERTOIRE_CHANGED:-0} -ne 0 ]]
419+
then exit 0
420+
else exit $STATUS
421+
fi
422+
env:
423+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pipeline.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Pipeline
2+
3+
4+
on:
5+
pull_request:
6+
branches: ['*']
7+
types: [opened, synchronize, reopened, labeled, unlabeled, ready_for_review, converted_to_draft, edited]
8+
9+
jobs:
10+
labels-for-repertoire-changes:
11+
name: Labels for repertoire changes
12+
outputs:
13+
repertoire-changed: ${{ steps.compare-repertoire.outputs.repertoire-changed }}
14+
pipeline-label: ${{ steps.check-labels.outputs.pipeline-label }}
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout merged UnicodeData.txt
18+
uses: actions/checkout@v3
19+
with:
20+
path: merged
21+
sparse-checkout: unicodetools/data/ucd/dev/UnicodeData.txt
22+
- name: Checkout base UnicodeData.txt
23+
uses: actions/checkout@v3
24+
with:
25+
ref: ${{ github.event.pull_request.base.sha }}
26+
path: base
27+
sparse-checkout: unicodetools/data/ucd/dev/UnicodeData.txt
28+
- name: Compare repertoire
29+
id: compare-repertoire
30+
run: |
31+
# Look for changes affecting the first two fields of UnicodeData.txt (code point and name).
32+
sed 's/^\([^;]*;[^;]*\);.*$/\1/' merged/unicodetools/data/ucd/dev/UnicodeData.txt > merged-repertoire.txt
33+
sed 's/^\([^;]*;[^;]*\);.*$/\1/' base/unicodetools/data/ucd/dev/UnicodeData.txt > base-repertoire.txt
34+
if diff base-repertoire.txt merged-repertoire.txt
35+
then echo "repertoire-changed=false" >> "$GITHUB_OUTPUT"
36+
else echo "repertoire-changed=true" >> "$GITHUB_OUTPUT"
37+
fi
38+
- name: Checkout Python scripts
39+
uses: actions/checkout@v3
40+
with:
41+
sparse-checkout: py/pipeline-workflow
42+
- name: Check pipeline labels
43+
id: check-labels
44+
if: steps.compare-repertoire.outputs.repertoire-changed == 'true'
45+
run: python3 py/pipeline-workflow/compare-repertoire.py
46+
l2-document:
47+
needs: labels-for-repertoire-changes
48+
if: ${{ always() && needs.labels-for-repertoire-changes.outputs.repertoire-changed == 'true' }}
49+
name: Proposal document
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout Python scripts
53+
uses: actions/checkout@v3
54+
with:
55+
sparse-checkout: py/pipeline-workflow
56+
- name: Check L2 document
57+
run: |
58+
python3 py/pipeline-workflow/check-l2-document.py
59+
utc-decision:
60+
needs: labels-for-repertoire-changes
61+
if: needs.labels-for-repertoire-changes.outputs.repertoire-changed == 'true' && needs.labels-for-repertoire-changes.outputs.pipeline-label != 'pipeline-recommended-to-UTC'
62+
name: UTC decision
63+
runs-on: ubuntu-latest
64+
steps:
65+
- name: Checkout Python scripts
66+
uses: actions/checkout@v3
67+
with:
68+
sparse-checkout: py/pipeline-workflow
69+
- name: Check UTC decision
70+
run: python3 py/pipeline-workflow/check-utc-decision.py
71+
draft-unless-approved:
72+
needs: labels-for-repertoire-changes
73+
if: needs.labels-for-repertoire-changes.outputs.repertoire-changed == 'true'
74+
name: Draft unless approved
75+
runs-on: ubuntu-latest
76+
steps:
77+
- name: Checkout Python scripts and DerivedAge.txt
78+
uses: actions/checkout@v3
79+
with:
80+
sparse-checkout: |
81+
py/pipeline-workflow
82+
unicodetools/data/ucd/dev/DerivedAge.txt
83+
- name: Check draft status
84+
env:
85+
PIPELINE_LABEL: ${{ needs.labels-for-repertoire-changes.outputs.pipeline-label }}
86+
run: python3 py/pipeline-workflow/check-draft-status.py
87+

LICENSE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ UNICODE LICENSE V3
22

33
COPYRIGHT AND PERMISSION NOTICE
44

5-
Copyright © 2001-2023 Unicode, Inc.
5+
Copyright © 2001-2024 Unicode, Inc.
66

77
NOTICE TO USER: Carefully read the following legal agreement. BY
88
DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING DATA FILES, AND/OR
@@ -37,3 +37,5 @@ Except as contained in this notice, the name of a copyright holder shall
3737
not be used in advertising or otherwise to promote the sale, use or other
3838
dealings in these Data Files or Software without prior written
3939
authorization of the copyright holder.
40+
41+
SPDX-License-Identifier: Unicode-3.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The tools maintainers use GH issues for issues with the code in this repo.
2323

2424
### Copyright & Licenses
2525

26-
Copyright © 2001-2023 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the United States and other countries.
26+
Copyright © 2001-2024 Unicode, Inc. Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the United States and other countries.
2727

2828
The project is released under [LICENSE](./LICENSE).
2929

UnicodeJsps/Dockerfile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ RUN cd source && gcc -I ../include/ -static -Os -o3 -o bidiref1 bidiref1.c bruti
99
RUN ls -lh /build/source/bidiref1 && (/build/source/bidiref1 || true)
1010
# copy and unpack to /tmp/data
1111
ADD ./target/cldr-unicodetools.tgz /build/data/
12+
ADD ./target/generated.tgz /build/data/
1213
# move this into place (including unicodetools/unicodetools)
1314
RUN rm -rf /build/data/cldr/.git # unneeded
1415
FROM jetty:9-jre11-alpine-eclipse-temurin AS run
@@ -24,9 +25,10 @@ ENV BIDIREFHOME /usr/local/share
2425
# copy the bidiref1 bin
2526
ENV BIDIREF1 /usr/local/bin/bidiref1
2627
COPY --from=cbuild /build/source/bidiref1 /usr/local/bin/
27-
RUN mkdir -p /var/lib/jetty/data/unicodetools
28+
RUN mkdir -p /var/lib/jetty/data/unicodetools/Generated
2829
COPY --from=cbuild /build/data/cldr /var/lib/jetty/data/cldr
2930
COPY --from=cbuild /build/data/unicodetools/ /var/lib/jetty/data/unicodetools/unicodetools/
30-
ENV JAVA_OPTIONS -DCLDR_DIR=/var/lib/jetty/data/cldr -DUNICODETOOLS_REPO_DIR=/var/lib/jetty/data/unicodetools
31+
COPY --from=cbuild /build/data/Generated /var/lib/jetty/data/unicodetools/Generated
32+
ENV JAVA_OPTIONS -DCLDR_DIR=/var/lib/jetty/data/cldr -DUNICODETOOLS_REPO_DIR=/var/lib/jetty/data/unicodetools -DUNICODETOOLS_GEN_DIR=/var/lib/jetty/data/unicodetools/Generated -Xmx4g
3133
# This is the default PORT. Override by setting PORT.
3234
EXPOSE 8080

UnicodeJsps/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<!-- icu -->
3030
<dependency>
3131
<groupId>com.ibm.icu</groupId>
32-
<artifactId>icu4j-for-cldr</artifactId>
32+
<artifactId>icu4j</artifactId>
3333
</dependency>
3434

3535
<dependency>

UnicodeJsps/src/main/java/org/unicode/cldr/tool/TablePrinter.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ private int findIdentical(Comparable[][] sortedFlat, int rowIndex, int colIndex)
451451
}
452452
return sortedFlat.length - rowIndex;
453453
}
454+
454455
// to-do: prevent overlap when it would cause information to be lost.
455456
private BitSet breaksSpans = new BitSet();
456457

0 commit comments

Comments
 (0)