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

add build system support for partial clobbers #402

Closed
mozbhearsum opened this issue Apr 30, 2013 · 7 comments
Closed

add build system support for partial clobbers #402

mozbhearsum opened this issue Apr 30, 2013 · 7 comments
Assignees

Comments

@mozbhearsum
Copy link

@mozbhearsum mozbhearsum commented Apr 30, 2013

In the initial Buildbot configs over in https://github.com/brson/servo-buildbot/blob/master/master/master.cfg there's a few steps that would be good to get into the build system behind a target we can call from Buildbot. Specifically:
mv build/obj/src/rust .
rm -rf build/obj
mkdir -p build/obj/src
mv rust build/obj/src

Getting these into the build system will help deal with platform differences when they come up.

@ghost ghost assigned brson May 6, 2013
@brson
Copy link
Contributor

@brson brson commented May 6, 2013

I'll look at this this week.

@brson
Copy link
Contributor

@brson brson commented May 9, 2013

@bhearsum I added make backup-rust and make restore-rust with the idea that a clobber build would look something like:

cd $build-dir
make backup-rust
rm * -rf
make restore-rust
../configure
make

Is this sufficient?

@mozbhearsum
Copy link
Author

@mozbhearsum mozbhearsum commented May 9, 2013

I think this will be sufficient, but configure needs to run before restore-rust (otherwise there's no Makefile). I need to test it in the context of Buildbot still, I'll let you know if I have any issues at that point.

@mozbhearsum
Copy link
Author

@mozbhearsum mozbhearsum commented May 15, 2013

OK, so there's one little bootstrapping issue - the first time we do a build, backup-rust doesn't do anything (because there's no "rust" to backup). Then restore-rust deletes rust, and can't replace it with anything. All of this ends up with a failure early in make because that directory doesn't exist. I think this is fixable by having restore-rust be a no-op if there's no backup.

@metajack
Copy link
Contributor

@metajack metajack commented May 15, 2013

@bhearsum try this patch

diff --git a/Makefile.in b/Makefile.in
index c1b1ac8..7cda28f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -275,5 +275,4 @@ backup-rust:
    mv src/rust ..

 restore-rust:
-   rm -rf src/rust
-   mv ../rust src/
+   if [ -d ../rust ]; then rm -rf src/rust; mv ../rust src/; fi
@mozbhearsum
Copy link
Author

@mozbhearsum mozbhearsum commented May 15, 2013

Yup, that works.

@jdm
Copy link
Member

@jdm jdm commented Apr 18, 2014

This is in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.