176 Commits

Author SHA1 Message Date
Ingy döt Net 690a781ef6 Update configure.ac for 0.2.2 0.2.2 2019-03-12 18:04:00 -07:00
Tina Müller 24a020a1a2 Changes for v0.2.2 release 2019-03-12 22:05:30 +01:00
Matt Davis e7a5f0bc0b Merge pull request #136 from nitzmahone/win_fixes
allow override of Windows static lib name
0.2.2-pre3
2019-03-04 08:03:10 -08:00
Matt Davis 99e0a150ff allow override of Windows static lib name
* also changed name back to original default of yaml, as the change in #10 to `yaml_static` broke things that relied on that
2019-03-01 17:32:13 -08:00
Tina Müller 78e6ebfb20 Remove stdbool
Might not be available everywhere
0.2.2-pre2
2019-02-28 19:50:04 +01:00
Tina Müller 1560fc82ad Make declarations before other statements 2019-02-28 19:40:53 +01:00
Marty E. Plummer 85d1f168ef appveyor.yml: fix Release build
I suspect this this was a bit of an oversight when first setting up
appveyor for Windows/msvc, but 'release' does not match any target
cmake knows about; 'Release', however, does.

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
2018-07-19 14:53:50 -07:00
Marty E. Plummer 12dc1bef1f build: do not install config.h
'config.h' is meant to be a convenience header to be #included at build
time, but not installed. Installing it can cause a host of problems for
various other projects (for instance, attempting to build u-boot from
source while another project's 'config.h' exists in the compiler search
path will cause build failures similar to:
https://github.com/pepe2k/u-boot_mod/issues/148

Further, I've changed '#include <config.h>' to '#include "config.h"',
which should constrain the search path to the current build directories,
so if another package with a bugged build has this file installed, it
will not cause yaml to miscompile/fail.

If you have a file `/usr/include/config.h` on your filesystem, query
your package manager to find out what package owns it, and file a bug
report against it with your distro maintainers.

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
2018-07-19 14:49:53 -07:00
Tina Müller df5c05e120 Fix unconditional yaml_free()
Thanks to @tlsa for spotting this
2018-07-18 23:36:58 +02:00
Reini Urban f033001839 fix version_directive memory leak
detected by coverity
2018-07-18 22:10:31 +02:00
Florian Weimer 96a49a1d9c yaml_stack_extend: guard against integer overflow 2018-07-18 21:56:11 +02:00
Reini Urban 5b8859f728 fix C++ g++-6 errors
yaml_emitter_write_indicator const char *indicator
2018-07-18 21:26:40 +02:00
Reini Urban 551ad48994 fix clang -Wlogical-op warnings
Commit amended by @perlpunk after suggestion from @tlsa
2018-07-18 21:22:15 +02:00
Reini Urban 75eddf785f fix C++-compat error
we cannot malloc to an anon struct in C++.
typedef yaml_anchors_t
2018-07-17 23:08:09 +02:00
Tina Müller 20496ee288 Allow colons in plain scalars inside flow collections
This is a followup to #28

See http://yaml.org/spec/1.1/#nb-plain-char(c) and the following
productions.

This commit will allow `[http://example]`, but still fail for:
- `[:foo]`
- `[foo:]`

See https://gist.github.com/perlpunk/de2c631a7b0e9002de351a680eadb573
for all the relevant cases where this change applies.
0.2.2-pre1
2018-06-30 15:12:39 -07:00
Reini Urban 31bb2aaa34 Fix yaml_document_delete
Remove unneeded context, which is not set in any macro.
2018-06-30 14:47:34 -07:00
Tina Müller 1049e04067 Fix comparison in tests/run-emitter.c 2018-06-30 14:47:34 -07:00
whiteUnicorn 4657431277 Fix typo error
nessesary to necessary
2018-06-30 14:47:34 -07:00
Tina Müller baf636a74b The closing single quote needs to be indented...
if it's on its own line.

```
% cd libyaml
% echo "+STR
+DOC
+SEQ
=VAL '\\\n
-SEQ
-DOC
-STR" | ./tests/run-emitter-test-suite
- '

'
% # fix
% make
...

% echo "+STR
+DOC
+SEQ
=VAL '\\\n
-SEQ
-DOC
-STR" | ./tests/run-emitter-test-suite
- '

  '
```
2018-06-30 14:47:33 -07:00
Viktor Szakats 2e849b3651 Fix token name typos in comments 2018-06-30 14:47:25 -07:00
Tina Müller 56f4b17221 Don't emit document-end marker at the end of stream
(only when explicitly requested)

@jrtc27++ for the patch.

See #60
2018-06-30 00:16:34 +02:00
Tina Müller 8ee83c0da2 Revert removing of open_ended after top level plain scalar
See also issue #60

Revert "This code is not needed and breaks tests"

This reverts commit 56400d976a.
2018-06-29 21:44:19 +02:00
Ingy döt Net f6e09f829b Changes for 0.2.1 release 0.2.1 2018-06-26 14:43:59 -07:00
Éric Thiébaut 83d3d38838 Fix two typos in header comments. (#120) 2018-06-25 00:44:49 -04:00
Roger Peppe 01f3a87861 Remove need for PTRDIFF_MAX
It's just as easy to calculate the maximum value directly.
2018-01-11 09:36:31 -08:00
Marty E. Plummer d050fe3f30 Major cleanup of .gitignore
You don't need to specify full paths to files if you do it like this.
Wildcard away most of the stuff you can, and for stuff you can't easily
wildcard, be as generic as you can.

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
2018-01-09 22:36:33 -08:00
William Roberts 639981a546 Update libyaml homepage link in README
Update the link to point where libyaml is now maintained. Per the old
link, "LibYAML is now maintained at https://github.com/yaml/libyaml.
This page is left for historical purposes."
2018-01-09 21:03:41 -08:00
Marty E. Plummer d9c23d9197 Add mingw-w64 builds to appveyor.yml
Currently the cygwin autoconf builds only test builds of cygwin-native
binaries, and not mingw-w64 pure windows binaries. The resultant
cygyaml-0-2.dll has a runtime dep on the cygwin1.dll which is generally
not appropriate for the purpose of distribution. Building with mingw-w64
produces libraries with no dependency on the cygwin runtime.

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
2018-01-08 21:07:58 -08:00
Reini Urban fc2dd942fc Fixed most compiler warnings -Wall -Wextra
repro:
  CFLAGS="-Wall -Wextra -Wunused-parameter -Wc++-compat" ./configure && make

which we use for perl, and libyaml is now included in cperl.
Tested with gcc-5 and clang-3.7

There are still a tons of format warnings (%d on 64bit) in
example-deconstructor.c which I skipped.
2018-01-08 10:44:25 -08:00
Andy Grundman 2b8b563222 Compilation fix for Solaris
From https://github.com/ingydotnet/yaml-libyaml-pm/issues/24
2018-01-08 10:37:15 -08:00
Ingy döt Net a9a9b271fe Docker test file changes (added alpine testing)
Also reworked all the dockerfiles to be cleaner and consistent:

* Fixed some indentation
* Removed vim dependencies
* Collapsed RUN steps for less build layers
* Renamed dockerfiles/ to shorter and more adaptable docker/
2018-01-08 00:21:04 -08:00
Marty E. Plummer a70c7f36cb add -no-undefined to src/Makefile.am
Without this change building a dll with the mingw-w64 toolchain is
impossible. All tests from make test-all succeed on native linux
(Gentoo amd64 glibc default/linux/amd64/17.1/desktop gcc-7.2.0)

Signed-off-by: Marty E. Plummer <hanetzer@protonmail.com>
2018-01-06 22:43:18 -06:00
Ingy döt Net aa10f65706 Fix problems in CI failures (travis and semaphore)
In the Makefile.am, switched out the fetch (which can have auth problems
in certain envs) with a simple branch per @perlpunk++'s suggestion.

With the new test branches, travis had a problem in that it only clones
one branch and we need the other branch refs to be available. Fixed this
by fetching the other branch refs. I also cleaned up the travis YAML
file.

The Ubuntu 14.04 docker image (used by semaphoreci) had an older git,
without the worktree command, so I made it install the latest git from a
ppa.

Renamed tests/run-tests.sh to tests/run-all-tests.sh for tab completion
conflict reasons.
2018-01-06 14:39:12 -08:00
Ingy döt Net e4aee06ff4 Move tests/run-test-suite to branch run-test-suite
with the intent that `make test-suite` will use it as a branch.

This commit makes the libyaml and yaml-test-suite repos completely
independent. The only thing in master is a Makefile rule for
`make run-test-suite`.

The run-test-suite branch takes care of everything else.

This will keep the master branch history clean from any yaml-test-suite
activity, while keeping everything up to date.

Pinning will just work for whatever commit of master you run the tests
from. The pinning work will all be done in the `run-test-suite` branch.
2017-12-29 19:58:07 -08:00
Tina Müller 6a9e942e27 Replace Mercurial with Git in README 2017-12-26 02:37:51 +01:00
Tina Müller 61dd999bfe Update libyaml-{parser,emitter}.list
yaml-test-suite/data commit:
daf799e 2017-12-23 "Regenerated data from master 1eacbab"
2017-12-23 17:21:39 +01:00
Tina Müller 5672b16382 Define PTRDIFF_MAX if it's not in stdint.h
Seems to be the case on HP-UX
2017-12-23 01:48:59 +01:00
Tina Müller 6cc8b63ff7 Forbid escaped singlequote in doublequotes
See also issue #68
2017-12-02 22:26:25 +01:00
Tina Müller e5aadc7349 Rewrite make test-suite
No recursive make anymore

Remove MY_LD_LIBRARY_PATH and friends

This is now done by the wrapper script

Remove LIBYAML_DIR variable

not needed anymore

Merge ReadMe.md files to one
2017-12-02 22:23:23 +01:00
Tina Müller fd5bf68a30 Skip 5 tests in libyaml-emitter.list 2017-12-01 14:33:19 +01:00
Jean-Christophe Fillion-Robin fe3d086fa7 Improve CMake build system
New build options
-----------------

* Add option BUILD_TESTING by default ON
See https://cmake.org/cmake/help/v2.8.12/cmake.html#module:CTest

* Simplify library type selection using standard option BUILD_SHARED_LIBS
See https://cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html

yamlConfig.cmake
----------------

* Generate and install yamlConfig.cmake, yamlConfigVersion.cmake and yamlTargets.cmake

* Bump CMake version and explicitly associate include dirs with targets
See https://cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html#include-directories-and-usage-requirements

* Ensure building against libyaml using "find_package(yaml)" uses expected compile options: Set HAVE_CONFIG_H
as private compile option, YAML_DECLARE_STATIC as public

Testing
-------

* Build all examples from "tests" directory

CMake Best practices
--------------------

* configure "config.h" based on version info found in CMakeLists.txt

* Ensure buildsystem re-generation listing sources (best-practice)

It is not recommended to use GLOB to collect a list of source files from
the source tree. If no CMakeLists.txt file changes when a source is added
or removed then the generated build system cannot know when to ask CMake
to regenerate.

See https://cmake.org/cmake/help/v3.8/command/file.html

Compilation warnings
--------------------

* Set _CRT_SECURE_NO_WARNINGS if building using VisualStudio

This will avoid warnings like this one:

```
C:\projects\libyaml\tests\run-emitter.c(268): warning C4996: 'fopen':
This function or variable may be unsafe. Consider using fopen_s instead.
To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for
details.
```

Continuous Integration
----------------------

* travis: Install CMake >= 3.x using scikit-ci-addons

* Add comments to appveyor.yml and run-tests.sh
2017-11-30 07:14:27 -06:00
Ingy döt Net 660242d6a4 Remove deleted test from parser test list. 2017-05-14 13:57:12 +02:00
Ian Cordasco 6bbc217fc7 Fix unitialized value crash found by OSS Fuzz
Google's OSS Fuzz project found input for libyaml that was capable of
triggering an uninitialized value crash.

Patch provided by Alex Gaynor
2017-05-13 18:27:08 -05:00
Anthony Hendrickson 119b7b6adf Updates defs for MingGW support on Windows
addresses issue #52
2017-03-10 16:12:57 -05:00
John Kirkham 300bd3f89e cmake: Provide support for building dynamic and static libraries. 2017-02-22 00:00:03 -05:00
Ingy döt Net c9878e19bd Switch test-suite run list from black to whitelist
This way as the test suite grows, new tests won't disturb/break our
testing.
2017-02-09 08:24:33 -08:00
Ingy döt Net 7b67c28a39 Skip edge case test M7A3 2017-01-18 18:02:04 +01:00
Ingy döt Net ed44fa2ddf Add reminder when user is using GNUmakefile 2017-01-02 10:46:29 -08:00
Ingy döt Net de19e70b6d Add a .makefile for immediate make targets
We can add various development activities to this alternate Makefile.

If you do this first:
```
ln {.,GNU}makefile
```

then you can use the new targets and the old ones without specifying the
`.makefile` in make commands and without worrying about bootstrap.

ie Before this, to use Makefile targets, you needed to run `./bootstrap`
and `./configure` first. This file will proxy all common Makefile
targets, first making sure that the Makefile exists.
2017-01-02 10:29:32 -08:00
Ingy döt Net 2fc6dc0885 Add fedora dockerfile from PR #43 2016-12-30 16:41:06 -06:00