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

Make rustc's own lib directory configurable and change the default to ru... #11118

Merged
merged 1 commit into from
Jan 6, 2014

Conversation

jhasse
Copy link
Contributor

@jhasse jhasse commented Dec 22, 2013

...stlib. Fixes #3319

@alexcrichton
Copy link
Member

This seems like a fairly roundabout way to fix the issue. I much prefer @brson's suggestion which is basically what you were doing in #11045. The host DLLs should all be in bin on windows, but otherwise everything should be the same as on unixes where we have lib/$target/....

Did you have a particular use case for configuring the name of this directory?

@jhasse
Copy link
Contributor Author

jhasse commented Dec 23, 2013

In the last comment from brson he adviced to rename the rustc dir to
rustlib (and as I interpreted it ditch his last idea). It's a pitty that no
one answered me in the issue.

IMHO this should also be merged. rustlib seems like a better name for the
dir to me.

I made it configurable because there might be some restrictions in distro
how directories in /usr/lib should be named. E.g. a distro wants the names
there to resamble the package name than this could be changed back to rustc.

@brson
Copy link
Contributor

brson commented Dec 23, 2013

I like this solution, and never really liked the rustc name for that directory.

@@ -15,7 +15,7 @@ $(SNAPSHOT_RUSTC_POST_CLEANUP): \
# Note: the variable "SNAPSHOT_FILE" is generally not set, and so
# we generally only pass one argument to this script.
ifdef CFG_ENABLE_LOCAL_RUST
$(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT)
$(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT) $(CFG_RUSTLIBDIR)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that this is quite right when dealing with the snapshot. If the snapshot has one directory configured and the local installation has another, there will be a mismatch. We can guarantee that all snapshots are built with rustlib as the subdirectory.

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'm not sure if I understand this correctly. Doesn't CFG_ENABLE_LOCAL_RUST mean that the build process shouldn't use a snapshot?

Copy link
Member

Choose a reason for hiding this comment

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

Ah good point, I didn't look closely enough!

@jhasse
Copy link
Contributor Author

jhasse commented Dec 30, 2013

Any news about merging this? Tests fail because of snapshots using rustc :/

@alexcrichton
Copy link
Member

If there's trouble with the snapshots, you can always add #[cfg(stage0)] gates to the code, but otherwise it's up to you to fix the test errors. We're around to help out (on IRC/github) for pointers, but we don't normally take over PRs (unless ownership is agreed upon to be transferred).

@jhasse
Copy link
Contributor Author

jhasse commented Dec 31, 2013

The problem is that the snapshot expects the old directory structure. Therefore #[cfg(stage0)] won't help me.

The solution is to rebuild the snapshots (with my trick described here: #3319 (comment) ). I can't do that.

@alexcrichton
Copy link
Member

This is going to need some temporary logic for stage0 because we don't do special snapshots. The idea of the snapshots are to be a history of the repository, and every snapshot is based off of some commit found in the history of the master branch. If we made new custom snapshots they would not be based on a commit in master, or the snapshots would only work to merge one patch (blocking all others).

The stage0 logic may need some patches in the makefiles for now, but it'll all get removed after the next snapshot.

@brson
Copy link
Contributor

brson commented Jan 1, 2014

The makefiles can have a bunch of lines like ifeq ($(0),0) where $(0) is the variable representing the stage to alter the stage 0 logic.

@jhasse
Copy link
Contributor Author

jhasse commented Jan 1, 2014

:'(

working on it ...

@jhasse
Copy link
Contributor Author

jhasse commented Jan 2, 2014

Okay new patch copies the files in both directories for stage0. Should I create a PR/patch which removes these lines which can be merged after the next snapshot?

@jhasse
Copy link
Contributor Author

jhasse commented Jan 4, 2014

Okay I was using too many *, sorry. It did work fine on my machine (Windows and Linux) but bors has some other directory laying around apparently. New patch uses exact directory names.

@jhasse
Copy link
Contributor Author

jhasse commented Jan 5, 2014

I'm very sorry for the failed test, I didn't notice it. This new commit should work (added use metadata::filesearch; in rpath.rs).

bors added a commit that referenced this pull request Jan 6, 2014
@bors bors closed this Jan 6, 2014
@bors bors merged commit 6abe0ef into rust-lang:master Jan 6, 2014
@jhasse jhasse deleted the patch-rustlibdir branch January 6, 2014 20: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.

rustc vs rustc.exe in PATH (Windows/MinGW)
4 participants