Skip to content
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

Don't rebuild C static libs if the desired architecture/platform already exists #82

Closed

Conversation

jurvis
Copy link
Contributor

@jurvis jurvis commented Nov 25, 2022

No description provided.

SECP_DIR="${BUILD_DIR}/${PLATFORM_NAME}/libsecp256k1-${TARGET_ARCH}-apple-darwin.a"

# If we haven't built our static library, let's go ahead and build it. Else, we can probably just not try and build at all.
if [ ! -f $LIBWALLY_DIR ] || [ ! -f $SECP_DIR ]
Copy link
Owner

Choose a reason for hiding this comment

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

I guess this means that if you change something in libwally-core you should clean the build folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct, unfortunately Xcode changed its build system a couple of releases ago which does not allow for custom build targets to define their own clean behaviors when you clean from Xcode.

these lines here were meant to handle that case, but doesn't work: https://github.com/Sjors/libwally-swift/pull/82/files#diff-cf8443a1af8a2de0df5857abe08d2469008f13a0a65f4f984d3d60acdbc68679R95-R97

isa = PBXTargetDependency;
target = 75B9EDFC2810F83700E31B4D /* LibWallyCore */;
targetProxy = 75B9EE002810F88400E31B4D /* PBXContainerItemProxy */;
targetProxy = 75683E51293049380014553B /* PBXContainerItemProxy */;
Copy link
Owner

Choose a reason for hiding this comment

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

Did you mean to touch all these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hm, I don't see a reason why it should change -- let me take a second look here

Copy link
Owner

Choose a reason for hiding this comment

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

I thought maybe a checksum of some sort.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, you're right. it's the checksum of the scheme action we define here https://github.com/Sjors/libwally-swift/pull/82/files#diff-a0467817f744b83783e73e607681e81427686debb56a8ba92f697ba854994937R13

since our change works, I will go ahead and delete the pre-build script

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, I misspoke, it was a checksum of our script, build-libwally.sh. Either way, I just committed 2f7f66f to remove the unneeded pre-build script.

@Sjors
Copy link
Owner

Sjors commented Nov 25, 2022

Works great. I tested that it doesn't needlessly build libwally-core. I can now run individual tests (quickly). Cleaning the build folder doesn't trigger a rebuild either, which is a bit odd. But a git clean -dfx inside CLibWally/libwally-core does cause a rebuild.

@Sjors
Copy link
Owner

Sjors commented Nov 25, 2022

Let me know if it works with your workflow for nthKey?

I assume this won't really impact pod install would it?

@jurvis
Copy link
Contributor Author

jurvis commented Nov 25, 2022

Cleaning the build folder doesn't trigger a rebuild either, which is a bit odd.

Yeah, this is unfortunately the result of custom build targets not being able to access and customize clean operations, as described here: #82 (comment)

I assume this won't really impact pod install would it?

I don't suppose so, pod install basically runs the same build steps as what CI does in this job: https://github.com/Sjors/libwally-swift/actions/runs/3550319288/jobs/5963588666. If that works, pod install shouldn't have any issues.

@Sjors
Copy link
Owner

Sjors commented Nov 26, 2022

Merged in fa1ce00.

@Sjors Sjors closed this Nov 26, 2022
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.

2 participants