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

rustbuild: Add install target. #34675 #35641

Merged
merged 3 commits into from Oct 7, 2016
Merged

rustbuild: Add install target. #34675 #35641

merged 3 commits into from Oct 7, 2016

Conversation

ahmedcharles
Copy link
Contributor

It just prints to the screen currently.

r? @alexcrichton

I'm working on the next commit to actually have it install.

@alexcrichton
Copy link
Member

Thanks for the PR! The scaffolding here looks right to me, want to fill in the target as well? It can be pretty similar to the make install target, which I believe just runs make dist followed by running the install.sh shell script itself.

@ahmedcharles
Copy link
Contributor Author

Yeah, I'll work on that next.

@ahmedcharles
Copy link
Contributor Author

@alexcrichton

This doesn't have equivalent functionality, but it seems like a good first step and it works for at least one scenario. What would you like to have working before putting the first version on master?

Copy link
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

Thanks! Looks good to me.

One thing I'm not entirely certain how to handle is make install vs sudo make install. Running sudo make install is actually super dangerous because it may corrupt your Cargo cache with a bunch of root-owned files if you have to rebuild the build system by accident.

Perhaps the makefiles for now could just have a check for if you're sudo and bail immediately if that's done? (or maybe the python script could have this check)

if build.config.docs {
install_sh(&build, "docs", "rust-docs", stage, host, prefix, &empty_dir);
}
install_sh(&build, "std", "rust-std", stage, host, prefix, &empty_dir);
Copy link
Member

Choose a reason for hiding this comment

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

In the makefiles this and the docs pass --disable-ldconfig, maybe that should happen here too?

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, I just missed that.

let mut cmd = Command::new("sh");
cmd.current_dir(empty_dir)
.arg(sanitize_sh(&tmpdir(build).join(&package_name).join("install.sh")))
.arg(format!("--prefix={}", sanitize_sh(&prefix)));
Copy link
Member

Choose a reason for hiding this comment

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

The libdir/mandir/docdir should be relatively easily scrapable from the config.mk I think, perhaps those could be added?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll try to add those in a third commit. They just aren't already available and they aren't needed for the trivial case.

@ahmedcharles
Copy link
Contributor Author

@alexcrichton Updated with docdir, libdir and mandir.

@alexcrichton
Copy link
Member

@bors: r+

Awesome, thanks!

@bors
Copy link
Contributor

bors commented Oct 6, 2016

📌 Commit fa23082 has been approved by alexcrichton

@bors
Copy link
Contributor

bors commented Oct 6, 2016

⌛ Testing commit fa23082 with merge 75c155b...

bors added a commit that referenced this pull request Oct 6, 2016
rustbuild: Add install target. #34675

It just prints to the screen currently.

r? @alexcrichton

I'm working on the next commit to actually have it install.
@bors bors merged commit fa23082 into rust-lang:master Oct 7, 2016
@ahmedcharles ahmedcharles deleted the install branch October 7, 2016 03:21
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.

None yet

3 participants