Open PauloCarvalhoRJ opened 1 day ago
Hi @PauloCarvalhoRJ
Which Conan version? --build=outdated
only existed in Conan 1, in Conan 2 it is useless. Furthermore the syntax conan install pkg/version
is not correct neither in Conan 1 nor in Conan 2.
Could you please clarify the exact Conan version, the exact command that you are using, the output of the command, report what is inside the respective folders (which folders they are too) in the cache and compare that with the folders with conan create
?
Hello. Sorry , it's Conan 2.3.
Hello. Sorry , it's Conan 2.3.
And what would be the correct command then? and the output, and the resulting folder contents?
Ok.
The script forms the following command for Ninja: conan install ninja/1.12.1 -s build_type=Release --build=missing --build=outdated --build=ninja
. The Ninja recipe is rather simple and only extracts the correct executable from a zip file to the package directory.
So, this command results in six shell scripts copied to the source diretcory:
If I run conan create ninja/1.12.1
, however, I get everything where they are supposed to be:
/home/conan2_packages/
|-- b
| `-- ninja73b1cb0514cd0
| |-- b
| | |-- conanbuildenv.sh
| | |-- conanbuild.sh
| | |-- conaninfo.txt
| | |-- conanrunenv.sh
| | |-- conanrun.sh
| | |-- deactivate_conanbuild.sh
| | |-- deactivate_conanrun.sh
| | |-- ninja
| | `-- ninja.exe
| |-- d
| | `-- metadata
| `-- p
| |-- bin
| | `-- ninja
| |-- conaninfo.txt
| `-- conanmanifest.txt
|-- cache.sqlite3
|-- ninja20bbd65455361
| |-- d
| | `-- metadata
| |-- e
| | |-- conanfile.py
| | `-- conanmanifest.txt
| |-- es
| | `-- ninja.zip
| `-- s
| `-- ninja.zip
`-- t
Notice that the six scripts from the conan install ...
are in cache.
The commands conan install ninja/1.12.1
and conan create ninja/1.12.1
are incorrect in Conan 2.
But conan create ninja/1.12.1
is working as expected.
(conan2_310) λ conan create ninja/1.2.11
ERROR: Conanfile not found at C:\Users\memsharded\conanws\kk\ninja\1.2.11
this only works if you have a folder called ninja
with a subfolder called 1.2.11
, but that is not the case
Ah... yes. My recipes are customized to have a fixed version. 1.2.11
in my case is the directory where the recipe is. Think conan create ninja/1.12.1
as conan create ninja
or even conan create .
when running from the same directory where the recipe is.
Recall that I'm on Linux, so conan create ninja/1.12.1
should read conan create ninja\1.12.1
in Windows.
Would you like to share my recipe/zip? They're quite small.
Would you like to share my recipe/zip? They're quite small.
yes, please, if you are using a custom recipe, and not a known one from ConanCenter we need it to be able to reproduce.
Here:
On a side note: why doesn't github accept certain file extensions? It only complicates life unnecessarily...
The recipe and the profile I'm using (for both host and build contexts) are inside the other zip.
Thank you!
Your conanfile.py is probably missing a layout()
section with either a cmake_layout(self)
, basic_layout(self)
or similar as contents. Without one you need to pass -of
to the install command to have the generated build files be placed in some subdir.
I have not checked in a while, but I think the Conan tutorial does not emphasize this detail all that well.
Hello, @valgur ,
That Ninja recipe is very simple and does not have a layout()
callback. So far, I've never had the need for it. Anyway, I'm going to try it and report here the result.
thanks,
PC
So, @valgur , adding the following callback:
def layout(self):
basic_layout(self, src_folder="src")
improved the result of the conan install ...
in a sense. The six forementioned Conan shell scripts are now in a build
folder in the source repository and it is not "building". That is, it is not unzipping the Ninja executable to <Conan cache path>/b/ninja<hash>/p/bin/ninja
. So, there is still a long way to go.
thanks,
PC
Greetings,
So, I have a CI/CD script that builds packages with
conan install
commands (e.g.conan install ninja/1.12.1 -s build_type=Release --build=missing --build=outdated --build=ninja
). The commands complete but they put the build artifacts in the source directory instead of in theb
directory in Conan cache like theconan create
does. How do I makeconan install
behave similarly toconan create
?thank you,
PC
Have you read the CONTRIBUTING guide?