Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[autoconf] add conan v2 support #12777

Closed
wants to merge 15 commits into from

Conversation

jellespijker
Copy link
Contributor

Note: test_package can't use the new Autools generator
due to conan-io/conan#11975

Specify library name and version: lib/1.0

This is also a good place to share with all of us why you are submitting this PR (specially if it is a new addition to ConanCenter): is it a dependency of other libraries you want to package? Are you the author of the library? Thanks!


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the conan-center hook activated.

Note: test_package can't use the new Autools generator
due to conan-io/conan#11975
@conan-center-bot

This comment has been minimized.

@jellespijker
Copy link
Contributor Author

jellespijker commented Sep 1, 2022

@uilianries thanks for the review. I'm a bit uncertain how to handle the win_bash and conf issues in a correct and sustainable way though. If you have any suggestions I would love to hear them.

I will give it some extra thought in the evening as well

@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

KB-H013 states that everything needs to be installed under bin for tools.
This also means that the `PATH` for the actual bin location `bin/bin` needs
to be added to the `build_env`
@conan-center-bot

This comment has been minimized.

@jellespijker
Copy link
Contributor Author

This PR is also dependent on #12815

@jellespijker jellespijker changed the title migrate autoconf to conan v2 [autoconf] add conan v2 support Sep 5, 2022
@conan-center-bot

This comment has been minimized.

j.spijker@ultimaker.com added 2 commits September 5, 2022 13:38
subsystem isn't known at this time
No need to actually compile something with this tool
we simply need to know if it runs.

The win_bash for the run needs to be set explicitly
due to the conf not working properly in the test_package
see conan-io/conan#11975
@conan-center-bot

This comment has been minimized.

# KB-H013 we're packaging an application, hence the nested bin
bin_dir = path.join(self.package_folder, "bin", "bin")
self.output.info(f"Appending PATH env var with : {bin_dir}")
self.buildenv_info.prepend_path("PATH", bin_dir)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.buildenv_info.prepend_path("PATH", bin_dir)

Did I not review this part already? It's useless.

Copy link
Contributor Author

@jellespijker jellespijker Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you did review that part, but that was on account of the everything placed in the layout folders. Like a regular package. Since this recipe is a build tool (application) all the folders are placed in the bin folder.
So basically the folder containing the actual binaries is self.package_folder/bin/bin since the layout bindirs only add the self.package_folder/bin to the path, I still needed to add this embedded bin dir to the buildenv_info PATH variable.
I tried to solve this with specifying the layout structure, while adhering to kb-h013 but that caused more problems then simply adding this line

Comment on lines -93 to -94
self.cpp_info.libdirs = []
self.cpp_info.includedirs = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happened to these 2 lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The layout method should take care of that as I understand it. If I understand it wrongfully I can add them back

Copy link
Contributor

@SpaceIm SpaceIm Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

layout gives a non-empty default value to libdirs & includedirs. Moreover I don't like the idea to control empty libdirs or includedirs in layout() method, it's easier for maintenance to keep all the consuming logic in package_info().

Copy link
Contributor Author

@jellespijker jellespijker Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I remove the layout method then?
It is my experience that this will cause issues in recipe (from source). It also adds some extra arguments to the get in the source method. Atleast the documentation provides this as an example to be changed between V1 and V2

Or is it enough to keep the layout and revert the deletion of those two lines?

Comment on lines 34 to 43
for src in self.exports_sources:
shutil.copy(os.path.join(self.source_folder, src), self.build_folder)
self.run("{} --verbose".format(os.environ["AUTOCONF"]),
win_bash=tools.os_info.is_windows, run_environment=True)
self.run("{} --help".format(os.path.join(self.build_folder, "configure").replace("\\", "/")),
win_bash=tools.os_info.is_windows, run_environment=True)
autotools = AutoToolsBuildEnvironment(self, win_bash=tools.os_info.is_windows)
with self._build_context():
autotools.configure()
autotools.make()
Copy link
Contributor

@SpaceIm SpaceIm Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep it, with conan v2 flavor please, we must test a build

and conan v1 flavor in test_v1_package

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't aware of the test_v1_package, I will add that

Copy link
Contributor Author

@jellespijker jellespijker Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honest question asked out of curiosity; What is the added value of actually compiling something in the test_package, isn't it enough to just validate if the binaries run? I had this discussion with @memsharded earlier and I can think of arguments for both sides. I'm personally inclined to accept a test which just asserts if the binary runs for an application/tool.

On a separate note, please be aware that we can't actually test the Conan v2 on Windows, since issue conan-io/conan#11975
Prevents running autotools

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These autotools recipes are important in conan-center, many recipes depend on them for autotools build. This recipe must check that a basic autotools project builds fine.
If you test only a toy usage of this binary, you may miss issues in the recipe.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. I understand stand reasoning very well. I will revert the V1 functionality tomorrow morning.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it's not acceptable, there are recipes depending on a functional autoconf recipe on Windows. No need to rush, wait msys2 PR. Actually I was planning to submit PR to m4, autoconf, automake and libtool (in this order) afterwards.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For us the failing of these chains of recipes (msys2, m4, autotoconf, autotool, gettext, libgettext, cpython, qt) can't be build on Windows with the bash subsystems. These are blocking issues for us at the moment,

It would be ashame if we need to host so many recipes on our own Artifactory server because the CCI versions don't work. It would feel as a big loss for me if the work done on these recipes can't be contributed back to the community and if we both need to maintain parallel recipes for the same dependencies.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For me it's not acceptable, there are recipes depending on a functional autoconf recipe on Windows. No need to rush, wait msys2 PR. Actually I was planning to submit PR to m4, autoconf, automake and libtool (in this order) afterwards.

What would be the main difference between how you would do these recipes and how I made them? I'm willing to put in some extra work to ensure that they're up to the standards of you guys. As I said before it would be a shame if this current effort goes to waste.

Copy link
Contributor Author

@jellespijker jellespijker Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to rush, wait msys2 PR.

Ah wait I think some information might have gotten snowed over in all the noise.

The conf issue that I mentioned is still an issue even with your updated msys2 recipe. That is the one I'm using on our Artifactory server

Copy link
Contributor Author

@jellespijker jellespijker Sep 5, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SpaceIm I have send you a message on Slack, pls feel free to responsd (or not ;-) ) in your own time

@jellespijker jellespijker marked this pull request as draft September 6, 2022 16:30
@conan-center-bot

This comment has been minimized.

@jellespijker
Copy link
Contributor Author

It keeps failing for in the v2 test_package with see conan-io/conan#11975:

ERROR: autoconf/2.71 (test package): Error in build() method, line 46
	autotools.configure()
	ConanException: The config 'tools.microsoft.bash:subsystem' is needed to run commands in a Windows subsystem

This is when I run the conan create . using the updated msys2 from #12715 and the updated m4 from #12815

I unfortunately can't spend anymore time in fixing this for the CCI and I will just have to settle with fixing it for our recipes and hosting it on our Artifactory server.

@SpaceIm don't wait for me with these PR's. I tried but I think you will stand a better change of updating them then I do.

@conan-center-bot
Copy link
Collaborator

Failure in build 13 (f97d01dcca559b593f0dc9ce8629e3d793c4225c):

  • autoconf/2.71@:
    Didn't run or was cancelled before finishing

  • autoconf/2.69@:
    CI failed to create some packages (All logs)

    Logs for packageID 5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9:
    [settings]
    arch=x86_64
    build_type=Release
    compiler=gcc
    compiler.libcxx=libstdc++11
    compiler.version=5
    os=Linux
    
    [...]
    autom4te:                    '_AM_SUBST_NOTMAKE' => 1,
    autom4te:                    'AC_CONFIG_FILES' => 1,
    autom4te:                    'AC_CONFIG_SUBDIRS' => 1,
    autom4te:                    'm4_pattern_forbid' => 1,
    autom4te:                    'LT_SUPPORTED_TAG' => 1,
    autom4te:                    '_AM_COND_ENDIF' => 1,
    autom4te:                    '_LT_AC_TAGCONFIG' => 1,
    autom4te:                    'sinclude' => 1,
    autom4te:                    'AM_INIT_AUTOMAKE' => 1,
    autom4te:                    '_AM_COND_ELSE' => 1,
    autom4te:                    'AC_CANONICAL_BUILD' => 1,
    autom4te:                    'AM_POT_TOOLS' => 1,
    autom4te:                    'AC_CONFIG_HEADERS' => 1,
    autom4te:                    'm4_pattern_allow' => 1,
    autom4te:                    'LT_INIT' => 1,
    autom4te:                    'AM_MAKEFILE_INCLUDE' => 1,
    autom4te:                    'AC_REQUIRE_AUX_FILE' => 1,
    autom4te:                    'LT_CONFIG_LTDL_DIR' => 1,
    autom4te:                    'AC_CONFIG_LINKS' => 1,
    autom4te:                    'AM_AUTOMAKE_VERSION' => 1,
    autom4te:                    'AC_PROG_LIBTOOL' => 1,
    autom4te:                    'AC_FC_SRCEXT' => 1,
    autom4te:                    'AM_ENABLE_MULTILIB' => 1,
    autom4te:                    'AC_CANONICAL_HOST' => 1,
    autom4te:                    'AM_PROG_CC_C_O' => 1,
    autom4te:                    'AC_CONFIG_AUX_DIR' => 1,
    autom4te:                    'AM_PROG_CXX_C_O' => 1,
    autom4te:                    'AM_MAINTAINER_MODE' => 1,
    autom4te:                    'AM_NLS' => 1,
    autom4te:                    'AC_SUBST_TRACE' => 1,
    autom4te:                    'AM_GNU_GETTEXT_INTL_SUBDIR' => 1,
    autom4te:                    'm4_include' => 1,
    autom4te:                    'include' => 1,
    autom4te:                    'AC_LIBSOURCE' => 1,
    autom4te:                    'AC_CONFIG_LIBOBJ_DIR' => 1,
    autom4te:                    'AM_CONDITIONAL' => 1,
    autom4te:                    'AC_DEFINE_TRACE_LITERAL' => 1,
    autom4te:                    '_AM_MAKEFILE_INCLUDE' => 1,
    autom4te:                    'AM_PROG_MOC' => 1,
    autom4te:                    'AC_FC_PP_DEFINE' => 1
    autom4te:                  }
    autom4te:                ], 'Autom4te::Request' );
    autom4te: running: /usr/bin/env m4 --nesting-limit=1024 --gnu --include=/home/conan/w/prod/BuildSingleReference/.conan/data/autoconf/2.69/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/share/autoconf --debug=aflq --fatal-warning --debugfile=autom4te.cache/traces.0t --trace=AC_CANONICAL_BUILD --trace=AC_CANONICAL_HOST --trace=AC_CANONICAL_SYSTEM --trace=AC_CANONICAL_TARGET --trace=AC_CONFIG_AUX_DIR --trace=AC_CONFIG_FILES --trace=AC_CONFIG_HEADERS --trace=AC_CONFIG_LIBOBJ_DIR --trace=AC_CONFIG_LINKS --trace=AC_CONFIG_SUBDIRS --trace=AC_DEFINE_TRACE_LITERAL --trace=AC_FC_FREEFORM --trace=AC_FC_PP_DEFINE --trace=AC_FC_PP_SRCEXT --trace=AC_FC_SRCEXT --trace=AC_INIT --trace=AC_LIBSOURCE --trace=AC_PROG_LIBTOOL --trace=AC_REQUIRE_AUX_FILE --trace=AC_SUBST --trace=AC_SUBST_TRACE --trace=AH_OUTPUT --trace=AM_AUTOMAKE_VERSION --trace=AM_CONDITIONAL --trace=AM_ENABLE_MULTILIB --trace=AM_GNU_GETTEXT --trace=AM_GNU_GETTEXT_INTL_SUBDIR --trace=AM_INIT_AUTOMAKE --trace=AM_MAINTAINER_MODE --trace=AM_MAKEFILE_INCLUDE --trace=AM_NLS --trace=AM_PATH_GUILE --trace=AM_POT_TOOLS --trace=AM_PROG_AR --trace=AM_PROG_CC_C_O --trace=AM_PROG_CXX_C_O --trace=AM_PROG_F77_C_O --trace=AM_PROG_FC_C_O --trace=AM_PROG_MOC --trace=AM_SILENT_RULES --trace=AM_XGETTEXT_OPTION --trace=LT_CONFIG_LTDL_DIR --trace=LT_INIT --trace=LT_SUPPORTED_TAG --trace=_AM_COND_ELSE --trace=_AM_COND_ENDIF --trace=_AM_COND_IF --trace=_AM_MAKEFILE_INCLUDE --trace=_AM_SUBST_NOTMAKE --trace=_LT_AC_TAGCONFIG --trace=_m4_warn --trace=include --trace=m4_include --trace=m4_pattern_allow --trace=m4_pattern_forbid --trace=m4_sinclude --trace=sinclude --reload-state=/home/conan/w/prod/BuildSingleReference/.conan/data/autoconf/2.69/_/_/package/5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9/bin/share/autoconf/autoconf/autoconf.m4f --undefine=__m4_version__ configure.ac > autom4te.cache/output.0t
    autom4te: formatting traces for `/tmp/am4t0vXf4h/warnings': _m4_warn
    autom4te: reading /tmp/am4t0vXf4h/warnings
    autom4te: creating configure
    autom4te: formatting traces for `/tmp/am4t0vXf4h/patterns': m4_pattern_allow, m4_pattern_forbid
    autom4te: forbidden tokens: ^_?A[CHUM]_|_AC_|^LIBOBJS$|^_?m4_|^dnl$|^_?AS_
    autom4te: forbidden token : ^LIBOBJS$ => do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS'
    autom4te: allowed   tokens: ^AS_FLAGS$|^SHELL$|^PATH_SEPARATOR$|^PACKAGE_NAME$|^PACKAGE_TARNAME$|^PACKAGE_VERSION$|^PACKAGE_STRING$|^PACKAGE_BUGREPORT$|^PACKAGE_URL$|^exec_prefix$|^prefix$|^program_transform_name$|^bindir$|^sbindir$|^libexecdir$|^datarootdir$|^datadir$|^sysconfdir$|^sharedstatedir$|^localstatedir$|^includedir$|^oldincludedir$|^docdir$|^infodir$|^htmldir$|^dvidir$|^pdfdir$|^psdir$|^libdir$|^localedir$|^mandir$|^PACKAGE_NAME$|^PACKAGE_TARNAME$|^PACKAGE_VERSION$|^PACKAGE_STRING$|^PACKAGE_BUGREPORT$|^PACKAGE_URL$|^DEFS$|^ECHO_C$|^ECHO_N$|^ECHO_T$|^LIBS$|^build_alias$|^host_alias$|^target_alias$|^CC$|^CFLAGS$|^LDFLAGS$|^LIBS$|^CPPFLAGS$|^CC$|^CC$|^CC$|^CC$|^ac_ct_CC$|^EXEEXT$|^OBJEXT$|^CXX$|^CXXFLAGS$|^LDFLAGS$|^LIBS$|^CPPFLAGS$|^CXX$|^ac_ct_CXX$|^NO_MINUS_C_MINUS_O$|^CC_MINUS_O$|^CC_MINUS_O$|^LIBOBJS$|^LTLIBOBJS$
    

Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

@jellespijker
Copy link
Contributor Author

Superseded by PR #12896 will close this one in favor of that PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants