Skip to content

macOS: minor fixes for < 10.9 #179

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

Merged
merged 3 commits into from
Sep 13, 2024
Merged

macOS: minor fixes for < 10.9 #179

merged 3 commits into from
Sep 13, 2024

Conversation

barracuda156
Copy link
Contributor

@gaborcsardi Could you please take a look? I hope the patch is minimal enough. With this, ps builds on my 10.6 ppc.

@barracuda156
Copy link
Contributor Author

ObjC should simply not be used outside of MacOS, so I do not really get why this warning:

❯ checking compilation flags in Makevars ... WARNING
  Non-portable flags in variable 'PKG_OBJCFLAGS':
    -std=c11

0 errors ✔ | 1 warning ✖ | 0 notes ✔
Error: Error: R CMD check found WARNINGs
Execution halted
Error: Process completed with exit code 1.

What should I do to fix this though?

@barracuda156 barracuda156 mentioned this pull request Sep 13, 2024
22 tasks
@gaborcsardi
Copy link
Member

IDK, sorry, possibly a base R bug. Maybe there is a way to do what you want without that flag? Why do you need it?

@barracuda156
Copy link
Contributor Author

barracuda156 commented Sep 13, 2024

@gaborcsardi No, it is nothing about R, the compiler explicitly requires that:

/opt/local/bin/gcc-mp-13 -I"/opt/local/Library/Frameworks/R.framework/Resources/include" -DNDEBUG   -isystem/opt/local/include/LegacySupport -I/opt/local/include    -fPIC  -pipe -Os -arch ppc -fobjc-exceptions  -c arch/macos/apps.m -o arch/macos/apps.o
arch/macos/apps.m: In function 'ps__list_apps':
arch/macos/apps.m:40:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
   40 |   for (NSUInteger i = 0; i < count; i++) {
      |   ^~~
arch/macos/apps.m:40:3: note: use option '-std=c99', '-std=gnu99', '-std=c11' or '-std=gnu11' to compile your code
make: *** [arch/macos/apps.o] Error 1

UPD. Or if you mean the CI error is an R bug, that could be, I cannot say. Could we set the standard for ObjC without passing any flags?

@gaborcsardi
Copy link
Member

And none of those options are portable according to R? Maybe you can specify that option in your own .R/Makevars file, and then the package does not need the change.

@barracuda156
Copy link
Contributor Author

And none of those options are portable according to R? Maybe you can specify that option in your own .R/Makevars file, and then the package does not need the change.

But that will leave the build with gcc broken for everyone else, completely unnecessarily.

@gaborcsardi
Copy link
Member

Well, we cannot add it to the package if it fails the CRAN checks.

@barracuda156
Copy link
Contributor Author

Well, we cannot add it to the package if it fails the CRAN checks.

Yeah, I understand that, there should be a way to add it correctly (according to CRAN).
Let me drop this commit from here, it can be dealt with separately, since it is a separate issue.

@gaborcsardi
Copy link
Member

If it is needed for one kind of compiler, then I think it either belongs to the user Makevars file, or the system Makevars file. E.g. I don't know how you are compiling R, and it could be set there, and then it'll be the default for that R installation.

@barracuda156
Copy link
Contributor Author

If it is needed for one kind of compiler, then I think it either belongs to the user Makevars file, or the system Makevars file. E.g. I don't know how you are compiling R, and it could be set there, and then it'll be the default for that R installation.

I have dropped that commit now.

P. S. The issue with ObjC is that on its own it does not require a specific standard (when aqua module is built), so R config won’t have it. It is also possible, I think, to build R on macOS without aqua at all, and then ObjC compiler is not used during building R itself. But it still will be pulled in here in ps.

@gaborcsardi
Copy link
Member

Sure, but you can still specify the default OBJC flags when building R, whether it is used or not. Just to have a good default for packages.

@barracuda156
Copy link
Contributor Author

barracuda156 commented Sep 13, 2024

Sure, but you can still specify the default OBJC flags when building R, whether it is used or not. Just to have a good default for packages.

We can definitely have a local fix for ObjC issue in MacPorts, no problem.

@gaborcsardi gaborcsardi merged commit 54d9305 into r-lib:main Sep 13, 2024
15 checks passed
@gaborcsardi
Copy link
Member

Thank you!

@barracuda156 barracuda156 deleted the apple branch September 13, 2024 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants