I’m getting the following error when using “fpm build”:
cmd_build Package error: Key test is not allowed in install table
The code was running without problems and all of a sudden this error showed up. One thing I did was using the command “pip install fortls”. I’m not sure is correlated, but it may be a cause of the problem.
If the code is open source, go ahead and post instructions how to reproduce it.
If it is not open source, you can try to create a minimal reproducible example (MRE) that shows the above error, and post it here, and we can try to fix it.
Otherwise you can also see the source code of fpm and try to figure out why that is happening. Or wait if anybody else has seen this error as well and knows what the problem might be.
The reproducer would indeed make it easier to diagnose but that looks like a typo in the fpm.toml OR a typo in an fpm.toml file in the dependencies; or that you moved or changed somehing that that made the build cache information incorrect. First, remove the build/ directory and retry. If there is still a problem did you recently change the fpm.toml file? If the code is not available publically if you can post the fpm.toml file the odds are that is where the problem is. The version of fpm (fpm --version) would be useful to know as well.
I answered in the previous reply the github repository where the code is located, so if I did everything right, you should be able to access the fpm.toml file there.
When the error showed up, I searched in the forum and that was one of the hypothesis. So I used “fpm clean” to delete the build paste and then used “fpm build” again but it didn’t work. I restored the fpm.toml to the original state and did this process again, but the error still happened.
All this process is not registered through commits in the github repository.
The problem is still happening. Before writing the post, a deleted by hand the build paste, now when i used the “fpm clean -all” command is says:
fpm: No build directory found.
Then, when I used “fpm build”, it still says: cmd_build Package error: Key test is not allowed in install table
STOP 1
Does not seem to be the problem here, but to avoid issues where the change in a dependency might cause an issue like this it is generally recommended to add a specific version to the dependency such as in
so if you pull your own repo down into a scratch area and do “fpm build” it generates that error?
How old is the version of fpm(1) you are using? If you move the fpm.toml file to fpm.toml.hold and
enter “fpm new . --backfill” it will generate a new fpm.toml file that is compatible with the fpm you are using. Then add the dependencies from the old one to the new fpm.toml and do “fpm clean --all;fpm build --verbose”.
No problem. That implies there is a typo in the original fpm.toml you had not pushed to the github repo or that you were using a version of fpm incompatible with your fpm.toml file. So it is always better to wonder what was causing a problem instead of what is causing one but
diff fpm.toml fpm.toml.hold
which fpm
fpm --versio
might edify what the root cause was.
One possibility is the fpm command is pointing to a different older version than it was, in which case the proposals to add versioning to the manifest file so it is possible to detect when a manifest file might be incompatible with the available fpm command; or that it was
a typo in the file and perhaps a plug-in could be made (or changes to fpm itself) that would diagnose the problem a bit more clearly. It is often useful to know the root cause as it can help develop fpm to make it easier for those who come later.
So when you were installing new packages lately, did any of them bundle in an old fpm command? The “which” command might show if that is the case.
The “diff” command (assuming you are on GNU/Linux or Unix) would show the differences between the working and defunct fpm.toml files, which would probably clarify if there is a typo or version incompatibility between the file and fpm.