unix icon indicating copy to clipboard operation
unix copied to clipboard

configure: Drop generated files

Open bgamari opened this issue 2 years ago • 11 comments
trafficstars

This is a generated file which should not be present in the repository.

Fixes ghc#19574. Fixes #257 .

bgamari avatar Jun 10 '23 13:06 bgamari

@bgamari makes sense, but CI fails unfortunately.

Bodigrim avatar Jun 10 '23 15:06 Bodigrim

@bgamari would not it suffice for GHC development purposes to remove config.sub only? This one is the only one, which is shown dirty after GHC build.

Bodigrim avatar Jun 11 '23 10:06 Bodigrim

@bgamari marking as draft until CI issue is resolved.

Bodigrim avatar Jul 23 '23 21:07 Bodigrim

Any news here?

hasufell avatar Sep 29 '23 16:09 hasufell

I have rebased this and reworked the patch to only drop config.sub.

bgamari avatar Oct 03 '23 16:10 bgamari

@bgamari @hasufell any ideas about CI failure on CentOS?

[ Info  ] Unpacking: ghc-9.4.7-x86_64-centos7-linux.tar.xz to /github/home/.ghcup/tmp/ghcup-9de163478a382955
[ Info  ] Installing GHC (this may take a while)
[ Error ] [./configure",
[ ...   ]                              "--prefix=/github/home/.ghcup/ghc/9.4.7"] failed with exit code 1.
[ Error ] Also check the logs in /github/home/.ghcup/logs
"ghcup --metadata-fetching-mode=Strict --cache install ghc recommended" failed!
Error: Process completed with exit code 2.

Bodigrim avatar Oct 03 '23 19:10 Bodigrim

Very strange; unfortunately I have no idea. I have tried to reproduce this in a centos:7 Docker container but installation succeeded.

bgamari avatar Oct 03 '23 20:10 bgamari

OK, CentOS and i386 failures are unrelated (see #300).

@bgamari this leaves us blocked on ARM jobs like https://github.com/haskell/unix/actions/runs/6395893930/job/17360539330?pr=283#step:7:137. Any ideas how to fix them?

configure: error: cannot run /bin/bash //github/workspace/config.sub
cabal: Failed to build unix-2.8.3.0. The failure occurred during the configure
step. The build process terminated with exit code 127

Bodigrim avatar Oct 03 '23 21:10 Bodigrim

Oh dear, yes. The problem is that config.sub is needed on some platforms and needs to be populated using autoreconf. Typically, packages wanting to use Build-type: Configure will leave the generated autoconf files like config.sub out of the repository but then include them in the source distribution (as otherwise Cabal wouldn't be able to run the configure script). Under this scheme users who do build unix from the repository would need to run autoreconf before doing so. This is unfortunately but IMHO the best in a number of bad options.

bgamari avatar Oct 03 '23 21:10 bgamari

@bgamari that's fine as long as you can fix the CI job. It seems to run autoreconf already?.. https://github.com/haskell/unix/blob/d63e6b41fcc05059bd51f559229712e4a3998d15/.github/workflows/ci.yml#L127-L131

Bodigrim avatar Oct 03 '23 21:10 Bodigrim

As much as I can figure out, the issue plagues runners with autoreconf-2.69. While autoreconf-2.71 happily generates configure / config.sub / config.guess from the scratch, autoreconf-2.69 generates configure only, which however unconditionally expects to find config.sub around:

  # Make sure we can run config.sub.
$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 ||
  as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5

I don't know what is the blessed way to resolve it, except migrating to autoreconf-2.71. I tried touch config.sub, but the next lines of configure actually expect it to produce meaningful output:

ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` ||
  as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5

Bodigrim avatar Oct 04 '23 20:10 Bodigrim

Idk what to do here. Feel free to re-open this with a fresh attempt.

hasufell avatar Jun 24 '24 04:06 hasufell