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

WEB3-207: add git submodule --init to methods/build.rs #140

Merged
merged 3 commits into from
Nov 25, 2024

Conversation

sashaaldrick
Copy link
Contributor

added to methods/build.rs:

    run_git_submodule_update();
    println!("cargo:rerun-if-changed=.gitmodules");

to automatically keep local libraries up to date on build.

@github-actions github-actions bot changed the title add git submodule update --init to methods/build.rs WEB3-207: add git submodule update --init to methods/build.rs Oct 29, 2024
Copy link
Contributor

@capossele capossele left a comment

Choose a reason for hiding this comment

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

That seems good to me, maybe let’s wait also for @nategraf feedback before merging

@nategraf
Copy link
Contributor

I don't think the build script would make changes to the submodules. I'd be happy to have it detect and warn the user instead.

@sashaaldrick
Copy link
Contributor Author

why not @nategraf ? aren't the submodules part of the build process?

@nategraf
Copy link
Contributor

So, my main issue is with running git submodule update. If the user has checked out a different commit in their submodule, git will checkout the submodule commit from HEAD instead, this undoing a potential intentional change. I'd be ok with git submodule init which only runs on first clone, and I'd be ok with warning the user that they have a dirty state for the submodules. But update feels like it could be in contention with the intentions of the user.

@sashaaldrick sashaaldrick force-pushed the sasha/build-with-git-submodule-update branch from 6b18056 to 6056a8a Compare November 5, 2024 11:33
@sashaaldrick
Copy link
Contributor Author

I've added two functions to the build.rs script to facilitate what we discussed yesterday @nategraf. These will now run: git submodule init on first clone, and then give warnings about dirty state.

My only dislike is that it took a lot of space in the build.rs file, which was very clean before. I could add a git.rs and import the relevant functions to build.rs, but also not sure about adding another file for this. What do you recommend @nategraf ?

@sashaaldrick sashaaldrick requested a review from nategraf November 6, 2024 07:58
@sashaaldrick sashaaldrick changed the title WEB3-207: add git submodule update --init to methods/build.rs WEB3-207: add git submodule --init to methods/build.rs Nov 18, 2024
@sashaaldrick sashaaldrick marked this pull request as ready for review November 18, 2024 19:22
@nategraf nategraf merged commit ee6b069 into main Nov 25, 2024
5 checks passed
@nategraf nategraf deleted the sasha/build-with-git-submodule-update branch November 25, 2024 17:05
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.

3 participants