comp.lang.ada
 help / color / mirror / Atom feed
* Problem with gpr file after updating GNAT
@ 2022-12-05  8:47 Jerry
  2022-12-05 12:30 ` Egil H H
  2022-12-05 17:16 ` Simon Wright
  0 siblings, 2 replies; 4+ messages in thread
From: Jerry @ 2022-12-05  8:47 UTC (permalink / raw)


I recently upgraded my macOS GNAT from 2015 to Simon's latest offering ("if it ain't broke...") on new Apple hardware. At the same time I used Apple's Migration Assistant to transfer files. From Visual Studio Code, I use a short shell script to run gprbuild. This has worked flawlessly for quite a while. Now things are broken and I can't figure out what is wrong even after reviewing the gprbuild docs.

GPRBUILD 23.0.0 (20221109) (aarch64-apple-darwin21)

Here is the shell line invoking gprbuild
gprbuild -p /Users/me/Documents/Programs/Ada/Code/My_Projects/TextMate_Sampling/build.gpr

Here is the gpr file named build.gpr after deleting a bunch of comments  (sorry for the length);
with "MPFR_Library"; -- Multiple precision floating point ops and functions
with "GMP_Library";  -- Multiple precision integer ops and functions
with "Octave_Library"; -- Octave built-in functions (not the loadable functions from Octave)
with "GSL_Library"; -- GNU Scientific Library, installed as part of Mac Ports.

project Build is
	for Source_Dirs use 
        ("/Users/me/Documents/Programs/Ada/Code/My_Projects/TextMate_Sampling/source/",
		"/Users/me/Documents/Programs/Ada/Code/",
        "/Users/me/Documents/Programs/Ada/Code/My_Projects/TextMate_Sampling/source/Tests",
	    "/Users/me/Documents/Programs/Ada/Code/My_Projects/TextMate_Sampling/source/Other_Code",
    	"/Users/me/Documents/Programs/Ada/Code/My_Code/Specialized/Sampling",
    	"/Users/me/Documents/Programs/Ada/Code/My_Code/Specialized/Radar",
    	"/Users/me/Documents/Programs/Ada/Code/My_Code/Specialized/Sampling/Post-processing",
    	"/Users/me/Documents/Programs/Ada/Code/My_Code/My_Tools",
		"/Users/me/Documents/Programs/Ada/Code/My_Code/One-Offs",
		"/Users/me/Documents/Programs/Ada/Code/My_Code/Examples_and_Snippets_and_Notes",
    	"/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_git/plplot/bindings/ada",
    	"/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/plplot_git/plplot/examples/ada",
    	"/Users/me/Documents/Programs/Ada/Code/Bindings/PLplot/PLplot_testing/",
    	"/Users/me/Documents/Programs/Ada/Code/Bindings/GMP_and_MPFR/SVN/adabindinggmpmpfr-read-only",
    	"/Users/me/Documents/Programs/Ada/Code/Bindings/Octave/",
    	"/Users/me/Documents/Programs/Ada/Code/Bindings/GSL/");

    for Object_Dir use "build-normal";
	for Exec_Dir use "product-normal";
    for Main use ("Uniform_Aperture_Sum.adb"); -- <<< SET MAIN HERE

	package Builder is
		for Default_Switches ("Ada") use ("-O0", "-gnat12", "-g", "-gnatE", "-gnateE");
    	for Executable ("Uniform_Aperture_Sum.adb") use "run"; -- <<< AND HERE
	end Builder;

	package Compiler is
	end Compiler;
	
	package Binder is
		for Default_Switches ("Ada") use ("-E");
	end Binder;

	package Linker is
		for Default_Switches ("Ada") use ("-Wl,-no_pie"); 
	end Linker;

	package Pretty_Printer is
    	for Default_Switches ("ada") use ("--max-line-length=100", "--indentation=4",
		  "--indent-continuation=2", "--decimal-grouping=3", "--based-grouping=4", "--alignment",
		  "--RM-style-spacing", "--preserve-blank-lines", "--comments-fill", "--comments-special",
		  "--no-separate-return", "--split-line-before-op");
	end Pretty_Printer;

end Build;


Here is the path to the main program. The path is in the sources list in build.gpr.
/Users/me/Documents/Programs/Ada/Code/My_Code/Specialized/Radar/Uniform_Aperture_Sum.adb

And here is the complaint from GNAT when I try to build:
build.gpr:61:19: "Uniform_Aperture_Sum.adb" is not a source of project "build"
gprbuild: problems with main sources

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with gpr file after updating GNAT
  2022-12-05  8:47 Problem with gpr file after updating GNAT Jerry
@ 2022-12-05 12:30 ` Egil H H
  2022-12-05 17:16 ` Simon Wright
  1 sibling, 0 replies; 4+ messages in thread
From: Egil H H @ 2022-12-05 12:30 UTC (permalink / raw)


On Monday, December 5, 2022 at 9:47:44 AM UTC+1, Jerry wrote:
> I recently upgraded my macOS GNAT from 2015 to Simon's latest offering ("if it ain't broke...") on new Apple hardware. At the same time I used Apple's Migration Assistant to transfer files. From Visual Studio Code, I use a short shell script to run gprbuild. This has worked flawlessly for quite a while. Now things are broken and I can't figure out what is wrong even after reviewing the gprbuild docs. 
> 
<snip>
> 
> for Object_Dir use "build-normal"; 
> for Exec_Dir use "product-normal"; 
> for Main use ("Uniform_Aperture_Sum.adb"); -- <<< SET MAIN HERE 
> 
 I don't know much about macOS, so I don't know for sure, but maybe you need a

package Naming is
   for Casing use "MixedCase";
end Naming;

-- 
~egilhh

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with gpr file after updating GNAT
  2022-12-05  8:47 Problem with gpr file after updating GNAT Jerry
  2022-12-05 12:30 ` Egil H H
@ 2022-12-05 17:16 ` Simon Wright
  2022-12-06 10:56   ` Jerry
  1 sibling, 1 reply; 4+ messages in thread
From: Simon Wright @ 2022-12-05 17:16 UTC (permalink / raw)


Jerry <list_email@icloud.com> writes:

> And here is the complaint from GNAT when I try to build:
> build.gpr:61:19: "Uniform_Aperture_Sum.adb" is not a source of project "build"
> gprbuild: problems with main sources

I didn't get that, but I did get it if the two filenames were cased
differently (and Egil's 'package Naming' suggestion didn't fix
it). Different casing doesn't cause problems with an x86_64 gprbuild.

The reason is very probably to be found here in the GCC sources:
https://github.com/gcc-mirror/gcc/blob/master/gcc/ada/adaint.c#L599

   __gnat_get_file_names_case_sensitive (void)
   {
     if (file_names_case_sensitive_cache == -1)
       {
         const char *sensitive = getenv ("GNAT_FILE_NAME_CASE_SENSITIVE");

         if (sensitive != NULL
             && (sensitive[0] == '0' || sensitive[0] == '1')
             && sensitive[1] == '\0')
           file_names_case_sensitive_cache = sensitive[0] - '0';
         else
           {
             /* By default, we suppose filesystems aren't case sensitive on
                Windows and Darwin (but they are on arm-darwin).  */
   #if defined (WINNT) || defined (__DJGPP__) \
     || (defined (__APPLE__) && !(defined (__arm__) || defined (__arm64__)))
             file_names_case_sensitive_cache = 0;
   #else
             file_names_case_sensitive_cache = 1;
   #endif
           }
       }
     return file_names_case_sensitive_cache;
   }

which is Wrong; file names are case-insensitive on Darwin, x86_64 or
aarch64 (aka arm64).

On the other hand, it's gprbuild that's complaining.

Anyway, try "export GNAT_FILE_NAME_CASE_SENSITIVE=0".

Or, of course, you could use lower-case filenames for all Ada source.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Problem with gpr file after updating GNAT
  2022-12-05 17:16 ` Simon Wright
@ 2022-12-06 10:56   ` Jerry
  0 siblings, 0 replies; 4+ messages in thread
From: Jerry @ 2022-12-06 10:56 UTC (permalink / raw)


Both Simon's suggestion
export GNAT_FILE_NAME_CASE_SENSITIVE=0

and Egil's suggestion
package Naming is
for Casing use "MixedCase";
end Naming; 

solve the problem.

Thanks. Not sure what the underlying problems are.

Jerry

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-12-06 10:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-05  8:47 Problem with gpr file after updating GNAT Jerry
2022-12-05 12:30 ` Egil H H
2022-12-05 17:16 ` Simon Wright
2022-12-06 10:56   ` Jerry

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox