[vala/wip/abi: 1/5] compiler: Add --abi-stability option for future ABI stability enablement
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/wip/abi: 1/5] compiler: Add --abi-stability option for future ABI stability enablement
- Date: Wed, 17 Jan 2018 15:46:03 +0000 (UTC)
commit 7d85bfc7627e4a5a61812c15aa361616bc086a55
Author: Daniel Espinosa <esodan gmail com>
Date: Tue Jan 16 12:26:08 2018 -0600
compiler: Add --abi-stability option for future ABI stability enablement
https://bugzilla.gnome.org/show_bug.cgi?id=789069
compiler/valacompiler.vala | 3 +++
doc/valac.1 | 13 +++++++++++++
doc/valac.h2m | 12 ++++++++++++
vala/valacodecontext.vala | 5 +++++
4 files changed, 33 insertions(+), 0 deletions(-)
---
diff --git a/compiler/valacompiler.vala b/compiler/valacompiler.vala
index ed97374..8edb074 100644
--- a/compiler/valacompiler.vala
+++ b/compiler/valacompiler.vala
@@ -53,6 +53,7 @@ class Vala.Compiler {
static string[] gresources_directories;
static bool ccode_only;
+ static bool abi_stability;
static string header_filename;
static bool use_header;
static string internal_header_filename;
@@ -159,6 +160,7 @@ class Vala.Compiler {
{ "enable-version-header", 0, 0, OptionArg.NONE, ref enable_version_header, "Write vala build
version in generated files", null },
{ "disable-version-header", 0, 0, OptionArg.NONE, ref disable_version_header, "Do not write
vala build version in generated files", null },
{ "run-args", 0, 0, OptionArg.STRING, ref run_args, "Arguments passed to directly compiled
executeable", null },
+ { "abi-stability", 0, 0, OptionArg.NONE, ref abi_stability, "Enable support for ABI
stability", null },
{ OPTION_REMAINING, 0, 0, OptionArg.FILENAME_ARRAY, ref sources, null, "FILE..." },
{ null }
};
@@ -236,6 +238,7 @@ class Vala.Compiler {
if (ccode_only && cc_options != null) {
Report.warning (null, "-X has no effect when -C or --ccode is set");
}
+ context.abi_stability = abi_stability;
context.compile_only = compile_only;
context.header_filename = header_filename;
if (header_filename == null && use_header) {
diff --git a/doc/valac.1 b/doc/valac.1
index 0a98637..96f93c7 100644
--- a/doc/valac.1
+++ b/doc/valac.1
@@ -199,6 +199,19 @@ Do not write vala build version in generated files
.TP
\fB\-\-run\-args\fR
Arguments passed to directly compiled executeable
+.TP
+\fB\-\-abi\-stability\fR
+Enable support for ABI stability
+.RS
+This changes the current behaviour to output public members of classes and
+interfaces the same order as they appear in Vala source.
+For libraries is recommended to use \fB--abi-stability\fR to ensure the
+maintainability of the resulting Application Binary Interface (ABI).
+It is also highly recommended to use this option with the \fBordering\fR,
+\fclass_padding\fR and \finstance_padding\fR CCode attribute defails as needed.
+This option is disabled by default for backward compatibility because it can
+break ABI of existing projects.
+.RE
.SH BUGS
https://bugzilla.gnome.org/page.cgi?id=browse.html&product=vala
.SH "HOMEPAGE OR CONTACT"
diff --git a/doc/valac.h2m b/doc/valac.h2m
index 87b41b7..81bd41b 100644
--- a/doc/valac.h2m
+++ b/doc/valac.h2m
@@ -23,6 +23,18 @@ or \fB--no-color\fR are declared then \fB--color\fR=\fIauto\fR is used where
output is colored when stderr is a terminal.
.RE
+/Enable support for ABI stability/
+.RS
+This changes the current behaviour to output public members of classes and
+interfaces the same order as they appear in Vala source.
+For libraries is recommended to use \fB--abi-stability\fR to ensure the
+maintainability of the resulting Application Binary Interface (ABI).
+It is also highly recommended to use this option with the \fBordering\fR,
+\fclass_padding\fR and \finstance_padding\fR CCode attribute defails as needed.
+This option is disabled by default for backward compatibility because it can
+break ABI of existing projects.
+.RE
+
[BUGS]
https://bugzilla.gnome.org/page.cgi?id=browse.html&product=vala
diff --git a/vala/valacodecontext.vala b/vala/valacodecontext.vala
index ad6fcd4..713ba7e 100644
--- a/vala/valacodecontext.vala
+++ b/vala/valacodecontext.vala
@@ -72,6 +72,11 @@ public class Vala.CodeContext {
public bool ccode_only { get; set; }
/**
+ * Enable support for ABI stability.
+ */
+ public bool abi_stability { get; set; }
+
+ /**
* Output C header file.
*/
public string? header_filename { get; set; }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]