Hello community, here is the log from the commit of package ocaml-obuild for openSUSE:Factory checked in at 2019-03-22 15:09:36 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ocaml-obuild (Old) and /work/SRC/openSUSE:Factory/.ocaml-obuild.new.25356 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ocaml-obuild" Fri Mar 22 15:09:36 2019 rev:3 rq:687319 version:0.1.10 Changes: -------- --- /work/SRC/openSUSE:Factory/ocaml-obuild/ocaml-obuild.changes 2018-07-13 10:20:59.642429813 +0200 +++ /work/SRC/openSUSE:Factory/.ocaml-obuild.new.25356/ocaml-obuild.changes 2019-03-22 15:09:44.613371179 +0100 @@ -1,0 +2,8 @@ +Thu Mar 21 12:51:03 UTC 2019 - [email protected] + +- Update to 0.1.10: + * Parse warning in META file. +- Add b40c69380f724933c462ede4b926e3c4f4182d09.patch to enable + reproducible builds (bsc#1087961). + +------------------------------------------------------------------- Old: ---- ocaml-obuild-0.1.9.tar.gz New: ---- b40c69380f724933c462ede4b926e3c4f4182d09.patch ocaml-obuild-0.1.10.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ocaml-obuild.spec ++++++ --- /var/tmp/diff_new_pack.6UWRnP/_old 2019-03-22 15:09:45.173370695 +0100 +++ /var/tmp/diff_new_pack.6UWRnP/_new 2019-03-22 15:09:45.173370695 +0100 @@ -1,7 +1,7 @@ # # spec file for package ocaml-obuild # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -15,8 +15,9 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # + Name: ocaml-obuild -Version: 0.1.9 +Version: 0.1.10 Release: 0 %{?ocaml_preserve_bytecode} Summary: Package build system for OCaml @@ -25,10 +26,14 @@ URL: https://github.com/ocaml-obuild/obuild Source0: https://github.com/ocaml-obuild/obuild/archive/obuild-v%{version}/%{name}-%{version}.tar.gz + +# Enable reproducible builds. Already applied upstream. +Patch0: https://github.com/ocaml-obuild/obuild/commit/b40c69380f724933c462ede4b926e3c4f4182d09.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-build -BuildRequires: ocaml BuildRequires: help2man +BuildRequires: ocaml BuildRequires: ocaml-rpm-macros %description @@ -41,12 +46,11 @@ %prep %setup -q -n obuild-obuild-v%{version} - +%patch0 -p1 %build ./bootstrap - %install mkdir -p %{buildroot}/%{_bindir} cp "dist/build/obuild/obuild" "dist/build/obuild-simple/obuild-simple" "%{buildroot}/%{_bindir}" @@ -67,7 +71,6 @@ --no-info \ dist/build/obuild-simple/obuild-simple - %files %defattr(-,root,root,-) %doc README.md OBUILD_SPEC.md DESIGN.md @@ -75,5 +78,4 @@ %{_bindir}/* %{_mandir}/man1/*.1* - %changelog ++++++ b40c69380f724933c462ede4b926e3c4f4182d09.patch ++++++ >From b5d17ea03601af1519d2f7a51d9fcee28283e0dc Mon Sep 17 00:00:00 2001 From: Andy Li <[email protected]> Date: Tue, 19 Mar 2019 22:39:11 +0800 Subject: [PATCH] Always sort readdir results in order to get reproducible builds. (#175) --- ext/filesystem.ml | 30 ++++++------------------------ obuild/project.ml | 2 +- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/ext/filesystem.ml b/ext/filesystem.ml index 1a9412a..5914d8c 100644 --- a/ext/filesystem.ml +++ b/ext/filesystem.ml @@ -33,17 +33,9 @@ let removeDirContent wpath = let removeDir path = removeDirContent path; Unix.rmdir (fp_to_string path); () let iterate f path = - let dirhandle = Unix.opendir (fp_to_string path) in - (try - while true do - let ent = Unix.readdir dirhandle in - if ent <> ".." && ent <> "." - then f (fn ent) - done; - with End_of_file -> - () - ); - Unix.closedir dirhandle; + let entries = Sys.readdir (fp_to_string path) in + Array.fast_sort String.compare entries; + Array.iter (fun ent -> f (fn ent)) entries; () (* list directory entry with a map function included for efficiency *) @@ -62,19 +54,9 @@ let list_dir_pred (p : filename -> bool) path : filename list = let list_dir = list_dir_pred (const true) let list_dir_path_pred p path = - let accum = ref [] in - let dirhandle = Unix.opendir (fp_to_string path) in - (try - while true do - let ent = Unix.readdir dirhandle in - if ent <> ".." && p ent - then accum := (path </> fn ent) :: !accum - done; - with End_of_file -> - () - ); - Unix.closedir dirhandle; - !accum + let entries = List.filter p (Array.to_list (Sys.readdir (fp_to_string path))) in + let sorted = List.fast_sort String.compare entries in + List.map (fun ent -> path </> fn ent) sorted let list_dir_path = list_dir_path_pred (const true) diff --git a/obuild/project.ml b/obuild/project.ml index acec79d..a2d3744 100644 --- a/obuild/project.ml +++ b/obuild/project.ml @@ -440,7 +440,7 @@ let make = { } let findPath () = - let ents = Array.to_list (Sys.readdir ".") in + let ents = List.fast_sort String.compare (Array.to_list (Sys.readdir ".")) in match List.find_all (fun ent -> not (string_startswith "." ent) && string_endswith ".obuild" ent) ents with | [] -> raise NoConfFile | [x] -> fp x ++++++ ocaml-obuild-0.1.9.tar.gz -> ocaml-obuild-0.1.10.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obuild-obuild-v0.1.9/obuild/meta.ml new/obuild-obuild-v0.1.10/obuild/meta.ml --- old/obuild-obuild-v0.1.9/obuild/meta.ml 2017-11-20 22:40:26.000000000 +0100 +++ new/obuild-obuild-v0.1.10/obuild/meta.ml 2018-04-25 12:19:02.000000000 +0200 @@ -86,6 +86,7 @@ browse_interface : string; type_of_threads : string; archives : (Predicate.t list * string) list; + warning : (Predicate.t list * string) list; append_archives : (Predicate.t list * string) list; version : string; assignment : (string * string) list; @@ -106,6 +107,7 @@ exists_if = ""; archives = []; append_archives = []; + warning = []; version = ""; assignment = []; subs = []; @@ -354,6 +356,15 @@ | ID "directory" :: EQ :: S dir :: xs -> parse pkg_name { acc with Pkg.directory = dir } xs | ID "description" :: EQ :: S dir :: xs -> parse pkg_name { acc with Pkg.description = dir } xs | ID "browse_interfaces" :: EQ :: S _ :: xs -> parse pkg_name acc xs + | ID "warning" :: xs -> ( + let (preds, xs2) = parse_predicate_list pkg_name "archive" xs in + match xs2 with + | EQ :: S v :: xs3 -> + let nacc = { acc with Pkg.warning = acc.Pkg.warning @ [(preds, v)] } in + parse pkg_name nacc xs3 + | _ -> raise (MetaParseError (pkg_name, "parsing warning failed")) + ) + | ID "archive" :: xs -> ( let (preds, xs2) = parse_predicate_list pkg_name "archive" xs in match xs2 with diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/obuild-obuild-v0.1.9/tests/test_find.ml new/obuild-obuild-v0.1.10/tests/test_find.ml --- old/obuild-obuild-v0.1.9/tests/test_find.ml 2017-11-20 22:40:26.000000000 +0100 +++ new/obuild-obuild-v0.1.10/tests/test_find.ml 2018-04-25 12:19:02.000000000 +0200 @@ -76,6 +76,42 @@ let num_answer = Meta.Pkg.get_archive_with_filter (None, num) (Libname.of_string "num.core") [Meta.Predicate.Native; Meta.Predicate.Plugin] in assumeEq "num plugin native" "archive(plugin,native) = [nums.cmxs]" (archives_to_string num_answer); + let meta_threads = "# Specifications for the \"threads\" library:\n\ + version = \"[distributed with Ocaml]\"\n\ + description = \"Multi-threading\"\n\ + requires(mt,mt_vm) = \"threads.vm\"\n\ + requires(mt,mt_posix) = \"threads.posix\"\n\ + directory = \"^\"\n\ + type_of_threads = \"posix\"\n\ + \n\ + browse_interfaces = \" Unit name: Condition Unit name: Event Unit name: Mutex Unit name: Thread Unit name: ThreadUnix \"\n\ + \n\ + warning(-mt) = \"Linking problems may arise because of the missing -thread or -vmthread switch\"\n\ + warning(-mt_vm,-mt_posix) = \"Linking problems may arise because of the missing -thread or -vmthread switch\"\n\ + \n\ + package \"vm\" (\n\ + \ # --- Bytecode-only threads:\n\ + \ requires = \"unix\"\n\ + \ directory = \"+vmthreads\"\n\ + \ exists_if = \"threads.cma\"\n\ + \ archive(byte,mt,mt_vm) = \"threads.cma\"\n\ + \ version = \"[internal]\"\n\ + )\n\ + \n\ + package \"posix\" (\n\ + \ # --- POSIX-threads:\n\ + \ requires = \"unix\"\n\ + \ directory = \"+threads\"\n\ + \ exists_if = \"threads.cma\"\n\ + \ archive(byte,mt,mt_posix) = \"threads.cma\"\n\ + \ archive(native,mt,mt_posix) = \"threads.cmxa\"\n\ + \ version = \"[internal]\"\n\ + )\n" in + let threads = Meta.parse (Filepath.fp "threads") meta_threads "threads" in + let threads_answer = Meta.Pkg.get_archive_with_filter (None, threads) (Libname.of_string "threads.posix") + [Meta.Predicate.Native; Meta.Predicate.Mt; Meta.Predicate.Mt_posix] in + assumeEq "threads native" "archive(native,mt,mt_posix) = [threads.cmxa]" (archives_to_string threads_answer); + let meta_ctypes = "\ version = \"0.4\"\n\
