We use script/partial-gx-uw.py to unwrite the import statement changed by gx-go rewrite, and currently, we unwrite gx/ipfs/.../opentracing-go in our repository to github.com/opentracing/opentracing-go.
This is because one of our dependency ipfs/go-log depends on github.com/opentracing/opentracing-go, gx-go rw rewrites the import statements github.com/opentracing/opentracing-go to gx/ipfs/.../opentracing-go in our repository altogether. However, one of the dependencies of our repo appdash does not use gx to track the dependencies, i.e. it still uses the original import statements github.com/opentracing/opentracing-go even after gx-go rw. This introduces conflicts between the struct types in github.com/opentracing/opentracing-go and gx/ipfs/.../opentracing-go in our repository, even though they are the same types. To make them consistent, our temporary strategy is to recover all gx/ipfs/.../opentracing-go in our repository back to github.com/opentracing/opentracing-go.
This approach works. But it also means part of our loaded program using gx/ipfs/.../opentracing-go, while the other part using github.com/opentracing/opentracing-go. The same two packages(possibly different code) are loaded with two different package name. It is possible that some conflicts like https://github.com/ipfs/go-log/issues/40 might occur at runtime(though I failed to poc on this).
How can it be fixed?
Turn appdash to use gx. Basically, we need to write a package.json for it, specifying its dependencies on the repositories on ipfs. And then we need to run an ipfs node to host the code, to make sure gx have access to this code anytime.
What is wrong?
We use
script/partial-gx-uw.py
to unwrite the import statement changed bygx-go rewrite
, and currently, we unwritegx/ipfs/.../opentracing-go
in our repository togithub.com/opentracing/opentracing-go
. This is because one of our dependencyipfs/go-log
depends ongithub.com/opentracing/opentracing-go
,gx-go rw
rewrites the import statementsgithub.com/opentracing/opentracing-go
togx/ipfs/.../opentracing-go
in our repository altogether. However, one of the dependencies of our repoappdash
does not usegx
to track the dependencies, i.e. it still uses the original import statementsgithub.com/opentracing/opentracing-go
even aftergx-go rw
. This introduces conflicts between the struct types ingithub.com/opentracing/opentracing-go
andgx/ipfs/.../opentracing-go
in our repository, even though they are the same types. To make them consistent, our temporary strategy is to recover allgx/ipfs/.../opentracing-go
in our repository back togithub.com/opentracing/opentracing-go
. This approach works. But it also means part of our loaded program usinggx/ipfs/.../opentracing-go
, while the other part usinggithub.com/opentracing/opentracing-go
. The same two packages(possibly different code) are loaded with two different package name. It is possible that some conflicts like https://github.com/ipfs/go-log/issues/40 might occur at runtime(though I failed to poc on this).How can it be fixed?
Turn
appdash
to usegx
. Basically, we need to write apackage.json
for it, specifying its dependencies on the repositories on ipfs. And then we need to run an ipfs node to host the code, to make suregx
have access to this code anytime.