Skip to content

Commit 74870a8

Browse files
lemireDaniel Lemire
and
Daniel Lemire
authored
Fixing issue 1013. (simdjson#1016)
* Fixing issue 1013. * Bumping to 0.4.6 Co-authored-by: Daniel Lemire <[email protected]>
1 parent 0ef4d90 commit 74870a8

File tree

10 files changed

+86
-37
lines changed

10 files changed

+86
-37
lines changed

CMakeLists.txt

+5-7
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ project(simdjson
77

88
set(PROJECT_VERSION_MAJOR 0)
99
set(PROJECT_VERSION_MINOR 4)
10-
set(PROJECT_VERSION_PATCH 5)
11-
set(SIMDJSON_LIB_VERSION "0.4.5" CACHE STRING "simdjson library version")
10+
set(PROJECT_VERSION_PATCH 6)
11+
set(SIMDJSON_SEMANTIC_VERSION "0.4.6" CACHE STRING "simdjson semantic version")
12+
set(SIMDJSON_LIB_VERSION "2.0.0" CACHE STRING "simdjson library version")
1213
set(SIMDJSON_LIB_SOVERSION "2" CACHE STRING "simdjson library soversion")
1314
set(SIMDJSON_GITHUB_REPOSITORY https://github.com/simdjson/simdjson)
1415

15-
# The SIMDJSON_LIB_SOVERSION is 0 for versions before 0.3.0.
16-
# The SIMDJSON_LIB_SOVERSION is 1 for version 0.3.
17-
# The SIMDJSON_LIB_SOVERSION is 2 for version 0.4.
18-
1916
include(GNUInstallDirs)
2017
include(cmake/simdjson-flags.cmake)
2118
include(cmake/simdjson-user-cmakecache.cmake)
@@ -47,8 +44,9 @@ add_subdirectory(windows)
4744
if(NOT(SIMDJSON_JUST_LIBRARY))
4845
add_subdirectory(dependencies) ## This needs to be before tools because of cxxopts
4946
add_subdirectory(tools) ## This needs to be before tests because of cxxopts
47+
add_subdirectory(singleheader)
5048
endif()
51-
add_subdirectory(singleheader)
49+
install(FILES singleheader/simdjson.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
5250

5351
#
5452
# Compile tools / tests / benchmarks

Doxyfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = simdjson
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = "0.4.5"
41+
PROJECT_NUMBER = "0.4.6"
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

RELEASES.md

+17
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
## Highlights
44

5+
- Test coverage has been greatly improved and we have resolved many static-analysis warnings on different systems.
6+
- We added a fast (8GB/s) minifier that works directly on JSON strings.
7+
- We added fast (10GB/s) UTF-8 validator that works directly on strings (any strings, including non-JSON).
8+
- The array and object elements have a constant-time size() method.
9+
- Performance improvements to the API (type(), get<>()).
10+
- The parse_many function (ndjson) has been entirely reworked. It now uses a single secondary thread instead of several new threads.
11+
- We have introduced a faster UTF-8 validation algorithm (lookup3) for all kernels (ARM, x64 SSE, x64 AVX).
12+
- C++11 support for older compilers and systems.
13+
- FreeBSD support (and tests).
14+
- We support the clang front-end compiler (clangcl) under Visual Studio.
15+
- It is now possible to target ARM platforms under Visual Studio.
16+
- The simdjson library will never abort or print to standard output/error.
17+
18+
# 0.3
19+
20+
## Highlights
21+
522
- **Multi-Document Parsing:** Read a bundle of JSON documents (ndjson) 2-4x faster than doing it
623
individually. [API docs](https://github.com/simdjson/simdjson/blob/master/doc/basics.md#newline-delimited-json-ndjson-and-json-lines) / [Design Details](https://github.com/simdjson/simdjson/blob/master/doc/parse_many.md)
724
- **Simplified API:** The API has been completely revamped for ease of use, including a new JSON

include/simdjson/simdjson_version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#define SIMDJSON_SIMDJSON_VERSION_H
55

66
/** The version of simdjson being used (major.minor.revision) */
7-
#define SIMDJSON_VERSION 0.4.5
7+
#define SIMDJSON_VERSION 0.4.6
88

99
namespace simdjson {
1010
enum {
@@ -19,7 +19,7 @@ enum {
1919
/**
2020
* The revision (major.minor.REVISION) of simdjson being used.
2121
*/
22-
SIMDJSON_VERSION_REVISION = 5
22+
SIMDJSON_VERSION_REVISION = 6
2323
};
2424
} // namespace simdjson
2525

singleheader/amalgamate_demo.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Tue Jun 30 19:29:34 EDT 2020. Do not edit! */
1+
/* auto-generated on Wed Jul 1 14:00:57 EDT 2020. Do not edit! */
22

33
#include <iostream>
44
#include "simdjson.h"

singleheader/simdjson.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Tue Jun 30 19:29:34 EDT 2020. Do not edit! */
1+
/* auto-generated on Wed Jul 1 14:00:57 EDT 2020. Do not edit! */
22
/* begin file src/simdjson.cpp */
33
#include "simdjson.h"
44

singleheader/simdjson.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* auto-generated on Tue Jun 30 19:29:34 EDT 2020. Do not edit! */
1+
/* auto-generated on Wed Jul 1 14:00:57 EDT 2020. Do not edit! */
22
/* begin file include/simdjson.h */
33
#ifndef SIMDJSON_H
44
#define SIMDJSON_H
@@ -2040,7 +2040,7 @@ SIMDJSON_DISABLE_UNDESIRED_WARNINGS
20402040
#define SIMDJSON_SIMDJSON_VERSION_H
20412041
20422042
/** The version of simdjson being used (major.minor.revision) */
2043-
#define SIMDJSON_VERSION 0.4.5
2043+
#define SIMDJSON_VERSION 0.4.6
20442044
20452045
namespace simdjson {
20462046
enum {
@@ -2055,7 +2055,7 @@ enum {
20552055
/**
20562056
* The revision (major.minor.REVISION) of simdjson being used.
20572057
*/
2058-
SIMDJSON_VERSION_REVISION = 5
2058+
SIMDJSON_VERSION_REVISION = 6
20592059
};
20602060
} // namespace simdjson
20612061

src/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ if(NOT MSVC)
8484
# Please do not delete the following, our users want version numbers. See
8585
# https://github.com/simdjson/simdjson/issues/1014
8686
# https://github.com/simdjson/simdjson/issues/52
87-
###########
87+
###########
8888
set_target_properties(simdjson PROPERTIES VERSION ${SIMDJSON_LIB_VERSION} SOVERSION ${SIMDJSON_LIB_SOVERSION})
8989
##########
9090
# End of the do-not-delete message.

tests/CMakeLists.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,17 @@ endif()
180180
if(NOT MSVC)
181181
######
182182
# This tests is to guard us against ever again removing the soversion
183-
# and version numbers from the library. See Bug
183+
# number from the library. See Bug
184184
# https://github.com/simdjson/simdjson/issues/1014
185185
#####
186-
get_target_property(REPORTED_SIMDJSON_VERSION simdjson VERSION)
187186
get_target_property(REPORTED_SIMDJSON_SOVERSION simdjson SOVERSION)
188-
if(NOT ${REPORTED_SIMDJSON_VERSION} STREQUAL ${SIMDJSON_LIB_VERSION})
189-
message(FATAL_ERROR "The library target does not have the proper version information." )
190-
endif()
191187
if(NOT ${REPORTED_SIMDJSON_SOVERSION} STREQUAL ${SIMDJSON_LIB_SOVERSION})
192188
message(FATAL_ERROR "The library target does not have the proper soversion information." )
193189
endif()
190+
get_target_property(REPORTED_SIMDJSON_VERSION simdjson VERSION)
191+
if(NOT ${REPORTED_SIMDJSON_VERSION} STREQUAL ${SIMDJSON_LIB_VERSION})
192+
message(FATAL_ERROR "The library target does not have the proper version information." )
193+
endif()
194194
endif()
195195

196196
add_subdirectory(compilation_failure_tests)

tools/release.py

+50-16
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@
77
import subprocess
88
import io
99
import os
10+
import fileinput
11+
if sys.version_info < (3, 0):
12+
sys.stdout.write("Sorry, requires Python 3.x or better\n")
13+
sys.exit(1)
1014

15+
def colored(r, g, b, text):
16+
return "\033[38;2;{};{};{}m{} \033[38;2;255;255;255m".format(r, g, b, text)
1117

1218
def extractnumbers(s):
1319
return tuple(map(int,re.findall("(\d+)\.(\d+)\.(\d+)",str(s))[0]))
@@ -22,17 +28,13 @@ def topaddedversionstring(major, minor, rev):
2228
branchresult = pipe.communicate()[0].decode().strip()
2329

2430
if(branchresult != "master"):
25-
print("release on master, you are on '"+branchresult+"'")
26-
#sys.exit(-1)
27-
31+
print(colored(255, 0, 0, "We recommend that you release on master, you are on '"+branchresult+"'"))
2832

2933
ret = subprocess.call(["git", "remote", "update"])
3034

3135
if(ret != 0):
3236
sys.exit(ret)
3337

34-
35-
3638
pipe = subprocess.Popen(["git", "log", "HEAD..", "--oneline"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
3739
uptodateresult = pipe.communicate()[0].decode().strip()
3840

@@ -42,7 +44,7 @@ def topaddedversionstring(major, minor, rev):
4244

4345
pipe = subprocess.Popen(["git", "rev-parse", "--show-toplevel"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
4446
maindir = pipe.communicate()[0].decode().strip()
45-
47+
scriptlocation = os.path.dirname(os.path.abspath(__file__))
4648

4749
print("repository: "+maindir)
4850

@@ -79,7 +81,14 @@ def topaddedversionstring(major, minor, rev):
7981
atleastminor= (currentv[0] != newversion[0]) or (currentv[1] != newversion[1])
8082

8183
if(atleastminor):
82-
print("This is more than a revision.")
84+
print(colored(0, 255, 0, "This is more than a revision."))
85+
releasefile = maindir + os.sep + "RELEASES.md"
86+
releasedata = open(releasefile).read()
87+
pattern = re.compile("#\s+\d+\.\d+")
88+
m = pattern.search(releasedata)
89+
if(m == None):
90+
print(colored(255, 0, 0, "You are preparing a new minor release and you have not yet updated RELEASES.md."))
91+
sys.exit(-1)
8392

8493
versionfilerel = os.sep + "include" + os.sep + "simdjson" + os.sep + "simdjson_version.h"
8594
versionfile = maindir + versionfilerel
@@ -114,10 +123,6 @@ def topaddedversionstring(major, minor, rev):
114123

115124
print(versionfile + " modified")
116125

117-
import fileinput
118-
import re
119-
120-
121126
newmajorversionstring = str(newversion[0])
122127
mewminorversionstring = str(newversion[1])
123128
newrevversionstring = str(newversion[2])
@@ -140,24 +145,53 @@ def topaddedversionstring(major, minor, rev):
140145
sonumber += 1
141146

142147
for line in fileinput.input(cmakefile, inplace=1, backup='.bak'):
143-
line = re.sub('SIMDJSON_LIB_VERSION "\d+\.\d+\.\d+','SIMDJSON_LIB_VERSION "'+newversionstring, line.rstrip())
144-
line = re.sub('SIMDJSON_LIB_SOVERSION "\d+','SIMDJSON_LIB_SOVERSION "'+newmajorversionstring, line)
148+
line = re.sub('SIMDJSON_SEMANTIC_VERSION "\d+\.\d+\.\d+','SIMDJSON_SEMANTIC_VERSION "'+newversionstring, line.rstrip())
149+
line = re.sub('SIMDJSON_LIB_VERSION "\d+','SIMDJSON_LIB_VERSION "'+str(sonumber), line)
145150
line = re.sub('set\(PROJECT_VERSION_MAJOR \d+','set(PROJECT_VERSION_MAJOR '+newmajorversionstring, line)
146151
line = re.sub('set\(PROJECT_VERSION_MINOR \d+','set(PROJECT_VERSION_MINOR '+mewminorversionstring, line)
147152
line = re.sub('set\(PROJECT_VERSION_PATCH \d+','set(PROJECT_VERSION_PATCH '+newrevversionstring, line)
148153
line = re.sub('set\(SIMDJSON_LIB_SOVERSION \"\d+\"','set(SIMDJSON_LIB_SOVERSION \"'+str(sonumber)+'\"', line)
149154
print(line)
150155

151-
152156
print("modified "+cmakefile+", a backup was made")
157+
158+
153159
doxyfile = maindir + os.sep + "Doxyfile"
154160
for line in fileinput.input(doxyfile, inplace=1, backup='.bak'):
155161
line = re.sub('PROJECT_NUMBER = "\d+\.\d+\.\d+','PROJECT_NUMBER = "'+newversionstring, line.rstrip())
156162
print(line)
157163
print("modified "+doxyfile+", a backup was made")
158164

159-
scriptlocation = os.path.dirname(os.path.abspath(__file__))
160165

161166

162-
print("Please run the tests before issuing a release, do make test && make amalgamate_test \n")
167+
cp = subprocess.run(["bash", "amalgamate.sh"], stdout=subprocess.DEVNULL, cwd=maindir+ os.sep + "singleheader") # doesn't capture output
168+
if(cp.returncode != 0):
169+
print("Failed to run amalgamate")
170+
171+
cp = subprocess.run(["doxygen"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, cwd=maindir) # doesn't capture output
172+
if(cp.returncode != 0):
173+
print("Failed to run doxygen")
174+
175+
#ipe = subprocess.Popen(["doxygen"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=maindir)
176+
#doxygenresult = pipe.communicate()[0].decode().strip()
177+
178+
pattern = re.compile("https://simdjson.org/api/(\d+\.\d+\.\d+)/index.html")
179+
readmefile = maindir + os.sep + "README.md"
180+
readmedata = open(readmefile).read()
181+
m = pattern.search(readmedata)
182+
if m == None:
183+
print(colored(255, 0, 0, 'I cannot find a link to the API documentation in your README?????'))
184+
else:
185+
detectedreadme = m.group(1)
186+
print("found a link to your API documentation in the README file: "+detectedreadme+" ("+toversionstring(*newversion)+")")
187+
if(atleastminor):
188+
if(detectedreadme != toversionstring(*newversion)):
189+
print(colored(255, 0, 0, "Consider updating the readme link to "+toversionstring(*newversion)))
190+
191+
192+
193+
print("Please run the tests before issuing a release. \n")
163194
print("to issue release, enter \n git commit -a && git push && git tag -a v"+toversionstring(*newversion)+" -m \"version "+toversionstring(*newversion)+"\" && git push --tags \n")
195+
196+
197+

0 commit comments

Comments
 (0)