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

pkg_web creates wrong package in windows #1635

Closed
alan-agius4 opened this issue Feb 13, 2020 · 0 comments · Fixed by #1636
Closed

pkg_web creates wrong package in windows #1635

alan-agius4 opened this issue Feb 13, 2020 · 0 comments · Fixed by #1636
Labels

Comments

@alan-agius4
Copy link
Contributor

alan-agius4 commented Feb 13, 2020

🐞 bug report

Affected Rule

pkg_web

Is this a regression?

Probably not

Description

pkg_web creates invalid output structure under windows. This is because the internal assembler is meant to deal with posix separated paths. However, when invoked under Windows we are providing Posix and non-Posix separators.

Example

npm/node_modules/@angular/material/prebuilt-themes/deeppurple-amber.css
npm/node_modules/zone.js/dist/zone.min.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\hello-world.module-a52d2ab9.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\hello-world.module-a52d2ab9.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\home-4761d3cb.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\home-4761d3cb.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\index.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\index.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\material.module-46d703dc.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\material.module-46d703dc.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\reducers-59e01ad7.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\reducers-59e01ad7.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\router-fc2b9243.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\router-fc2b9243.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\todos.module-502fe6bc.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es2015.min\todos.module-502fe6bc.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\hello-world.module-a52d2ab9.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\hello-world.module-a52d2ab9.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\home-4761d3cb.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\home-4761d3cb.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\index.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\index.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\material.module-46d703dc.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\material.module-46d703dc.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\reducers-59e01ad7.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\reducers-59e01ad7.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\router-fc2b9243.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\router-fc2b9243.js.map
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\todos.module-502fe6bc.js
bazel-out\x64_windows-fastbuild\bin\src\bundle-es5.min\todos.module-502fe6bc.js.map
example/index.html
assets/angular-logo-with-text.svg
assets/angular-white-transparent.svg
assets/bazel-navbar.svg
assets/bazel-white-transparent.svg
assets/github-circle-white-transparent.svg
assets/landing.css
system.js
core.min.js
index.html

🔬 Minimal Reproduction

Using pkg_web in examples/angular will yeild different package output on windows OS.

pkg_web(
    name = "prodapp",
    srcs = _ASSETS + [
        ":bundle-es2015.min",
        ":bundle-es5.min",
        ":inject_scripts_for_prod",
        "//src/assets",
        # Include polyfills that will be requested by old browsers
        "@npm//:node_modules/systemjs/dist/system.js",
        "@npm//:node_modules/core-js/client/core.min.js",
    ],
    # In production mode we serve some polyfills with script tags that have hard-coded paths in the index.html
    # so we must serve them at that path, by stripping a prefix
    additional_root_paths = [
        "npm/node_modules/core-js/client",
        "npm/node_modules/systemjs/dist",
    ],
)

image

🔥 Exception or Error

No error, just wrong output structure

🌍 Your Environment

Operating System:

  
OS: win32 x64
  

Output of bazel version:

  
Bazelisk version: v1.3.0
Build label: 2.1.0
Build target: bazel-out/x64_windows-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Feb 7 13:02:33 2020 (1581080553)
Build timestamp: 1581080553
Build timestamp as int: 1581080553
Done in 1.12s.
  

Rules_nodejs version:

(Please check that you have matching versions between WORKSPACE file and @bazel/* npm packages.)

  
1.3.0
  

Anything else relevant?

@alan-agius4 alan-agius4 changed the title pkg_web creates wrong package in windows. pkg_web creates wrong package in windows Feb 13, 2020
alan-agius4 added a commit to alan-agius4/rules_nodejs that referenced this issue Feb 13, 2020
alexeagle pushed a commit that referenced this issue Feb 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant