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

Problems building on rust:1-alpine3.21 #69

Open
bastibense opened this issue Dec 6, 2024 · 3 comments
Open

Problems building on rust:1-alpine3.21 #69

bastibense opened this issue Dec 6, 2024 · 3 comments

Comments

@bastibense
Copy link

Hey,

I've got some issues trying to compile (project uses the rust:1-alpine3.21 docker image):

Output:

backend-1  | The following warnings were emitted during compilation:
backend-1  | 
backend-1  | warning: pq-src@0.3.2: /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pq-src-0.3.2/source/src/port/strerror.c: In function 'gnuish_strerror_r':
backend-1  | warning: pq-src@0.3.2: /usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pq-src-0.3.2/source/src/port/strerror.c:95:16: error: returning 'int' from a function with return type 'char *' makes pointer from integer without a cast [-Wint-conversion]
backend-1  | warning: pq-src@0.3.2:    95 |         return strerror_r(errnum, buf, buflen);
backend-1  | warning: pq-src@0.3.2:       |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
backend-1  | 
backend-1  | error: failed to run custom build command for `pq-src v0.3.2`
backend-1  | 
backend-1  | Caused by:
backend-1  |   process didn't exit successfully: `/opt/neospark_server/target/debug/build/pq-src-6a6a5ac70ab0a09c/build-script-build` (exit status: 1)
backend-1  |   --- stdout
backend-1  |   cargo:rerun-if-changed=additional_include
backend-1  |   OUT_DIR = Some(/opt/neospark_server/target/debug/build/pq-src-0439659c96b7cb5f/out)
backend-1  |   OPT_LEVEL = Some(0)
backend-1  |   TARGET = Some(aarch64-unknown-linux-musl)
backend-1  |   HOST = Some(aarch64-unknown-linux-musl)
backend-1  |   cargo:rerun-if-env-changed=CC_aarch64-unknown-linux-musl
backend-1  |   CC_aarch64-unknown-linux-musl = None
backend-1  |   cargo:rerun-if-env-changed=CC_aarch64_unknown_linux_musl
backend-1  |   CC_aarch64_unknown_linux_musl = None
backend-1  |   cargo:rerun-if-env-changed=HOST_CC
backend-1  |   HOST_CC = None
backend-1  |   cargo:rerun-if-env-changed=CC
backend-1  |   CC = None
backend-1  |   cargo:rerun-if-env-changed=CC_ENABLE_DEBUG_OUTPUT
backend-1  |   RUSTC_WRAPPER = None
backend-1  |   cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
backend-1  |   CRATE_CC_NO_DEFAULTS = None
backend-1  |   DEBUG = Some(true)
backend-1  |   CARGO_CFG_TARGET_FEATURE = Some(neon)
backend-1  |   cargo:rerun-if-env-changed=CFLAGS_aarch64-unknown-linux-musl
backend-1  |   CFLAGS_aarch64-unknown-linux-musl = None
backend-1  |   cargo:rerun-if-env-changed=CFLAGS_aarch64_unknown_linux_musl
backend-1  |   CFLAGS_aarch64_unknown_linux_musl = None
backend-1  |   cargo:rerun-if-env-changed=HOST_CFLAGS
backend-1  |   HOST_CFLAGS = None
backend-1  |   cargo:rerun-if-env-changed=CFLAGS
backend-1  |   CFLAGS = None
backend-1  |   CARGO_ENCODED_RUSTFLAGS = Some()
backend-1  |   cargo:warning=/usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pq-src-0.3.2/source/src/port/strerror.c: In function 'gnuish_strerror_r':
backend-1  |   cargo:warning=/usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pq-src-0.3.2/source/src/port/strerror.c:95:16: error: returning 'int' from a function with return type 'char *' makes pointer from integer without a cast [-Wint-conversion]
backend-1  |   cargo:warning=   95 |         return strerror_r(errnum, buf, buflen);
backend-1  |   cargo:warning=      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
backend-1  | 
backend-1  |   --- stderr
backend-1  | 
backend-1  | 
backend-1  |   error occurred: Command LC_ALL="C" "cc" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-gdwarf-4" "-fno-omit-frame-pointer" "-I" "/usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pq-src-0.3.2/source/src/port/" "-I" "/usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pq-src-0.3.2/source/src/include" "-I" "/usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pq-src-0.3.2/additional_include" "-I" "/opt/neospark_server/target/debug/build/pq-src-0439659c96b7cb5f/out/more_include/" "-I" "/usr/include" "-DFRONTEND" "-D_GNU_SOURCE" "-DUSE_OPENSSL=1" "-o" "/opt/neospark_server/target/debug/build/pq-src-0439659c96b7cb5f/out/636963051319565a-strerror.o" "-c" "/usr/local/cargo/registry/src/index.crates.io-6f17d22bba15001f/pq-src-0.3.2/source/src/port/strerror.c" with args cc did not execute successfully (status code exit status: 1).
backend-1  | 
backend-1  | 

Cargo.toml:

pq-sys = { version = "0.6.3", features = ["bundled"] }

Building the project with rust:1-alpine3.20 works fine.

@weiznich
Copy link
Collaborator

weiznich commented Dec 6, 2024

Thanks for reporting. That either seems to be a problem with alpine itself (as the signature of that function changed) or a problem with the bundled source code from postgresql. Consider reporting it in these two locations.

That written: We generally only consider the targets tested in our CI setup as completely supported. Everything else (including musl) might work or not. We happily accept PR's to fix it, but we won't test or otherwise notice/fix such issues on our own.

@bastibense
Copy link
Author

Thanks for your response.

I did some more digging, and realized that the main difference between those alpine versions is the libpq and libpq-dev version: 3.20 uses 16.6-rc0 and 3.21 uses 17.2-rc0.

So I'd assume it's an upstream issue.

@weiznich
Copy link
Collaborator

weiznich commented Dec 6, 2024

The changes in the package libpq and libpq-dev shouldn't be related to this as the bundled flag will use it's own bundled (== included in the crates.io package) version of the libpq source code. The error in your initial post indicates that this bundled libpq version (should be upstream 17.0 at the time of writing) does not compile anymore on the new alpine version. That might be due to changes on their side, compile updates on their side (possibly an previous warning now turned into an error?) or due to incompatibilities in that libpq version with alpine itself.

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

No branches or pull requests

2 participants