Skip to content

Excluded_Source_Dirs appears to be broken #1131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
brownts opened this issue Feb 28, 2023 · 4 comments
Closed

Excluded_Source_Dirs appears to be broken #1131

brownts opened this issue Feb 28, 2023 · 4 comments
Assignees
Labels

Comments

@brownts
Copy link

brownts commented Feb 28, 2023

Starting with v23.0.14, it appears valid paths specified in Excluded_Source_Dirs are considered invalid, causing the project file to fail to be loaded. I assume this is also related to the libgpr2 switch in the latest version.

Attached is a screenshot and reproducer for this issue with a simple project.

path_test.zip

excluded_source_dirs

@AnthonyLeonardoGracio
Copy link
Collaborator

Hello,

It seems like the problem is how GPR2 handles Project'Project_Dir. Switching from :

for Excluded_Source_Dirs use (Project'Project_Dir & "src/dir2");

to:

for Excluded_Source_Dirs use ("src/dir2");

makes things work. So you ca use that as workaround until we fix the issue in GPR2.

Regards,

@brownts
Copy link
Author

brownts commented Mar 22, 2023

Hi @AnthonyLeonardoGracio, thanks for the follow-up. I think your work-around would work for this simple example, however in practice we use this differently. We often have an abstract project which might contain a list of source files, but that list is used in a different project file and used in an Excluded_Source_Dirs declaration there. For example something like this:

abstract project A is
  Xsrc := (Project'Project_Dir & "src/dir2");
end A;

with "../some/where/else/a.gpr";
project B is
  ...
  for Excluded_Source_Dirs use A.Xsrc;
  ...
end B;

In this case we can't rely on the relative path from the project file where the Excluded_Source_Dirs attribute declaration resides as the two project files may be in different directories. That is why we prefix the relative path with Project'Project_Dir.

Do you have a workaround suggestion for this type of situation?

@AnthonyLeonardoGracio
Copy link
Collaborator

Hello @brownts,

Unfortunately we don't have any workaround for your use-case. We'll talk to the GPR team to raise the priority on this!

Regards,

@AnthonyLeonardoGracio
Copy link
Collaborator

Hello @brownts,

This should now be fixed in the latest version of the extension.

Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants