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

ccache: update to 4.0 (alternative approach for chroot-cmake) #25753

Merged
merged 4 commits into from Oct 23, 2020

Conversation

sgn
Copy link
Member

@sgn sgn commented Oct 20, 2020

Alternative for #25724

@sgn sgn requested a review from pullmoll October 20, 2020 15:10
@sgn sgn mentioned this pull request Oct 20, 2020
checksum=a02f4e8360dc6618bc494ca35b0ae21cea080f804a4898eab1ad3fcd108eb400
checksum=ac1b82fe0a5e39905945c4d68fcb24bd0f32344869faf647a1b8d31e544dcb88

if [ "$CHROOT_READY" ]; then
Copy link
Member

Choose a reason for hiding this comment

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

Hmm.. depending on chroot-cmake if $CHROOT_READY seems the wrong way round, no?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking about stage1 and stage2.
Either put inside chroot_ready or set it unconditionally. I don't really know. I haven't put much thought into that. 🤷

Copy link
Member

Choose a reason for hiding this comment

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

As a rule of thumb you usually do not depend on anything chroot-... because it is, well, in the chroot anyway.
That's why I thought that perhaps you meant

if [ "$CHROOT_READY" -a "$CROSS_BUILD" ]; then
        hostmakedepends+=" cmake"
fi

We need to test that anyway... I'll close my PR, your's is better.

Copy link
Member Author

Choose a reason for hiding this comment

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

This chroot-cmake is very basic cmake, it lacks a lot of cmake functionality (but enough to build ccache and real cmake).
I think we should treat it the same with pkgconf and pkg-config. IOW, don't add it into base-chroot but let's package add it into hostmakedepends.

Copy link
Member

Choose a reason for hiding this comment

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

Ok, I see, then this makes sense.
Let's hope that ccache doesn't become too fancy with its cmake scripts in the next updates :)

Copy link
Member

Choose a reason for hiding this comment

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

If we don't add it to base-chroot then a better name then would be something like cmake-minimal or cmake-bootstrap.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I'll change it into cmake-bootstrap

Copy link
Member Author

Choose a reason for hiding this comment

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

Looking around, I think if ccache don't use those fancy ExternalProject, we should be fine.

The whole curl, libarchive, rhash, expat and nghttp2 was added for fetching tarball from external resource, verify checksum and build them.

@pullmoll
Copy link
Member

I like your approach. If we don't need more than what a cmake bootstrap supplies that would be very space saving.

@sgn sgn added the WIP Work in progress label Oct 20, 2020
@sgn sgn force-pushed the chroot-cmake-and-ccache branch 2 times, most recently from fadb1cf to 5d9f19e Compare October 20, 2020 23:52
@sgn sgn removed the WIP Work in progress label Oct 20, 2020
@pullmoll
Copy link
Member

pullmoll commented Oct 21, 2020

Running ./xbps-src bootstrap now behaves odd.
It seems to enter an endless loop trying to build ncurses.
When I break with ^C and redo the command it succeeds.
Not sure what kind of dependency loop (?) is causing this.

Did you try a bootstrap?

@pullmoll
Copy link
Member

In srcpkgs/ccache/template add the following lines to fix cross builds:

if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
        makedepends+=" libatomic-devel"
fi

pre_configure() {
        if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
                vsed -i src/CMakeLists.txt \
                        -e "/add_library/a target_link_libraries(ccache_lib PRIVATE atomic)"
        fi
}

${XBPS_MAKEJOBS:+--parallel=$XBPS_MAKEJOBS}"
make_build_args="-C Bootstrap.cmk"
makedepends="libarchive-devel"
short_desc="Cross MAKE (bootstrapping version)"
Copy link
Contributor

Choose a reason for hiding this comment

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

bad short_desc, cmake is not a "cross make" or anything of the sort

Copy link
Member Author

Choose a reason for hiding this comment

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

Heh, they self-claimed "cross-platform make" and I was lazy. I'll be more lazy to just write "CMake"

@pullmoll
Copy link
Member

On a 2nd try the ./xbps-src zap and ./xbps-src bootstrap succeeded to build stage0. No idea what was causing the loop in the 1st try.

@sgn
Copy link
Member Author

sgn commented Oct 21, 2020

Running ./xbps-src bootstrap now behaves odd.
It seems to enter an endless loop trying to build ncurses.
When I break with ^C and redo the command it succeeds.
Not sure what kind of dependency loop (?) is causing this.

Did you try a bootstrap?

Still running, my main machine is going down, so I need to bootstrap on real crappy machine now.

@pullmoll
Copy link
Member

I've been testing it and already successfully built x86_64 bootstrap stage0 + stage1, cross base-chroot for i686 and x86_64-musl, and several thousand x86_64 packages without issues so far. IMO this PR can be merged.

@sgn
Copy link
Member Author

sgn commented Oct 21, 2020

I'll let someone else press the merge button.

rm -rf Utilities/cmbzip2
rm -rf Utilities/cmcurl
rm -rf Utilities/cmexpat
# rm -rf Utilities/cmjsoncpp
Copy link
Member

Choose a reason for hiding this comment

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

why is this commented?

Copy link
Member Author

Choose a reason for hiding this comment

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

Originally, I wanted to remove all 3rd party libraries except libuv since I know that libuv is required. I found out jsoncpp was required later on.

}

do_check() {
: "real cmake is never built"
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be "full cmake" ? It's still real in that it can build packages.

Copy link
Member Author

Choose a reason for hiding this comment

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

I used that because CMake uses real real cmake to talk about cmake, I'll change description to "this is half baked cmake"

@ericonr ericonr marked this pull request as draft October 22, 2020 02:12
@sgn sgn marked this pull request as ready for review October 22, 2020 14:06
@sgn
Copy link
Member Author

sgn commented Oct 22, 2020

Ready again, now!

@pullmoll pullmoll merged commit 61c17e0 into void-linux:master Oct 23, 2020
@Piraty
Copy link
Member

Piraty commented Nov 1, 2020

why all the pain?
why not remove ccache from bootstrap packages, i don't see the necessity to have it that early really.
With ccache being bootstrap=yes we can't

  1. make it build its manpages, as they need asciidoc and perl.
  2. run tests with do_check() as it requires ctest which is part of cmake, but not cmake-bootstrap

@sgn
Copy link
Member Author

sgn commented Nov 1, 2020

For future reference, the discussion is on #26034

@sgn sgn deleted the chroot-cmake-and-ccache branch December 7, 2020 00:03
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants