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

strip_prefix leads to invalid dep includes #520

Closed
abergmeier opened this issue Oct 19, 2015 · 10 comments
Closed

strip_prefix leads to invalid dep includes #520

abergmeier opened this issue Oct 19, 2015 · 10 comments
Assignees

Comments

@abergmeier
Copy link
Contributor

When getting includes by deps, strip_prefix is not honored. This way it results in -Isystem external/lua/src (with e.g. the actual path being external/lua/lua-5.2.4/src). Either the error lies in extracting with the lua-5.2.4 (which is strip_prefix) path or with not handling strip_prefix for deps.

@abergmeier abergmeier changed the title skip_prefix leads to invalid dep includes strip_prefix leads to invalid dep includes Oct 19, 2015
@kchodorow
Copy link
Contributor

strip_prefix shouldn't extract to external/lua/lua-5.2.4/src (it should be external/lua/src on the filesystem). Using the glm example from #518, for example, the zip contains:

$ unzip -l glm-0.9.4.6.zip
...
     3017  2013-09-03 00:53   glm/util/usertype.dat
---------                     -------
 12104590                     742 files

If I set `strip_prefix="glm", I end up with:

$ ls -l $(which bazel)/external/glm/util/usertype.dat
-rw-r--r-- 1 kchodorow kchodorow 3017 Oct 20 11:14 /path/to/output/base/external/glm/util/usertype.dat

Can you give an example (the WS & BUILD files) that isn't working for you?

@pspeter3
Copy link

I'm using bazel version 0.1.1 and getting similar behavior

WORKSPACE

workspace(name = "example")

new_http_archive(
    name = "typescript",
    build_file = "typescript.BUILD",
    url = "http://registry.npmjs.org/typescript/-/typescript-1.6.2.tgz",
    sha256 = "d553c416b02772452a8b3e0a6dd9db735c5d40154e99f1b1d6b730a2f0d6cbd2",
    strip_prefix = "package")

typescript.BUILD

package(default_visibility = ["//visibility:public"])

filegroup(
    name = "tsc",
    srcs = ["bin/tsc"])

external/typescript contents

  • BUILD
  • WORKSPACE
  • package
  • typescript-1.6.2.tgz

@pspeter3
Copy link

pspeter3 commented Nov 2, 2015

Is there any advice here?

@kchodorow
Copy link
Contributor

When I build this, I end up with:

$ ls $(bazel info output_base)/external/typescript/
AUTHORS.md  BUILD            CopyrightNotice.txt  lib          package.json  ThirdPartyNoticeText.txt  typescript-1.6.2.tgz
bin         CONTRIBUTING.md  Jakefile.js          LICENSE.txt  README.md     tslint.json               WORKSPACE

which looks correct, so I think you might be running into another complication of #352. Did you build it before adding the strip_prefix option, then add the strip_prefix option? I'm guessing the remote repository didn't get modified correctly when you added the option. Can you try running bazel clean --expunge and then rebuilding? (That'll force it to re-download any external dependencies.)

@pspeter3
Copy link

pspeter3 commented Nov 2, 2015

I did do what you suggested might be the cause. However, redownloading does not fix the issue. Are you on version 0.1.1? I feel like this works on master but not on the published version.

@nelhage
Copy link

nelhage commented Nov 9, 2015

I can confirm that strip_prefix works for me with a build of master, but seems to be broken in the 0.1.1 release.

@damienmg
Copy link
Contributor

As this bug should be closed in the upcoming release, marking as fixed.

@pspeter3
Copy link

Is this 0.12? 0.12 seems to be based off a fairly old commit.

@kchodorow
Copy link
Contributor

We're actually re-cutting 0.1.2 because it had a huge number of cherry-picks needed.

@pspeter3
Copy link

Ah ok, that sounds great then. Thank you for all your help!

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

No branches or pull requests

5 participants