Skip to content

Update compiler_wrapper/cc.sh: choose compiler in mode 'ld'#2165

Open
climbfuji wants to merge 9 commits into
spack:developfrom
climbfuji:patch-1
Open

Update compiler_wrapper/cc.sh: choose compiler in mode 'ld'#2165
climbfuji wants to merge 9 commits into
spack:developfrom
climbfuji:patch-1

Conversation

@climbfuji
Copy link
Copy Markdown
Contributor

@climbfuji climbfuji commented Oct 29, 2025

Description

Fixes an issue when checking which compiler is configured when the compiler wrapper is invoked in ld mode. Without this bug fix, spack assumes that a package that doesn't depend on C must depend on CXX. But there are packages that depend on Fortran only.

Testing

Tested for a package that depends on Fortran only and that invokes ld directly during the build.

Because this is such an important script in spack, I suggest that more folks test this thoroughly.

## Description 

Fixes **issue to be created** by checking which compiler is configured when the compiler wrapper is invoked in `ld` mode.

## Testing

Tested for a package that depends on Fortran only and that invokes `ld` directly during the build.
@climbfuji
Copy link
Copy Markdown
Contributor Author

@spackbot run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app Bot commented Oct 29, 2025

I'm sorry, gitlab does not have your latest revision yet, I can't run that pipeline for you right now.

One likely possibility is that your PR pipeline has been temporarily deferred, in which case, it is awaiting a develop pipeline, and will be run when that finishes.

Please check the gitlab commit status message to see if more information is available.

Details
Unexpected response from gitlab: {'message': '404 Commit Not Found'}

@climbfuji climbfuji marked this pull request as ready for review October 29, 2025 11:40
@climbfuji
Copy link
Copy Markdown
Contributor Author

@spackbot run pipeline

@spackbot-app
Copy link
Copy Markdown

spackbot-app Bot commented Oct 29, 2025

I'm sorry, gitlab does not have your latest revision yet, I can't run that pipeline for you right now.

One likely possibility is that your PR pipeline has been temporarily deferred, in which case, it is awaiting a develop pipeline, and will be run when that finishes.

Please check the gitlab commit status message to see if more information is available.

Details
Unexpected response from gitlab: {'message': '404 Commit Not Found'}

@climbfuji climbfuji requested a review from becker33 October 29, 2025 11:40
Comment thread repos/spack_repo/builtin/packages/compiler_wrapper/cc.sh Outdated
Copy link
Copy Markdown
Member

@becker33 becker33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably use the -n operator instead of negating the -z operator.

Comment thread repos/spack_repo/builtin/packages/compiler_wrapper/cc.sh Outdated
Co-authored-by: Greg Becker <becker33@llnl.gov>
becker33
becker33 previously approved these changes Oct 30, 2025
alalazo
alalazo previously requested changes Nov 4, 2025
Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do a full rebuild here, since the compiler wrapper is used everywhere. Also, I'm surprised this works given we didn't update the shasum. 🤔

@becker33
Copy link
Copy Markdown
Member

becker33 commented Nov 5, 2025

@alalazo are there any packages in CI that use the linker but don't depend on C? I imagine we would've hit this issue already if there were, and if there aren't then this isn't going to change anything in CI. We can do the full rebuild to confirm.

@alalazo
Copy link
Copy Markdown
Member

alalazo commented Nov 5, 2025

I think there might be packages that depend on C++ only and use the linker in CI, but that was covered.

@climbfuji
Copy link
Copy Markdown
Contributor Author

@alalazo @becker33 Is there anything I can do to advance this pull request?

@becker33
Copy link
Copy Markdown
Member

becker33 commented Dec 3, 2025

@climbfuji can you update the sha in the version directive for this package to reflect the new changes, and bump the version number to 1.1?

@climbfuji
Copy link
Copy Markdown
Contributor Author

@climbfuji can you update the sha in the version directive for this package to reflect the new changes, and bump the version number to 1.1?

I am happy to do that, but slightly embarrassed that I don't know how to get the updated sha.

@becker33
Copy link
Copy Markdown
Member

becker33 commented Dec 4, 2025

shasum -a 256 $(spack location -p compiler-wrapper)/cc.sh should give you what you want.

@climbfuji
Copy link
Copy Markdown
Contributor Author

shasum -a 256 $(spack location -p compiler-wrapper)/cc.sh should give you what you want.

Thanks very much. I hope I got it all right.

@climbfuji climbfuji requested a review from becker33 December 10, 2025 12:30
@climbfuji
Copy link
Copy Markdown
Contributor Author

@becker33 Anything else I can do to move this PR forward?

@climbfuji
Copy link
Copy Markdown
Contributor Author

@alalazo @becker33 Can you please advise what to do with this PR? There's now a merge conflict, because apparently v1.0 got updated/had the hash changed. I still think we need the changes here, unless you've made updates that solve the problem in other ways.

@climbfuji
Copy link
Copy Markdown
Contributor Author

@becker33 @alalazo This has gone stale. I think it's still relevant. If so, what do I need to do? Thanks.

becker33
becker33 previously approved these changes Apr 28, 2026
@becker33 becker33 enabled auto-merge (squash) April 28, 2026 13:15
auto-merge was automatically disabled April 28, 2026 19:25

Head branch was pushed to by a user without write access

@spackbot-triage spackbot-triage Bot requested a review from haampie April 28, 2026 19:26
@climbfuji
Copy link
Copy Markdown
Contributor Author

I merged spack develop into my branch, fixed the merge conflict, and updated the shasum.

@becker33
Copy link
Copy Markdown
Member

In the long run we need to make this file properly versioned in its own repo, but I don't think that's a change to enforce on this PR.

@becker33 becker33 enabled auto-merge (squash) April 29, 2026 11:53
@alalazo alalazo dismissed their stale review April 29, 2026 13:31

Review is outdated

@alalazo
Copy link
Copy Markdown
Member

alalazo commented May 27, 2026

Now changes have to be made here https://github.com/spack/compiler-wrapper and be tested in a PR before being merged.

@climbfuji
Copy link
Copy Markdown
Contributor Author

Fixes an issue when checking which compiler is configured when the compiler wrapper is invoked in ld mode. Without this bug fix, spack assumes that a package that doesn't depend on C must depend on CXX. But there are packages that depend on Fortran only.

I created spack/compiler-wrapper#16. I would appreciate help with testing the changes. Thanks very much in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants