[erlang-patches] public_key build problem

Per Hedeland <>
Thu Aug 18 09:57:22 CEST 2011


Hello,

Perhaps not of general interest, but if you run "./otp_build
remove_prebuilt_files" and then try to build with ERL_COMPILE_FLAGS set
to +slim, the public_key build fails with this nice error message:

Error: Merge by igor module failed due to {{badmatch,false},
                                           [{filename,try_file,4},
                                            {igor,read_module,2},
                                            {igor,
                                             '-merge_files/4-lc$^0/1-0-',2},
                                            {igor,
                                             '-merge_files/4-lc$^0/1-0-',2},
                                            {igor,merge_files,4},
                                            {igor,merge,3},
                                            {asn1ct,inline,4},
                                            {asn1ct,check_set,8}]}

Problem exists in at least R14B03 (probably all R14 and maybe earlier).
To make matters slightly worse, if you retry the build at this point, it
succeeds, but presumably with a broken public_key, since it will have
used the half-baked OTP-PUB-KEY.erl that was produced in spite of the
above error. Suggested trivial fix below (sorry no git) - might not be
the absolutely most correct one, since it arguably causes
filename:find_src/2 to fail to fulfill its spec (but "igor" doesn't care
about the options in any case).

--Per Hedeland

--- lib/stdlib/src/filename.erl.ORIG	2011-05-24 13:16:43.000000000 +0200
+++ lib/stdlib/src/filename.erl	2011-08-16 16:47:22.000000000 +0200
@@ -834,7 +834,12 @@
     end;
 try_file(Src, _ObjFilename, Mod, _Rules) ->
     List = Mod:module_info(compile),
-    {options, Options} = lists:keyfind(options, 1, List),
+    Options = case lists:keyfind(options, 1, List) of
+		  {options, Opts} ->
+		      Opts;
+		  _ ->
+		      []
+	      end,
     {ok, Cwd} = file:get_cwd(),
     AbsPath = make_abs_path(Cwd, Src),
     {AbsPath, filter_options(dirname(AbsPath), Options, [])}.



More information about the erlang-patches mailing list