As part of my Julia journey, I have decided to work on a TCX parser (specifically this parser xue35/TCX.jl that would be useful for getting to my fitness data. While I have managed to figure out how to make the changes necessary to improve the library, I have been struggling to figure out how to properly test and update the project. I’ve tried looking up more information on packages and projects for whatever reason I’m finding it super confusing.
So some background on what I have done, it’s a little tricky since I’ve tried out a bunch of stuff, and at one point I did manage to get the tests working. Somewhere along the way, I messed up and something seems to be wrong, I’ll try to explain as best I can and answer any follow up questions. I cloned the repo to brotherjack/TCX.jl. In Julia I used the Pkg.develop() function to create a directory in my local julia dir, made changes there and managed to get the tests to pass.
Now since then, I have made more changes and when I activate the environment and try to run tests I get errors like:
WARNING: --output requested, but no modules defined during run
┌ Warning: The call to compilecache failed to create a usable precompiled cache file for TCX [3b8c1752-506b-11e9-3f9b-8db86abc7c68]
│ exception = ArgumentError: Invalid header in cache file ~/.julia/compiled/v1.4/TCX/nbO7O_0StLh.ji.
└ @ Base loading.jl:1041
ERROR: LoadError: KeyError: key TCX [3b8c1752-506b-11e9-3f9b-8db86abc7c68] not found
I’m at a loss at where to go from here. If anyone can provide assistance, it would be greatly appreciated.
Unfortunately, “exactly” no, but I can do “further”. It’s mostly a blur of adding and removing packages, activating this and then activating that, and I definitely deleted and re-forked the github repo at least twice. During all this, I’m pretty sure I did not alter Project.toml or Manifest.toml, but it’s quite possible that I did. If this sounds like a bumbling series of barely thought through actions, it’s because it is that and I am communicating effectively.
So rather than try and parse through that, it might be easier to try and state what I think the right way of doing this is, and then you can tell me what I’m doing wrong? Basically, here is the run down of how I think you are supposed to contribute to a project.
Fork the repository using git
Clone the forked repo to your machine
Open a Julia REPL, go into package mode and run develop <path-to-project>
cd to project in your local Julia directory
Run activate . in package mode
Open an editor / make changes / save
Run test in package mode (this is where things blow up)
From what I can tell, by looking into the error, it looks like there is a problem with the using TCX statement on the first line of test/runtests.jl. Sorry forgot to include the stack trace in the first post, but here it is:
 getindex at ./dict.jl:477 [inlined]
 root_module at ./loading.jl:967 [inlined]
 require(::Base.PkgId) at ./loading.jl:933
 require(::Module, ::Symbol) at ./loading.jl:922
 include(::String) at ./client.jl:439
 top-level scope at none:6
in expression starting at /home/user/.julia/dev/TCX/test/runtests.jl:1
ERROR: Package TCX errored during testing
I’ve tried deleting the contents of /home/user/.julia/compiled/v1.4/TCX, but that doesn’t seem to do anything. I have the feeling it has something to do with that UUID. That it needs to be registered somewhere or updated or something. Does any of this help?
Well, @rdeits, that’s an (interesting?) story. So I did that, and nothing changed, so I was about to report that, but then I realized I did not quite exactly follow your instructions. I left out clone the forked repo to your machine. So I did this, however unlike the last time, I did not clone into another directory (essentially it clones into ./TCX.jl by default). For whatever reason, probably the one you guessed, it worked!
I’m still a little confused as to why it is this way. One of the reasons I believe I was working on the .julia/dev path is because I was running into problems there. My best guess is that I messed something up in the environment file maybe? In any case, thanks for your assistance,
AH @rdeits, interesting wrinkle, that might shine light on what went wrong. So after posting that I checked out the development branch of my repo. Now the error is back. I think this is the crux of my problem. Does test only work on the main branch, or is there something I am doing/not doing?
I am almost sure that ] test does not look at the name of the selected branch to make decisions. However, the code of the package/repository is probably different between the branches and the one in the development branch may have errors that does not exist in the main branch. Did you try git diff main-branch-name development-branch-name to see the differences?
@Henrique_Becker oh yes the code is definitely different, however the tests won’t load and instead I get this error: ERROR: LoadError: KeyError: key TCX [3b8c1752-506b-11e9-3f9b-8db86abc7c68] not found. Now that UUID is the one that is for the original TCX library I cloned. I did not change the Project.toml file and it contains that UUID, might the fact that I have the same Project file be a problem?
@Henrique_Becker and @anon37204545 Oh boy, I just looked at the TCX.jl file, and wow yeah that’s very wrong. It seems in all the chaos I managed to accidentally delete much of the code. I’m going to fix that up, and then go to my room and think about what I did
I wish this could be a solution too. This person is a genius. We should stop all of this, programming has reached it’s dialectic endpoint. Why are we still doing this? Fetch the manager, tell him to SHUT THIS FORUM DOWN FORTHWITH!