Skip to content

Rename object files so that we don't have collisions between different #7592

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

Conversation

NlightNFotis
Copy link
Contributor

Rename object files so that we don't have collisions between different object files coming from different projects.

Fixes #7586

Co-authored-by: Enrico Steffinlongo "enrico.steffinlongo@diffblue.com"
Co-authored-by: Fotis Koutoulakis "fotis.koutoulakis@diffblue.com"

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

object files coming from different projects.

Fixes diffblue#7586

Co-authored-by: Enrico Steffinlongo "enrico.steffinlongo@diffblue.com"
Co-authored-by: Fotis Koutoulakis "fotis.koutoulakis@diffblue.com"
@NlightNFotis NlightNFotis self-assigned this Mar 13, 2023
@NlightNFotis NlightNFotis added aws Bugs or features of importance to AWS CBMC users Kani Bugs or features of importance to Kani Rust Verifier Rust API Issues pertaining to the CBCM Rust API labels Mar 13, 2023
# Unpack the library
${AR_COMMAND} -x ${lib}

# Rename all object file in the library prepending "${LIBNAME}_" to avoid
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit pick: s/file/files/

done

# Append all the unpacked files to the destination library
${AR_COMMAND} -rcs ${DESTINATION} *.o
${AR_COMMAND} -rcs ${DESTINATION} **/*.o
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why **?

Copy link
Contributor

@thomasspriggs thomasspriggs Mar 13, 2023

Choose a reason for hiding this comment

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

** supports matching the pattern across the contents of multiple directories, which is needed because of the preceding changes which places the .o files in separate directories.

Copy link
Contributor

Choose a reason for hiding this comment

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

Because the files are in the subfolder we need to add all .o in the subfolders.
However this can be problematic, so Fotis is now pushing an updated and more robust version of this

Copy link
Collaborator

Choose a reason for hiding this comment

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

It would have worked if you used 1) bash as the shell and 2) had the globstar option set (for those versions of bash that even support it). As it was, ** was not meaningful. But then you've now found a different solution.

@codecov
Copy link

codecov bot commented Mar 13, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.02 🎉

Comparison is base (3cf1ade) 78.48% compared to head (ed8b841) 78.50%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7592      +/-   ##
===========================================
+ Coverage    78.48%   78.50%   +0.02%     
===========================================
  Files         1670     1670              
  Lines       191775   191777       +2     
===========================================
+ Hits        150509   150554      +45     
+ Misses       41266    41223      -43     

see 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

This avoids potential issues with clashing translation unit name in case
pre-existing translation units exist in the archiving directory.
mkdir add_dependencies_tmp
cd add_dependencies_tmp

# The full path of the current "root" directory
Copy link
Contributor

Choose a reason for hiding this comment

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

⛏️ I found this comment confusing on first reading. Surely pwd Prints the Working Directory not the root directory which would be /? On second reading I guess this means the root of the working tree, rather than the root of the filing system, but the overloaded terminology makes this confusing.

# Rename all object file in the library prepending "${LIBNAME}_" to avoid
# clashes.
# Rename all object files in the library prepending "${LIBNAME}_" to avoid
# clashes, and move to the "root" folder.
Copy link
Contributor

Choose a reason for hiding this comment

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

⛏️ Mixed terminology. You used "folder" here and "directory" previously. It would be nice to choose one term and use it consistently...

Copy link
Contributor

@TGWDB TGWDB left a comment

Choose a reason for hiding this comment

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

I agree with the comments by @thomasspriggs and also would prefer not to have a TODO remaining. That said, they're not blockers to this progressing for me.

@NlightNFotis
Copy link
Contributor Author

@TGWDB The TODO needs to stay in for now, as it's something to remind us to check out later what the impact of this change is on the runner caches.

We can't do it now (it requires multiple rounds of CI after this PR has been merged) and it's something that we really need to keep track of going forward, as we've already blown the caches way above the limit we're allowed.

@NlightNFotis NlightNFotis merged commit 216e96c into diffblue:develop Mar 14, 2023
@NlightNFotis NlightNFotis deleted the fix_name_collisions_static_library branch March 14, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws Bugs or features of importance to AWS CBMC users Kani Bugs or features of importance to Kani Rust Verifier Rust API Issues pertaining to the CBCM Rust API
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Naming collisions prevent linking against libcprover.5.78.0.a
5 participants