Skip to content

Commit 51ce337

Browse files
authored
Rearrange JS dependencies so we can build parseq-tracevis with Python 3+ (linkedin#337)
Pinning Python to 2.7 is not working anymore since GitHub dropped support for Python 2.7. We originally pinned it to avoid an issue where `node-gyp` fails when combined with Python 3.x during `npm install`. The reasons for this failure are: - `d3` depends either directly or transitively on `contextify`, a _really_ old library that needs native code from V8 to install. - `contextify` builds native code via `node-gyp`. - The version of `node-gyp` used does not play well with Python 3.x. A proper path forward would be to update and modernize the entire JavaScript stack used in `parseq-tracevis` -- which is a non-trivial amount of work. As a workaround, we can use a pre-built version of `d3`. A local copy of `d3` v3.x has been added to the local repository, and the dependency on `d3` has been removed from `package.json`. Doing this avoids the need for building native code, and thus the need for `node-gyp`. This allows us to build using Python 3.x because now there is no conflict.
1 parent 3e6e50b commit 51ce337

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,9 @@ jobs:
1818
with:
1919
# Need to fetch 2 commits for the PR (base commit and head merge commit) so we can compute the diff
2020
fetch-depth: 2
21-
- uses: actions/setup-python@v2
22-
with:
23-
python-version: '2.7.18'
2421
- uses: actions/setup-java@v2
2522
with:
2623
distribution: zulu
2724
java-version: ${{ matrix.java }}
2825
cache: gradle
29-
- run: ./.github/scripts/build.sh
26+
- run: ./.github/scripts/build.sh

.github/workflows/publish.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ jobs:
2222
distribution: zulu
2323
java-version: ${{ matrix.java }}
2424
# Do NOT use caching, since we want to ensure published artifacts are fresh
25-
- uses: actions/setup-python@v2
26-
with:
27-
python-version: '2.7.18'
2825
- run: ./.github/scripts/publish.sh
2926
env:
3027
JFROG_USER: ${{ secrets.JFROG_USER }}
31-
JFROG_KEY: ${{ secrets.JFROG_KEY }}
28+
JFROG_KEY: ${{ secrets.JFROG_KEY }}

subprojects/parseq-tracevis/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ task buildTracevisJS(type: Copy, dependsOn: ['buildModuleJS', 'buildModuleMinJS'
136136
}
137137

138138
from(".") {
139-
include 'node_modules/d3/d3.min.js'
139+
include 'js/d3.v3.min.js'
140140
include 'js/d3.slider.js'
141141
include 'node_modules/svg-injector/dist/svg-injector.min.js'
142142
include 'node_modules/svg-injector/dist/svg-injector.map.js'

subprojects/parseq-tracevis/js/d3.v3.min.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

subprojects/parseq-tracevis/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
"uglify-js": "2.6.0"
1414
},
1515
"dependencies": {
16-
"d3": "3.3.5",
1716
"graphlib": "0.7.4",
1817
"graphlib-dot": "0.4.9",
1918
"sha1": "1.1.0",

subprojects/parseq-tracevis/trace.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ <h4 style="text-align: center;">ParSeq JSON Trace Viewer vX.X.X</h4>
8686

8787
<div id="resultView" class="row-fluid"/>
8888

89-
<script src="node_modules/d3/d3.js"></script>
89+
<script src="js/d3.v3.min.js"></script>
9090
<script src="build/parseq-tracevis.js"></script>
9191
<script src="node_modules/svg-injector/svg-injector.js"></script>
9292
<script src="node_modules/svg-pan-zoom/dist/svg-pan-zoom.js"></script>

0 commit comments

Comments
 (0)