Skip to content

tools/coreutils: update to 9.1#9347

Merged
openwrt-bot merged 1 commit intoopenwrt:masterfrom
graysky2:coreutils
Feb 5, 2023
Merged

tools/coreutils: update to 9.1#9347
openwrt-bot merged 1 commit intoopenwrt:masterfrom
graysky2:coreutils

Conversation

@graysky2
Copy link
Contributor

@graysky2 graysky2 commented Feb 26, 2022

In addition to the version update, this commit also applies a fixup to allow building on MacOS involving renaming: [gt_TYPE_WINT_T] --> [gt_TYPE_WINT_T_GNUTLS] suggested by zhanhb.

Build system: x86_64
Build-tested: bcm2711/RPi4B

Signed-off-by: John Audia [email protected]

@paper42
Copy link

paper42 commented Feb 26, 2022

This bugfix sounds important and I think should be patched: https://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=e8b56ebd536e82b15542a00c888109471936bfda. Arch, Alpine and Void import this patch.

@neheb
Copy link
Contributor

neheb commented Feb 26, 2022

Prefix title with tools/

@graysky2 graysky2 force-pushed the coreutils branch 2 times, most recently from 708e850 to b017602 Compare February 26, 2022 20:53
@graysky2
Copy link
Contributor Author

Does anyone have some insight into why the macos build failed?

@mans0n mans0n added the build/scripts/tools pull request/issues for build, scripts and tools related changes label Feb 27, 2022
@aparcar
Copy link
Member

aparcar commented Feb 27, 2022

I'm surprised no logs are stored. I'll look into that later

@graysky2
Copy link
Contributor Author

graysky2 commented Mar 1, 2022

@aparcar - At least there is some output now:

 make[2] -C tools/libtool compile
    ERROR: tools/coreutils failed to build.
make -r tools/install: build failed. Please re-run make with -j1 V=s or V=sc for a higher verbosity level to see what's going on
make: *** [/Volumes/OpenWrt/openwrt/include/toplevel.mk:230: tools/install] Error 1
Error: Process completed with exit code 2.

Is there a way to build with the verbose setting? I do not have a MacOS device. Perhaps it can be virtualized. Never looked into that.

@ynezz
Copy link
Member

ynezz commented Mar 1, 2022

Does anyone have some insight into why the macos build failed?

configure.ac:38: error: version mismatch.  This is Automake 1.16.5,
configure.ac:38: but the definition used by this AM_INIT_AUTOMAKE
configure.ac:38: comes from Automake 1.16.4.  You should recreate
configure.ac:38: aclocal.m4 with aclocal and run automake again.
WARNING: 'automake-1.16' is probably too old.
         You should only need it if you modified 'Makefile.am' or
         'configure.ac' or m4 files included by 'configure.ac'.
make[1]: *** [tools/Makefile:169: tools/coreutils/compile] Error 1
         The 'automake' program is part of the GNU Automake package:

Is there a way to build with the verbose setting?

diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml
index 5b400b616d69..fcf7c04ceedc 100644
--- a/.github/workflows/tools.yml
+++ b/.github/workflows/tools.yml
@@ -114,12 +114,13 @@ jobs:
         run: |
           cd "$WORKPATH"
           pwd
+          printf 'CONFIG_DEVEL=y\nCONFIG_BUILD_LOG=y\n' > .config
           make defconfig
 
       - name: Build tools
         run: |
           cd "$WORKPATH"
-          make tools/install -j$(nproc) BUILD_LOG=1
+          make tools/install -j$(nproc) || make tools/install V=s -j1
 
       - name: Upload logs
         if: failure()

I do not have a MacOS device.

You've access to GH Actions so you've access to such machine.

Perhaps it can be virtualized.

Via GH Actions you've already access to the Linux/Windows/macOS virtual machines. The question is, for how long we're going to enjoy this free lunch :-)

This bugfix sounds important and I think should be patched

  1. I'm not sure whether it's clear, but tools/coreutils is only being used on not Linux OSes, such as macOS. On Linux we take whatever is available on the host
  2. This bugfix is for chmod, but actually only date readlink touch ln chown is being built/used from tools/coreutils

@neheb
Copy link
Contributor

neheb commented Mar 1, 2022

Does anyone have some insight into why the macos build failed?

configure.ac:38: error: version mismatch.  This is Automake 1.16.5,
configure.ac:38: but the definition used by this AM_INIT_AUTOMAKE
configure.ac:38: comes from Automake 1.16.4.  You should recreate
configure.ac:38: aclocal.m4 with aclocal and run automake again.
WARNING: 'automake-1.16' is probably too old.
         You should only need it if you modified 'Makefile.am' or
         'configure.ac' or m4 files included by 'configure.ac'.
make[1]: *** [tools/Makefile:169: tools/coreutils/compile] Error 1
         The 'automake' program is part of the GNU Automake package:

Is there a way to build with the verbose setting?

diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml
index 5b400b616d69..fcf7c04ceedc 100644
--- a/.github/workflows/tools.yml
+++ b/.github/workflows/tools.yml
@@ -114,12 +114,13 @@ jobs:
         run: |
           cd "$WORKPATH"
           pwd
+          printf 'CONFIG_DEVEL=y\nCONFIG_BUILD_LOG=y\n' > .config
           make defconfig
 
       - name: Build tools
         run: |
           cd "$WORKPATH"
-          make tools/install -j$(nproc) BUILD_LOG=1
+          make tools/install -j$(nproc) || make tools/install V=s -j1
 
       - name: Upload logs
         if: failure()

I do not have a MacOS device.

You've access to GH Actions so you've access to such machine.

Perhaps it can be virtualized.

Via GH Actions you've already access to the Linux/Windows/macOS virtual machines. The question is, for how long we're going to enjoy this free lunch :-)

Long time. Microsoft has enough money to subsidize CI.

This bugfix sounds important and I think should be patched

1. I'm not sure whether it's clear, but `tools/coreutils` is only being used on not Linux OSes, such as macOS. On Linux we take whatever is available on the host

2. This bugfix is for `chmod`, but actually only `date readlink touch ln chown` is being built/used from `tools/coreutils`

@graysky2 graysky2 changed the title coreutils: update to 9.0 tools/coreutils: update to 9.0 Mar 6, 2022
@aparcar
Copy link
Member

aparcar commented Mar 9, 2022

Please rebase this onto a5eeac8 since it fixes the log issue for macOS.

make tools/install -j$(nproc) || make tools/install V=s -j1

@ynezz I thought of this to however it may result in a failure of the parallel build which is fixed in a second run and thereby hidden. I prefer the build log artifact variant since a build finishes and can't silently fail.

@aparcar aparcar added the blocked pull request blocked by/waiting for another change label Mar 9, 2022
@aparcar
Copy link
Member

aparcar commented Mar 9, 2022

I added the blocked tag, this shouldn't be added prior the branch.

@graysky2
Copy link
Contributor Author

graysky2 commented Mar 9, 2022

Please rebase this onto a5eeac8 since it fixes the log issue for macOS.

@aparcar - Not sure if I did that correctly... Guessing not.

@aparcar
Copy link
Member

aparcar commented Mar 9, 2022

@graysky2 you did, I find the CI artifacts right here:

image

@neheb
Copy link
Contributor

neheb commented Mar 9, 2022

host/coreutils-9.0/build-aux/missing automake-1.16 --gnu Makefile
aclocal.m4:17: warning: this file was generated for autoconf 2.71.
You have another version of autoconf.  It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.
configure.ac:38: error: version mismatch.  This is Automake 1.16.5,
configure.ac:38: but the definition used by this AM_INIT_AUTOMAKE
configure.ac:38: comes from Automake 1.16.4.  You should recreate
configure.ac:38: aclocal.m4 with aclocal and run automake again.
WARNING: 'automake-1.16' is probably too old.
         You should only need it if you modified 'Makefile.am' or
         'configure.ac' or m4 files included by 'configure.ac'.
         The 'automake' program is part of the GNU Automake package:
         <https://www.gnu.org/software/automake>
         It also requires GNU Autoconf, GNU m4 and Perl in order to run:
         <https://www.gnu.org/software/autoconf>
         <https://www.gnu.org/software/m4/>
         <https://www.perl.org/>
make[3]: *** [Makefile:7393: Makefile.in] Error 63
make[3]: Leaving directory '/Volumes/OpenWrt/openwrt/build_dir/host/coreutils-9.0'
make[2]: *** [Makefile:38: /Volumes/OpenWrt/openwrt/build_dir/host/coreutils-9.0/.built] Error 2
time: tools/coreutils/compile#77.61#61.28#959.31

@zhanhb
Copy link
Contributor

zhanhb commented Mar 19, 2022

There are two issues to be resolved.

Suggest solution:

@neheb
Copy link
Contributor

neheb commented Mar 19, 2022

@graysky2
Copy link
Contributor Author

graysky2 commented Mar 19, 2022

Since there are two coreutils, I am confused how to prep the source dir in order to make a patch with quilt. For example, this command will prep coreutils from the packages repo but not the intended one locating in the openwrt repo/tools: make package/coreutils/{clean,prepare} V=s QUILT=1

I am following this wiki page.

@graysky2
Copy link
Contributor Author

@zhanhb - Made the patch and implemented your edits but still choked on macos.

@zhanhb
Copy link
Contributor

zhanhb commented Mar 20, 2022

File coreutils-9.0/m4/wint_t.m4 is not patched.
IMO, it's better to rename to gt_TYPE_WINT_T_COREUTILS rather than gt_TYPE_WINT_T_GNUTLS.

@graysky2 graysky2 force-pushed the coreutils branch 2 times, most recently from 669ade4 to adc3530 Compare March 20, 2022 11:14
@graysky2
Copy link
Contributor Author

File coreutils-9.0/m4/wint_t.m4 is not patched.

Missed that, thanks.

@aparcar - Is the PR good to merge after the branch as-is ie with the 2nd commit pulling in a5eeac8

@aparcar aparcar removed the blocked pull request blocked by/waiting for another change label Mar 20, 2022
@aparcar
Copy link
Member

aparcar commented Mar 20, 2022

Can you rebase this? The macOS patch should already be in master branch.

@graysky2
Copy link
Contributor Author

graysky2 commented Aug 9, 2022

tools/Makefile lists coreutils twice. The second entry should be removed.

I removed that line but masos-latest still fails

@Ansuel
Copy link
Member

Ansuel commented Oct 6, 2022

News on this?

@PolynomialDivision
Copy link
Member

Can you push -j1 V=s in another commit on the CI just to see the macos error?

@graysky2
Copy link
Contributor Author

Where are we at with this PR?

@neheb
Copy link
Contributor

neheb commented Jan 12, 2023

Needs a rebase.

@graysky2
Copy link
Contributor Author

macos test is still failing it seems :/

@misaka36
Copy link
Contributor

misaka36 commented Feb 3, 2023

@graysky2 Please remove upstreamed patch: 001-chmod-fix_exit_status_when_ignoring_sylinks.patch.

@graysky2
Copy link
Contributor Author

graysky2 commented Feb 3, 2023

@lovehackintosh - why do you request this? please see conversation string above for rationale to include.

@misaka36
Copy link
Contributor

misaka36 commented Feb 3, 2023

@graysky2 I downloaded https://ftp.gnu.org/gnu/coreutils/coreutils-9.1.tar.xz and unpacked,
Then found that 001-chmod-fix_exit_status_when_ignoring_sylinks.patch has been applied.

@graysky2
Copy link
Contributor Author

graysky2 commented Feb 3, 2023

@lovehackintosh - you are right, fixed

@misaka36
Copy link
Contributor

misaka36 commented Feb 3, 2023

001-m4.patch requires refresh, please run make tools/coreutils/refresh.

@graysky2
Copy link
Contributor Author

graysky2 commented Feb 3, 2023

@lovehackintosh

% make tools/coreutils/refresh V=s        
make[2]: Entering directory '/scratch/union/scripts/config'
make[2]: 'conf' is up to date.
make[2]: Leaving directory '/scratch/union/scripts/config'
make[1]: Entering directory '/scratch/union'
make[1]: *** No rule to make target 'tools/coreutils/refresh'.  Stop.
make[1]: Leaving directory '/scratch/union'
make: *** [/scratch/union/include/toplevel.mk:231: tools/coreutils/refresh] Error 2

@misaka36
Copy link
Contributor

misaka36 commented Feb 3, 2023

Try to run echo "CONFIG_DEVEL=y\nCONFIG_BUILD_ALL_HOST_TOOLS=y" >> .config && make defconfig

@graysky2
Copy link
Contributor Author

graysky2 commented Feb 3, 2023

Same error

@misaka36
Copy link
Contributor

misaka36 commented Feb 3, 2023

I refreshed it on macOS, you just need to apply this patch
1.patch

@graysky2
Copy link
Contributor Author

graysky2 commented Feb 3, 2023

@misaka36
Copy link
Contributor

misaka36 commented Feb 3, 2023

What is the meaning of the two checks?

@graysky2
Copy link
Contributor Author

graysky2 commented Feb 3, 2023

I am just pointing out that neither of these checks detected a dirty patch.

@misaka36
Copy link
Contributor

misaka36 commented Feb 3, 2023

Applying patch 001-m4.patch
patching file m4/gnulib-comp.m4
Hunk #1 succeeded at 2671 (offset -12 lines).
patching file m4/stdint.m4
patching file m4/vasnprintf.m4
patching file m4/wchar_h.m4
patching file m4/wctype_h.m4
patching file m4/wcwidth.m4
patching file m4/wint_t.m4

I think we need to make the patch apply cleanly, so a refresh is required.

@graysky2
Copy link
Contributor Author

graysky2 commented Feb 3, 2023

I applied it, but not sure why the build checks did not flag it. I am also not sure why I cannot refresh it myself.

@misaka36
Copy link
Contributor

misaka36 commented Feb 4, 2023

If you want to refresh it on Linux, you need to run sed -i 66a\tools-y+=coreutils tools/Makefile to set coreutils as default tools.

@misaka36
Copy link
Contributor

misaka36 commented Feb 5, 2023

@hauke Can you merge this?

In addition to version update, this commit applies a fixup to allow building
on MacOS involving renaming: [gt_TYPE_WINT_T] --> [gt_TYPE_WINT_T_GNUTLS]
suggested by zhanhb.

Build system: x86_64
Build-tested: bcm2711/RPi4B

Signed-off-by: John Audia <[email protected]>
@openwrt-bot openwrt-bot merged commit c560822 into openwrt:master Feb 5, 2023
@graysky2 graysky2 deleted the coreutils branch February 6, 2023 11:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build/scripts/tools pull request/issues for build, scripts and tools related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.