Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
Fix fetching Buck root for a build target
Browse files Browse the repository at this point in the history
I could've sworn it worked with relative directories - it boiled
down to

```js
const buildFile = ...; // relative
return fsPromise.findNearestFile('.buckconfig', buildFile);
```

which *should* work for relative files, I believe?
  • Loading branch information
Xanewok committed Sep 14, 2018
1 parent 9f64faf commit 8797da0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/nuclide-rust/lib/BuckIntegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,16 @@ export async function updateRlsBuildForTask(
// build file path to determine the possible Buck cell root to which the
// inputs are relative to.
// FIXME: This is a bug in Buck, only query for files when the output is fixed.
const [buildFile, files] = await Promise.all([
const [relativeBuildFile, files] = await Promise.all([
getRustBuildFile(task.buckRoot, buildTarget),
getRustInputs(task.buckRoot, buildTarget),
]);
// Not a Rust build target, ignore
if (buildFile == null || files.length === 0) {
if (relativeBuildFile == null || files.length === 0) {
return;
}

const buildFile = `${task.buckRoot}/${relativeBuildFile}`;
const buckRoot = await BuckService.getRootForPath(buildFile);
if (buckRoot == null) {
logger.error(`Couldn't find Buck root for ${buildFile}`);
Expand Down

0 comments on commit 8797da0

Please sign in to comment.