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

Unable to build on vanilla Fedora 40 #14

Closed
ctron opened this issue May 13, 2024 · 7 comments · Fixed by #32
Closed

Unable to build on vanilla Fedora 40 #14

ctron opened this issue May 13, 2024 · 7 comments · Fixed by #32
Assignees

Comments

@ctron
Copy link
Contributor

ctron commented May 13, 2024

Using the following Containerfile, I am not able to build the project:

# Builder image
FROM docker.io/library/fedora:40 as builder

RUN dnf install -y npm nodejs

COPY . /usr/src

WORKDIR /usr/src

RUN npm clean-install --ignore-scripts --fetch-timeout=600000
RUN npm run build --dev
@carlosthe19916
Copy link
Member

@ctron could you try this Dockerfile? It contains the same commands but not using the NodeJS coming from Fedora but the one provided by NVM. I tried and it worked for me.

# Builder image
FROM docker.io/library/fedora:40 as builder

COPY . /usr/src
WORKDIR /usr/src

RUN touch ~/.bashrc && chmod +x ~/.bashrc
RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
RUN . ~/.nvm/nvm.sh && source ~/.bashrc && \
nvm install 20 && nvm alias default 20 && nvm use default && \
npm clean-install --ignore-scripts && npm run build --dev

@carlosthe19916
Copy link
Member

If we could confirm the Dockerfile I shared in my previous comment works, then I would be tempted to suggest that the NodeJS provided by default by Fedora 40 is the real problem.

@ctron
Copy link
Contributor Author

ctron commented May 13, 2024

It looks like it's missing something:

➜  trustify-ui git:(main) podman build . -f Containerfile.f40
STEP 1/8: FROM docker.io/library/fedora:40 AS builder
STEP 2/8: RUN touch ~/.bashrc && chmod +x ~/.bashrc
--> 00ebc7bf80d7
STEP 3/8: RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 16555  100 16555    0     0   103k      0 --:--:-- --:--:-- --:--:--  104k
=> Downloading nvm as script to '/root/.nvm'

=> Appending nvm source string to /root/.bashrc
=> Appending bash_completion source string to /root/.bashrc
=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
--> c3198144b6a3
STEP 4/8: RUN . ~/.nvm/nvm.sh && source ~/.bashrc &&   nvm install 20 && nvm alias default 20 && nvm use default
Downloading and installing node v20.13.1...
Downloading https://nodejs.org/dist/v20.13.1/node-v20.13.1-linux-x64.tar.gz...
################                                                          22.8%curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)

Binary download from https://nodejs.org/dist/v20.13.1/node-v20.13.1-linux-x64.tar.gz failed, trying source.
grep: /root/.nvm/.cache/bin/node-v20.13.1-linux-x64/node-v20.13.1-linux-x64.tar.gz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 24 CPU core(s)
Running with 23 threads to speed up the build
Downloading https://nodejs.org/dist/v20.13.1/node-v20.13.1.tar.gz...
######################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
$>./configure --prefix=/root/.nvm/versions/node/v20.13.1 <
Node.js configure: Found Python 3.12.2...
WARNING: failed to autodetect C++ compiler version (CXX=g++)
WARNING: failed to autodetect C compiler version (CC=gcc)
ERROR: No acceptable C compiler found!

       Please make sure you have a C compiler installed on your system and/or
       consider adjusting the CC environment variable if you installed
       it in a non-standard prefix.
nvm: install v20.13.1 failed!
Error: building at STEP "RUN . ~/.nvm/nvm.sh && source ~/.bashrc &&   nvm install 20 && nvm alias default 20 && nvm use default": while running runtime: exit status 1

@ctron
Copy link
Contributor Author

ctron commented May 13, 2024

I am not sure why it needs to run configure to install NodeJS? It should install it, not build it.

@carlosthe19916
Copy link
Member

I have created #15 to verify and be 100% sure the Dockerfile shared above actually works. And the result is that YES, the Dockerfile works. I ignore the reason why it does not work for you but if a Dockerfile can be built in Github actions I would expect the error might be somewhere in your local machine. Also my expectation would be that if it works in docker then podman should also work (but I didn't test podman).

The bottom line of the problem, is that the NodeJS provided by Fedora has something wrong and does not allow the UI to be built although at this moment I ignore what is exactly the "thing" in the NodeJS from RPM that is causing the problem.

@helio-frota helio-frota self-assigned this May 17, 2024
@helio-frota
Copy link
Collaborator

assigned to myself as I'm still playing with this containerfile #14 (comment)
(I'm using fedora 40)

@carlosthe19916
Copy link
Member

Solved by #32

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